fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
pfallenop has quit [Ping timeout: 260 seconds]
pfallenop has joined #systemtap
_whitelogger has joined #systemtap
naveen has joined #systemtap
naveen has quit [Client Quit]
naveen has joined #systemtap
naveen has quit [Quit: naveen]
ericlee has joined #systemtap
naveen has joined #systemtap
naveen has quit [Quit: naveen]
CustosLimen has quit [Ping timeout: 252 seconds]
naveen has joined #systemtap
naveen has quit [Client Quit]
naveen has joined #systemtap
naveen has quit [Ping timeout: 265 seconds]
naveen has joined #systemtap
naveen has quit [Quit: naveen]
naveen has joined #systemtap
ChanServ has quit [shutting down]
ChanServ has joined #systemtap
wcohen has quit [Ping timeout: 244 seconds]
CustosLimen has joined #systemtap
wcohen has joined #systemtap
naveen has quit [Quit: naveen]
Meths_ is now known as Meths
gilfoyle has joined #systemtap
<gilfoyle> hi folks, I'm learning systemtap and playing with the probe python.function.entry
<fche> yo
<gilfoyle> I can't seem to see any activity for my multi-thread testing script :)
<gilfoyle> hi fche :)
<gilfoyle> I will pastebin my script + stap
<fche> sure
<fche> what OS ?
<gilfoyle> Linux 3.10
<fche> I mean which distro
<gilfoyle> CentOS 7.2
<gilfoyle> this results in no output
<fche> how about single-threaded?
<fche> interesting, I think I'm seeing the same thing on fedora24.
<fche> single-threaded things work fine
<fche> it's as though the multithreaded libpython doesn't use the code paths where the sys/sdt.h macro calls were inserted
<gilfoyle> sorry, I had to step away from the computer
<gilfoyle> I haven't tried single-threaded, but using the pyfuntop.stp I could see it picking up on other python processes, including printing stuff out of the threading.py, except for this test I posted. Essentially, I was at a dtrace talk last night and at the end I was talking to the speaker and told him I believed this could be done with systemtap, so I was going to see how easy it was
<gilfoyle> fche: I tried re-writing that program in ruby and similarly, I don't see much activity from stap
<gilfoyle> this one using the ruby.cmethod.entry, http://paste.ubuntu.com/23134580/
<fche> the reasons for similar behavior between ruby & python are likely to be accidental
<fche> (multithreaded programs in general, at the kernel level, are perfectly fine)
<gilfoyle> I suspected :)
<gilfoyle> so out of curiosity, what's the standard that allows both dtrace and systemtap to share probes?
<fche> they don't actually share probes (at the object code level)
<fche> it's only at the source level - the {STAP,DTRACE}_PROBEN(...) macros look the same
<fche> their implementation is completely different
<gilfoyle> so same interface in other words?
<fche> same API to the program that #includes <sys/sdt.h>
<gilfoyle> oh, I see how it works now.
<gilfoyle> fche: is there a way for me to tell if the binary has been built with the system tap probes?
<fche> readelf -n $BINARY
<fche> and look for NT_STAPSDT notes
<fche> for something like python, may need the /usr/lib64/libpython*so rather than /usr/bin/python
<gilfoyle> awesome, thanks!
<gilfoyle> sorry.. I'm a bit curious, what's the reason for the elf notes?
<fche> those notes are what systemtap (and gdb e.g.) look for in order to locate the macro call sites, and their parameters
<gilfoyle> thank you! I'd like to understand this a bit better. I'll grab the sources
<gilfoyle> out of curiosity, is there an official tree on github?
<fche> git://sourceware.org/git/systemtap.git
<fche> interesting trace from
<fche> # sudo stap -e 'probe process("/usr/lib64/libpython2.7.so").function("*").call { if(uid()==500) println(pp()) }' # substitute your uid
<fche> while your multithreaded python script is running
<fche> I see no PyEval_EvalFrameEx once the threads are running
<fche> http://paste.fedoraproject.org/422122/31482147/ <-- printing the tid() and ppfunc()
<fche> it's as though there's an error during internal libpython evaluation process
<gilfoyle> interesting :)
<fche> methinks something is wrong with your test program (& multithreaded python in general)
<fche> if you replace that time.sleep(2) with print ("yo") you get stap-side results just fine
<gilfoyle> oh :)
<fche> # stap -e 'probe python.function.entry { if (uid()==500) println(filename, " ", funcname, " ", lineno) }' # again change 500
<fche> (or drop it, for systemwide probing)
<gilfoyle> maybe worth diving deep into how time.sleep is implemented
<gilfoyle> I think strace suggested it was select() based
<fche> from a stack traceback experiment, it looked as though the error occurred during module-time loading
<fche> ie didn't even get as far as trying to run the sleep function
<gilfoyle> Oh, I see.
<fche> # stap -e 'probe process("/usr/lib64/libpython2.7.so").function("*").call { if(uid()!=500) next; println(tid(), " ", ppfunc()) if (ppfunc() =~ "PyErr") print_ubacktrace() }'
<gilfoyle> let me try these
<fche> that last one was for getting a backtrace in the PyErr* type functions
<gilfoyle> the more I use systemtap the more amazed I am at how awesome this is and how little people know about it.
<fche> hey help spread the word
<fche> it's most credible from users :)
<gilfoyle> true!
<gilfoyle> :)
<gilfoyle> fche: did you run the code above with -d /usr/lib64/python2.7/lib-dynload/timemodule.so ?
<gilfoyle> it appears to provide the PyEval_*
<fche> nope, but you should
<gilfoyle> s/provide/print
<fche> it may be important that I'm running on fedora 24 here, not rhel7
<fche> just had similar symptoms as you at the beginning
<gilfoyle> true :)
<gilfoyle> this reminds me, I should reopen my FAS account
<fche> if you like; you won't need that for anything stap related
<gilfoyle> I was going off on a tangent :-)