fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
wakatana2 has left #systemtap [#systemtap]
nkambo has joined #systemtap
hkshaw has joined #systemtap
hkshaw has quit [Client Quit]
hkshaw has joined #systemtap
hkshaw has quit [Client Quit]
hkshaw has joined #systemtap
hkshaw1 has joined #systemtap
hkshaw1 has quit [Client Quit]
hkshaw has quit [Ping timeout: 272 seconds]
hkshaw has joined #systemtap
hkshaw has quit [Quit: Leaving.]
wakatana2 has joined #systemtap
fche has quit [Ping timeout: 265 seconds]
fche has joined #systemtap
josch has joined #systemtap
<josch>
hi, through https://sourceware.org/systemtap/wiki I got to this gist https://gist.github.com/myaut/ab4dd51ff811bd367328 what puzzles me is: because of the variable "lines" this probe will not be executed in parallel. If that variable wouldn't exist, could that probe be called in parallel with itself and thus could the output become gibberish again? Thanks!
<fche>
hi
<fche>
I think your intuition is about right
<fche>
the global variable is indeed locked by stap, so if multiple processes named alloc-bench or threads of such a process were to do write syscalls at the same time, the presence of the stap probe will to some extent serialize them
<fche>
but the stap probe runs very briefly, so the output of the userspace program may not be appreciably modified (considering that write(2) is supposed to be atomic anyway, to userspace)
<fche>
(note also that if alloc-bench happens to be multithreaded, then the lines[pid()] style of indexing can internally mess up the systemtap side of the state, by multiple threads reusing the same slots
<josch>
fche: thanks, my ultimate question is: if I do a print in one probe, could its writing of output to stdout be interrupted by another probe? Or can I rely on the write happening atomically?
<fche>
ok, that's a different issue: what sort of serialization does stap itself promise for its output
<josch>
right
<fche>
just trying to look up or guess from memory
<fche>
I believe output from a single probe handler is accumulated into a temporary buffer, then flushed in its entirety at probe handler conclusion
<fche>
so multiple handlers running concurrently shouldn't have interleaved output appearing at stap's stdout
<josch>
right, that's what i'm seeing in my tests
<josch>
it's just hard to create a situation with interleave because just by chance stuff might not interleave ;)
<fche>
ie. to confirm stap's implementation? yeah.