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]

[Bug translator/13296] inaccessible sdt.h operands of the form symbol(%reg)


https://sourceware.org/bugzilla/show_bug.cgi?id=13296

Jonathan Lebon <jlebon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jlebon at redhat dot com

--- Comment #4 from Jonathan Lebon <jlebon at redhat dot com> ---
The branch jlebon/pr13296 contains patches to support this now. More precisely,
we also pick up STT_OBJECT symbols from the symbol table, which we then try to
use if we meet such an operand.

Example:

$ cat prog.c

#include "sys/sdt.h"

int globalvar = 3;

int main(int argc, char **argv)
{
   globalvar += argc;
   STAP_PROBE1(test, mymark, globalvar);
   return 0;
}
$ gcc prog.c -o prog -I../install/include -DSTAP_SDT_ARG_CONSTRAINT=m
$ readelf --notes prog | tail -n 7
Notes at offset 0x00001088 with length 0x0000004c:
  Owner                 Data size       Description
  stapsdt              0x00000037       NT_STAPSDT (SystemTap probe
descriptors)
    Provider: test
    Name: mymark
    Location: 0x000000000040050c, Base: 0x00000000004005b0, Semaphore:
0x0000000000000000
    Arguments: -4@globalvar(%rip)
$ stap -e 'probe process.mark("mymark") { printf("globalvar is %d\n", $arg1) }'
-c ./prog
globalvar is 4
$

-- 
You are receiving this mail because:
You are the assignee for the bug.


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