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: a couple simple scripts


Martin Hunt wrote:

OK. let's narrow this down. Does this one work?

stap -e 'probe kernel.function("sys_open") {print(execname()."[".string(pid())."]"." opened ".$filename)}'


I got error on this
ERROR: pointer dereference fault near identifier '$filename' at <input>:1:86

Here's stap -v
[root@elm3b99 src]# ./stap -v -e 'probe kernel.function("sys_open") {print(execname()."[".string(pid())."]"." opened ".$filename)}'
Created temporary directory "/tmp/stapqHatNX"
Searched '/usr/local/share/systemtap/tapset/2.6.9-17.ELsmp/*.stp', match count 0Searched '/usr/local/share/systemtap/tapset/2.6.9/*.stp', match count 0
Searched '/usr/local/share/systemtap/tapset/2.6/*.stp', match count 0
Searched '/usr/local/share/systemtap/tapset/*.stp', match count 7
Pass 1: parsed user script and 7 library script(s).
parsed 'sys_open' -> func 'sys_open'
pattern 'kernel' matches module 'kernel'
focused on module 'kernel' = [c0100000-c046909c, bias 0]
pattern 'sys_open' matches function 'sys_open'
selected function sys_open
querying prologue-end of function 'sys_open'
finding location for local 'filename' near address c0159444, module bias 0
pattern 'kernel' matches module 'kernel'
Pass 2: analyzed user script. 1 probe(s), 40 function(s), 0 global(s).
Pass 3: translated to C into "/tmp/stapqHatNX/stap_0_1125683148.c"
Running /usr/bin/make -C "/lib/modules/2.6.9-17.ELsmp/build" M="/tmp/stapqHatNX" modules
make: Entering directory `/usr/src/kernels/2.6.9-17.EL-smp-i686'
CC [M] /tmp/stapqHatNX/stap_0_1125683148.o
Building modules, stage 2.
MODPOST
CC /tmp/stapqHatNX/stap_0_1125683148.mod.o
LD [M] /tmp/stapqHatNX/stap_0_1125683148.ko
make: Leaving directory `/usr/src/kernels/2.6.9-17.EL-smp-i686'
Pass 4: compiled into "stap_0_1125683148.ko"
Running /usr/bin/sudo /usr/local/libexec/systemtap/stpd -r /tmp/stapqHatNX/stap_0_1125683148.ko
ERROR: pointer dereference fault near identifier '$filename' at <input>:1:86
Running /bin/rm -rf /tmp/stapqHatNX



how about this one

stap -e 'probe kernel.function("do_execve") {print(execname()."[".string(pid())."]"." opened ".$filename)}'


This works.

Thanks, Hien.


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