This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: userspace probe breakage with gcc 4.8 due to inablility to locate semaphore variable


Here is a program that fails for me. (With details about building, machine etc).  To elaborate from my last email, it is seemingly the attempt to access a local variable in the probe that fails. Does the following work for you?

Many thanks,
Mayuresh


#include <sdt.h>
#include <unistd.h>

void foo()
{
    volatile int f = 100;
    STAP_PROBE(Prod,foo);
}


int main()
{
    while(true)
    {
        sleep(1);
        foo();
    }
}

################################################
1) Building:
################################################
$ g++ --version | head -1 #gcc used by build
g++ (GCC) 4.8.2

$ /usr/bin/g++ --version | head -1   #native gcc
g++ (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3)

$ rpm -qa | grep elfutils
elfutils-devel-0.152-1.el6.x86_64
elfutils-libs-0.152-1.el6.x86_64
elfutils-libelf-devel-0.152-1.el6.x86_64
elfutils-libelf-0.152-1.el6.x86_64
elfutils-0.152-1.el6.x86_64

$ uname -r
2.6.32-220.7.1.el6.x86_64

systemtap is not installed on build box. Only sdt.h and std-config.h from stap 1.6 (attached) are available on build box

$ g++ -O3 -g foo.cpp   -o /tmp/foo  //May need a -I to point to sdt.h

If I build with g++ -O3 -g -gdwarf-2, the probe works fine

#####################################################
2) Executing and probing on different box with same kernel and native gcc 4.6 (gcc 4.8 not installed on runtime box)
######################################################
$  /tmp/foo&
[1] 8213
$ sudo stap -g -e 'probe process("/tmp/foo").provider("Prod").mark("foo") { printf("f : %d\n",$f); }' -x 8213
semantic error: no match while resolving probe point process("/tmp/foo").provider("Prod").mark("foo")
Pass 2: analysis failed.  Try again with another '--vp 01' option.

$  gcc --version | head -1
gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3)

$ stap --version
Systemtap translator/driver (version 1.6/0.152 non-git sources)
Copyright (C) 2005-2011 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
enabled features: AVAHI LIBRPM LIBSQLITE3 NSS BOOST_SHARED_PTR TR1_UNORDERED_MAP NLS

$ rpm -qa | grep systemtap
systemtap-runtime-1.6-5.el6_2.x86_64
systemtap-initscript-1.6-5.el6_2.x86_64
systemtap-1.6-5.el6_2.x86_64

$ rpm -qa | grep elfutils
elfutils-libelf-0.152-1.el6.x86_64
elfutils-libs-0.152-1.el6.x86_64
elfutils-0.152-1.el6.x86_64

$ uname -r
2.6.32-220.7.1.el6.x86_64









-----Original Message-----
From: Frank Ch. Eigler [mailto:fche@redhat.com]
Sent: Monday, April 20, 2015 3:07 PM
To: Mayuresh Kulkarni
Cc: 'systemtap@sourceware.org'
Subject: Re: userspace probe breakage with gcc 4.8 due to inablility to locate semaphore variable


mkulkarni wrote:
>
 [...]
> Meanwhile, in my setup, I have found out that the runtime box has
> native gcc 4.4 And the regression is because the build uses gcc 4.8
> (which uses dwarf4 by default)

Why do you think so?  stap works fine here on that version of gcc, and older, and newer.  Can you forward your full gcc/stap/elfutils/kernel versions, and perhaps a binary (compiled with your gcc 4.8) that was giving stap a hard time?


- FChE
This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature. For additional important disclaimers and disclosures regarding KCGâs products and services, please click on the following link:

http://www.kcg.com/legal/global-disclosures

Attachment: sdt.h
Description: sdt.h

Attachment: sdt-config.h
Description: sdt-config.h


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]