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]

failed to trace printf


Hi Mark, 

I was trying to trace libc functions using SystemTap. 
Strangely there were couple of functions that failed. 
Can you let me know what could be the reason?

I am trying these with fedora 10 system on a x86_64 with systemtap
installed from this week's systemtap snapshot.

# nm /lib64/libc.so.6 | grep -w -e __printf -e printf
000000000004fdb0 t __printf
000000000004fdb0 T printf
#

It fails for printf and works well for __printf. 
I actually expected it to be the other way.

For example: 
# cat /tmp/libc.stp
probe process("/lib64/libc.so.6").function("printf")
{
	printf("%s printf called\n", pp())
}
# 
# stap -p4 /tmp/libc.stp
gives me 

SystemTap translator/driver (version 0.9.7/0.141 non-git sources)
Copyright (C) 2005-2009 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Session arch: x86_64 release: 2.6.27.5-117.fc10.x86_64
Created temporary directory "/tmp/stapOshHSg"
Searched '/usr/local/share/systemtap/tapset/x86_64/*.stp', found 3
Searched '/usr/local/share/systemtap/tapset/*.stp', found 51
Pass 1: parsed user script and 54 library script(s) in 240usr/10sys/251real ms.
semantic error: no match while resolving probe point process("/lib64/libc.so.6").function("printf")
semantic error: no probes found
Pass 2: analyzed script: 0 probe(s), 0 function(s), 0 embed(s), 0 global(s) in 30usr/0sys/29real ms.
Pass 2: analysis failed.  Try again with another '--vp 01' option.
Running rm -rf /tmp/stapOshHSg

while 
# cat /tmp/libc.stp
probe process("/lib64/libc.so.6").function("__printf")
{
	printf("%s printf called\n", pp())
}
# 
# stap -p4 /tmp/libc.stp
gives
SystemTap translator/driver (version 0.9.7/0.141 non-git sources)
Copyright (C) 2005-2009 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Session arch: x86_64 release: 2.6.27.5-117.fc10.x86_64
Created temporary directory "/tmp/stapNzLq8K"
Searched '/usr/local/share/systemtap/tapset/x86_64/*.stp', found 3
Searched '/usr/local/share/systemtap/tapset/*.stp', found 51
Pass 1: parsed user script and 54 library script(s) in 280usr/10sys/297real ms.
probe __printf@/usr/src/debug/glibc-20081113T2206/stdio-common/printf.c:30 process=/lib64/libc-2.9.so reloc=.dynamic pc=0x4fde2
Pass 2: analyzed script: 1 probe(s), 1 function(s), 1 embed(s), 0 global(s) in 40usr/0sys/36real ms.
Pass 3: using cached /home/srikar/.systemtap/cache/ca/stapconf_caa08bbbba3cc128e60e942520edcf1e_484.h
/home/srikar/.systemtap/cache/37/stap_3752224ddf8015b146e24646c823d069_1096.ko
Pass 3: using cached /home/srikar/.systemtap/cache/37/stap_3752224ddf8015b146e24646c823d069_1096.c
Pass 4: using cached /home/srikar/.systemtap/cache/37/stap_3752224ddf8015b146e24646c823d069_1096.ko
Running rm -rf /tmp/stapNzLq8K

I am wondering why its able to resolve to __printf but not to printf

Also I tried with strcmp and that also failed.
# nm /lib64/libc.so.6 | grep strcmp
0000003497880880 t __GI_strcmp
0000003497880880 T strcmp
#

This time it failed for both _GI_strcmp and strcmp.

--
Thanks and Regards
Srikar 


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