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]

string pointers in probe scripts


Hi All,
I think it would be useful to define some I/O tapsets...
____________________________________________
#! stap -p4
probe begin {
log("started");
}
function lg_it(fname) {
log(string(fname));
}
probe kernel.function("sys_open") {
lg_it($filename);
}
____________________________________________
gives me this...
____________________________________________
[root@localhost src]# ./stap -v -g testsuite/three.stp
Created temporary directory "/tmp/stapIAWoG5"
...
error: type mismatch for identifier 'num' at /usr/local/share/systemtap/tapset/builtin_conversions.stp:13:26: long vs. string
Pass 2: analyzed user script. 2 probe(s), 15 function(s), 0 global(s).
____________________________________________
if I change log(string(fname));
to log(fname); it will compile the module but then I get...
____________________________________________
[root@localhost src]# ./stap -v -g testsuite/test.stp
Created temporary directory "/tmp/stap8iUh6w"
...
make: Leaving directory `/home/krstaffo/kernels/linux-2.6.13-rc5'
Pass 4: compiled into "stap_0_1124994346.ko"
Running /usr/bin/sudo /usr/local/libexec/systemtap/stpd /tmp/stap8iUh6w/stap_0_1124994346.ko
started
ERROR: pointer dereference fault near identifier '$filename' at testsuite/three.stp:17:8
Running /bin/rm -rf /tmp/stap8iUh6w
____________________________________________ I am wondering if this is happening because the filename parm in sys_open is pointing out
to user land. I suspect access to pointers referencing user space is not supported.


This is with the latest elfutils packages (114+) and the very latest CVS SystemTap src.

Tx,

--
Kevin Stafford
DES 2 | MS 2M3
Beaverton - OR
Linux Technology Center
IBM Systems & Technology
Phone: 1-503-578-3039
Email: kevinrs@us.ibm.com




-- Kevin Stafford DES 2 | MS 2M3 Beaverton - OR Linux Technology Center IBM Systems & Technology Phone: 1-503-578-3039 Email: kevinrs@us.ibm.com




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