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
orivej has joined #systemtap
mbenitez has joined #systemtap
mbenitez has joined #systemtap
mbenitez has quit [Changing host]
<efiop> Aha! stapprobes.3stap +727: $addr[0] {kernel,user}_{char,int,...}(& $addr[0]) .
scox_ has joined #systemtap
<fche> or just $addr
<fche> oh I see what you're quoting
<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.
atomlin is now known as notatomlin
wcohen has quit [Ping timeout: 260 seconds]
tromey has joined #systemtap
<fche> looks good, thanks!
irker661 has joined #systemtap
<irker661> systemtap: rkuprieiev systemtap.git:refs/heads/master * release-3.1-37-g39b70de / man/stap.1.in man/stapprobes.3stap: man: add a note about direct pointer dereferencing http://tinyurl.com/k999s6u
drsmith_away is now known as drsmith
<efiop> Thanks for your help!
<fche> thanks!
wcohen has joined #systemtap
orivej has quit [Ping timeout: 264 seconds]
brolley has joined #systemtap
mjw has quit [Quit: Leaving]
pwithnall____ has quit [Quit: pwithnall____]
georg has joined #systemtap
georg is now known as Guest68074
Guest68074 is now known as georgj
<georgj> Hello!
<georgj> I think I found a small bug in the default tapset.
<georgj> When I use the syscall.fnctl probe, there is the possibility of triggering it twice
<georgj> probe syscall.fcntl {
<georgj> }
<georgj> probe syscall.fcntl.return {
<georgj> }
<georgj> printf("\nSYSCALL %s\n", probefunc())
<georgj> if (pid() == target()) {
<georgj> if (pid() == target()) {
<georgj> printf("\nRETURN\n")
<georgj> }
<georgj> }
<georgj> With this script: https://pastebin.com/C94wCs2a, I get the following output:
<georgj> SYSCALL compat_sys_fcntl64
<georgj> SYSCALL SyS_fcntl
<georgj> RETURN
<georgj> RETURN
<georgj> test app:
<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
<drsmith> what version of systemtap?
<georgj> Systemtap translator/driver (version 3.1/0.158, non-git sources)
<drsmith> I wonder why the testsuite hasn't seen this
<drsmith> hmm, when running the testsuite's example program by hand, I do see this problem
<drsmith> georgj: thanks for the bug report, I'll file a pr and get this fixed today or tomorrow
<georgj> thank you both for the quick response! that's just amazing :-)
<fche> hey thanks for dropping by and giving the tool a chance
georgj has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<drsmith> hmm, I think I see how this got past the testsuite logic
<drsmith> it basically skips input it doesn't understand
Humble has joined #systemtap
drsmith is now known as drsmith_away
drsmith_away is now known as drsmith
pwithnall____ has joined #systemtap
scox_ has quit [Ping timeout: 240 seconds]
mbenitez has quit [Quit: Leaving]
wcohen has quit [Ping timeout: 246 seconds]
drsmith is now known as drsmith_away
brolley has quit [Quit: Leaving.]
tromey has quit [Quit: ERC (IRC client for Emacs 26.0.50)]
wcohen has joined #systemtap
pwithnall____ has quit [Quit: pwithnall____]
brolley has joined #systemtap
brolley has left #systemtap [#systemtap]