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]
jistone has quit [Quit: ZNC - http://znc.in]
drsmith has joined #systemtap
wcohen has joined #systemtap
tromey has joined #systemtap
jistone has joined #systemtap
khaled has joined #systemtap
<fche> flip214, probably try probe kernel.function("one_function").callee("kref_??t") { }
<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
srikar is now known as srikar_away
<mnaser> does this mean it will be at $file->filename ?
<mnaser> nope, but i got a nice healthy error which told me the alternatives
<fche> yeah, looking up file name strings at that context is not trivial
<fche> the kernel doesn't do so for sure
<fche> can try __file_filename($file)
<mnaser> yeah that is what i did
<mnaser> i got a filename which is great
<mnaser> now i have a file name but no full path
<mnaser> hmm
<fche> full path is even farther removed at the vfs level
<mnaser> fche: im trying to work from the filename function with this to get the full path - http://stackoverflow.com/a/20614757
<fche> the fullpath_struct_file tapset function may help you.
<fche> that's an internal kernel c api, no can do from stap
<fche> but something like it is what that tapset function does
<mnaser> hmm it needs a task_struct
<fche> man function::task_current
<mnaser> hmm, unresolved function
<fche> task_current is a tapset function
<fche> the function::task_current is the name of its man page
<mnaser> oh no, i meant fullpath_struct_file is an unresolved function
<mnaser> emantic error: unresolved function (similar: _struct_timex_u, _struct_tms_u, usymfile, ctime, stack_size): identifier 'fullpath_struct_file'
<mnaser> looks like i have stap 2.8, it was added in 2.9
<fche> you may be able to paste that fn definition into your script and move on
<mnaser> yeah thats what im about to do
<mnaser> wooo
<mnaser> worked fche :D
<fche> ship it hard
<mnaser> few lines will save my life
<mnaser> well ,maybe not my life..
<fche> btw newer stap will arrive in rhel7.3 ergo centos in due course
<fche> (and there is devtoolset stap 2.9
<fche> and now you can have rhel / etc. for free under the developers.redhat.com program)
<fche> BUY NOW PAY LATER :-)
<mnaser> TIL
<mnaser> haha
<mnaser> well this is interesting
<mnaser> a whole ton of writes to /tmp which is not on /dev/vdb are happening
<mnaser> those should be hitting /dev/vda
<fche> tmpfs ?
<fche> anyway if you discover something neat, we'd appreciate a note!
<mnaser> fche: will do, i feel like this is a cool "systemtap war story"
<fche> there you go
hchiramm_ has quit [Ping timeout: 252 seconds]
hchiramm has quit [Ping timeout: 264 seconds]
naveen has joined #systemtap
ravi has quit [Remote host closed the connection]
hpt has joined #systemtap
mjw has quit [Quit: Leaving]
hpt has quit [Ping timeout: 244 seconds]
srikar_away is now known as srikar
tromey has quit [Read error: Connection reset by peer]
nkambo1 has joined #systemtap
nkambo has quit [Read error: No route to host]
naveen has quit [Quit: Leaving.]
mjw has joined #systemtap
tromey has joined #systemtap
khaled has quit [Quit: Leaving]
srikar is now known as srikar_away
nkambo1 has quit [Ping timeout: 260 seconds]
drsmith has left #systemtap [#systemtap]
drsmith has joined #systemtap
tromey has quit [Quit: ERC (IRC client for Emacs 25.0.92.4)]
brolley is now known as brolley|afk
awreece has joined #systemtap
awreece has joined #systemtap
mbenitez has quit [Quit: Leaving]
brolley|afk is now known as brolley
wcohen has quit [Ping timeout: 248 seconds]
scox has quit [Ping timeout: 244 seconds]
brolley has left #systemtap [#systemtap]
drsmith has left #systemtap [#systemtap]
wcohen has joined #systemtap