fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
khaled has quit [Quit: This computer has gone to sleep]
hkshaw has joined #systemtap
awreece has quit [Remote host closed the connection]
ananth has joined #systemtap
ravi_ has joined #systemtap
srikar_away is now known as srikar
naveen has joined #systemtap
modem has quit [Ping timeout: 244 seconds]
hkshaw1 has joined #systemtap
naveen1 has joined #systemtap
naveen has quit [Ping timeout: 246 seconds]
hkshaw has quit [Ping timeout: 250 seconds]
modem has joined #systemtap
hkshaw has joined #systemtap
hkshaw1 has quit [Read error: Connection reset by peer]
nkambo has joined #systemtap
hkshaw has quit [Ping timeout: 248 seconds]
hkshaw has joined #systemtap
khaled has joined #systemtap
hkshaw1 has joined #systemtap
naveen1 has quit [Ping timeout: 246 seconds]
hkshaw has quit [Ping timeout: 246 seconds]
khaled has quit [Quit: Leaving]
mjw has joined #systemtap
naveen has joined #systemtap
flip214 has joined #systemtap
<flip214>
Hi. What's the easiest way to trace all kref_get and kref_put calls within one function?
<flip214>
Is there some existing syntax, or do I need to use some per-thread variable that gets set upon function enter/leave and that gets checked in the kref_get/_put calls?
<flip214>
Or should I find out all calls to _put/_get within the function, and set trace points on these addresses?
hkshaw1 has quit [Read error: Connection reset by peer]
hkshaw has joined #systemtap
naveen1 has joined #systemtap
naveen has quit [Ping timeout: 250 seconds]
hchiramm has joined #systemtap
hchiramm_ has joined #systemtap
scox has quit [Ping timeout: 244 seconds]
hkshaw1 has joined #systemtap
hkshaw has quit [Read error: Connection reset by peer]
naveen1 has quit [Quit: Leaving.]
khaled has joined #systemtap
cdleonard has joined #systemtap
cdleonard has left #systemtap [#systemtap]
hkshaw1 has quit [Ping timeout: 246 seconds]
nkambo has quit [Ping timeout: 260 seconds]
ananth has quit [Quit: Leaving]
naveen has joined #systemtap
nkambo has joined #systemtap
naveen1 has joined #systemtap
naveen has quit [Ping timeout: 268 seconds]
naveen1 has quit [Ping timeout: 268 seconds]
ravi_ has quit [Remote host closed the connection]
khaled has quit [Quit: This computer has gone to sleep]
wcohen has quit [Remote host closed the connection]
scox has joined #systemtap
khaled has joined #systemtap
ravi has joined #systemtap
jistone has joined #systemtap
mbenitez has joined #systemtap
khaled has quit [Quit: This computer has gone to sleep]
<fche>
that is very similar to your per-thread-variable kind of idea, just based on backtracing instead of an explicit variable
<mnaser>
Would someone be able to give assistance or references if there's a way to trace all writes to a specific device
<mnaser>
I have a lot of writes going towards a device but no idea which process is cuasing it
<flip214>
fche: thanks a lot, that sounds good! Will try.
<fche>
mnaser, what kind of device is that
<fche>
(flip214, btw your other ideas ought to work too - statement probes in the caller one_function e.g.)
<mnaser>
fche: it is a disk with an xfs partition on it
<mnaser>
im thinking if i can trace all vfs writes and know which files is being written to, this can help solve my problem
<fche>
% stap -L vfs.write
<fche>
stap -e 'probe vfs.write { ... } '
<fche>
you'd have to filter further w.r.t. devname etc I assume
<mnaser>
i saw the term w.r.t a lot, googling didnt help :( what does it mean fche
<fche>
with respect to
<mnaser>
oh i see
<mnaser>
oh and i have $file which seems to be a reference to the file
<mnaser>
this could be a good start
brolley has joined #systemtap
<fche>
so printf("%s %s %s", execname(), name, devname) could be a good start
<fche>
in that probe
<flip214>
fche: perhaps, but kref_get/_put gets inlined in several places already, and finding them out one-by-one (and then needing to specify the addresses manually, because there's no "module() + offset") isn't nice
<mnaser>
oh boy
<mnaser>
do writes to stdout go through stapio
<fche>
flip214, yeah, not an easy task. try module("foo").function("kref_??t") { } just log that at first; it should include inlined instances
<fche>
mnaser, yes.
<mnaser>
sorry brain fart, do writes to stdout go through vfs
<fche>
mmm don't think so
<mnaser>
cause i see a lot of vfs.write by the stapio process with that small code you mentioned
<mnaser>
with devname = "N/A"
<fche>
it might do a lot of writes, but not specifically your output, just general message passing
<fche>
so yeah, you'll want to filter based on devname
<fche>
and/or execname()
<fche>
and or pid() != stp_pid()
<mnaser>
i think pid() != stp_pid() is a good start
<mnaser>
is there a return/break clause? i tried to find but i couldnt
<mnaser>
code would be cleaner if i had something like if (if (pid() == stp_pid()) return;
<fche>
to get out of a probe early? next
<mnaser>
ahhh
<fche>
(awk style)
<fche>
(or is it perl? forget now)
<mnaser>
N/A corresponds to null i presume?
<mnaser>
in printf
<fche>
not exactly; the N/A must come from the vfs.write logic
<fche>
check out /usr/share/systemtap/tapset/..../vfs.stp
<mnaser>
so I see a bunch of writes to devname N/A (I assume those are message passing?)
<fche>
probably
<mnaser>
and I see some which are linked to a specific device
<mnaser>
if (devname != @1) next; .. progress
<mnaser>
now i see all the writes to a specific device
<fche>
yup, you can play with it quite a bit.
<mnaser>
now just need to pull out the specific file and i will be a happy camper
<fche>
's why we give you a general language, so you can experiment & express things like this.
<mnaser>
need to lookup the struct file in the codebase