fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
_whitelogger has joined #systemtap
nkambo has quit [Ping timeout: 260 seconds]
orivej has joined #systemtap
ravi_ has joined #systemtap
orivej has quit [Ping timeout: 264 seconds]
Humble has quit [Ping timeout: 240 seconds]
lberk has quit [*.net *.split]
frdeso has quit [*.net *.split]
frdeso has joined #systemtap
lberk has joined #systemtap
sanoj has joined #systemtap
sanoj has quit [Ping timeout: 260 seconds]
sanoj has joined #systemtap
Humble has joined #systemtap
nkambo has joined #systemtap
wielaard has joined #systemtap
pwithnall____ has joined #systemtap
orivej has joined #systemtap
wielaard has quit [Quit: Leaving]
irker629 has joined #systemtap
<irker629>
systemtap: mcermak systemtap.git:refs/heads/master * release-3.1-36-g4ae155a / tapset/linux/aux_syscalls.stp tapset/linux/i386/syscall_num.stp tapset/linux/sysc_statx.stp tapset/linux/x86_64/syscall_num.stp testsuite/buildok/nd_syscalls2-detailed.stp testsuite/buildok/syscalls2-detailed.stp testsuite/systemtap.syscall/stat.c: PR21297 Add support for new statx syscall http://tinyurl.com/lhoterb
irker629 has quit [Ping timeout: 240 seconds]
scox_ has quit [Ping timeout: 264 seconds]
orivej has quit [Ping timeout: 240 seconds]
wielaard has joined #systemtap
sanoj has quit [Ping timeout: 264 seconds]
ravi_ has quit [Quit: Leaving]
mjw has quit [Quit: Leaving]
wielaard has quit [Quit: Leaving]
mjw has joined #systemtap
efiop has joined #systemtap
<efiop>
Hi! I want to dereference a single pointer in systemtap to print it, but I don't quite get how. I.e. if i had a probe on a fucntion with argument foo, that is a pointer to a struct with member bar, then I would print it as "%d\n", $foo->bar. But what if foo is a pointer to, lets say, int, how do I print *foo in systemtap?
<fche>
user_int($addr) or kernel_int($addr)
<fche>
we should get a dereference operator before too long though
<efiop>
It works! Thanks!
<efiop>
Not very intuitive, though =) Did quite a bit of googling and greping through the manual, but didn't manage to find an answer.
<fche>
sorry about that :)
<fche>
if you'd be willing to draft up a sentence or two diffs to the man page, I'd love to merge it
<efiop>
Sure, will be more than happy! I'm just going through the HACKING doc and setting up my env.
<fche>
I guess the man/.../stapprobes.3stap is the page where $var->field is explained most
<fche>
that was just an explanation on .return probes
<efiop>
Yeah, just found a kernel_int() mentioning inthere.
<fche>
I'd put the new mention higher up, where $var->field traversal, $return etc are first mentioned, more like 43% the way in
<efiop>
After a bit for surfing through the man pages, I actually think the best way to put a note on dereferencing pointer itself is in https://sourceware.org/systemtap/man/stap.1.html TYPECASTING
<efiop>
as this is probably the first place where people will find dereferencing of the members and thus might find a note about dereferencing pointer itself.
<efiop>
What do you think?
<fche>
you're probably right; we should mention these -> etc. bits there too.
<georgj>
this probably happens because the probe gets installed at multiple locations instead of only the first available one: https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=blob;f=tapset/linux/sysc_fcntl.stp;h=9747ea29eb83edc8f82d30d7a02ff0c5d9fc93b0;hb=4ae155ae612963b95d9a9a05273ab4baade1cf83#l23
<georgj>
but I'm not sure how to fix this because I don't know enough about kernel internals
<georgj>
(I don't know in what order the hooking functions should be specified)
<fche>
hm interesting question . and maybe with different answers for 32- vs 64-bit application
<georgj>
that's true
<georgj>
my computer is 64 bit but the bug only triggers if the app is 32bit
<fche>
if your app is 64bit, is only the latter or only the former triggered?
<georgj>
i'll test
Humble has quit [Ping timeout: 260 seconds]
<georgj>
SYSCALL SyS_fcntl
<georgj>
RETURN
<fche>
ok. what's happening here is that the compat_* call takes the 32-bit syscall args, jams them into 64-bit places, then calls the 64-bit syscall handler to do the work
<fche>
more or less
<georgj>
I agree
<georgj>
I was wondering if it's even necessary to hook the compat_ calls or if they always call the real function
<fche>
drsmith might know
<drsmith>
I think the answer to that question is "it depends"
<drsmith>
it is probably half and half
<drsmith>
we take pains in the syscall/nd_syscall tapsets to make sure you only get 1 probe hit even the the compat call ends up calling the real call
<drsmith>
s/even the/even when the/
<fche>
where is that mechanism visible?
<drsmith>
if fcntl is doing this to you, its a bug
<georgj>
@fche, most syscalls use aliases with ! instead of ?
<drsmith>
the fix would be to add a call to @__syscall_gate_compat_simple (or one of its variants) to the "real" call
<georgj>
@fche: i might actually be mistaken, I can't find any instance of that right now
<drsmith>
what kernel/arch are you on?
<fche>
georgj, there are different levels of aliases
<georgj>
Linux ubuntu 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux