fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
<jhg_> also, there is d_name($dentry)
hchiramm_ has quit [Ping timeout: 250 seconds]
hchiramm_ has joined #systemtap
hpt has joined #systemtap
hchiramm_ has quit [Ping timeout: 250 seconds]
hchiramm_ has joined #systemtap
srikar_away is now known as srikar
scox_ has joined #systemtap
scox_ has quit [Client Quit]
hchiramm_ has quit [Ping timeout: 250 seconds]
hchiramm_ has joined #systemtap
hpt has quit [Ping timeout: 260 seconds]
hpt has joined #systemtap
ananth has joined #systemtap
zodbot has quit [Read error: Connection reset by peer]
ego_ has joined #systemtap
zodbot has joined #systemtap
xar- has quit [Quit: ZNC 1.7.x-git-195-a314d30 - http://znc.in]
xar- has joined #systemtap
srikar is now known as srikar_away
hchiramm_ has quit [Ping timeout: 250 seconds]
hchiramm_ has joined #systemtap
ravi has joined #systemtap
srikar_away is now known as srikar
nkambo has quit [Ping timeout: 260 seconds]
nkambo has joined #systemtap
nkambo has quit [Ping timeout: 244 seconds]
nkambo has joined #systemtap
hchiramm_ has quit [Ping timeout: 250 seconds]
hchiramm_ has joined #systemtap
ego_ has quit [Ping timeout: 244 seconds]
ego_ has joined #systemtap
hkshaw has quit [Ping timeout: 258 seconds]
nkambo has quit [Read error: Connection reset by peer]
nkambo has joined #systemtap
hkshaw has joined #systemtap
blU0 has joined #systemtap
hpt has quit [Quit: leaving]
ph7 has joined #systemtap
hkshaw has quit [Ping timeout: 276 seconds]
nkambo has quit [Ping timeout: 244 seconds]
nkambo has joined #systemtap
hkshaw has joined #systemtap
lorddoskias2 has joined #systemtap
<lorddoskias2> if i have a pointer how do i read the raw bytes?
<fche> couple of ways
<fche> {kernel,user}_char (ptr)
<fche> $ptr[0] if it was an array
<fche> printf("%.1M", ptr) for hex dumping it
wcohen has quit [Ping timeout: 250 seconds]
lindi-_ has quit [Ping timeout: 258 seconds]
lindi- has joined #systemtap
lindi- has quit [Ping timeout: 258 seconds]
lindi- has joined #systemtap
mbenitez has joined #systemtap
mbenitez has quit [Changing host]
mbenitez has joined #systemtap
ego_ has quit [Ping timeout: 240 seconds]
drsmith has joined #systemtap
jlebon has quit [Quit: leaving]
jlebon has joined #systemtap
tromey has joined #systemtap
Empyrium has joined #systemtap
ravi has quit [Ping timeout: 244 seconds]
wcohen has joined #systemtap
hkshaw has quit [Ping timeout: 258 seconds]
brolley has joined #systemtap
hkshaw has joined #systemtap
srikar is now known as srikar_away
hkshaw has quit [Ping timeout: 276 seconds]
<jhg_> I am hung up on this accessing a struct instead of member error
<jhg_> semantic error: 'struct {...}' is being accessed instead of a member: operator '@cast' at osi_dentry_trace.stp:28:53
<jhg_> source: printf ("$dentry->d_inode->i_count 0x%x\n", @cast($dentry->d_inode, "inode", "kernel")->i_count)
<jhg_> I have tried adding & before the @cast, though that just prints an address rather than the i_count
<jhg_> I've looked at the other stap examples for vfs and nfs and dentry, though I cannot see what I am doing wrong
<jhg_> this compiles, but doesn't seem to output anything sensible: printf ("$dentry->d_inode->i_count 0x%x\n", &@cast($dentry->d_inode, "struct inode")->i_count)
lindi- has quit [Ping timeout: 250 seconds]
lindi- has joined #systemtap
lindi- has quit [Changing host]
lindi- has joined #systemtap
<fche> is the i_count a scalar?
<jhg_> unsigned long as far as I can tell
<fche> atomic_t ...
<jhg_> #define atomic_t unsigned long
<fche> uinclude/* is not authoritative
<fche> we should make a better error message though..
<fche> does the message really say '{...}' ? weird, we're supposed to print out the type name
<fche> can you share your stap script?
<jhg_> sure
<jhg_> that's the one with & that outputs an odd value
<fche> why are you putting the filename:line number into the .function() probe parameter?
<jhg_> because that's what stap -L gave me. no reason otherwise
<fche> ok; dropping the @... parts will make the script more portable
<jhg_> semantic error: 'struct {...}' is being accessed instead of a member: identifier '$dentry'
<jhg_> source: printf ("$dentry->d_inode->i_count 0x%x\n", $dentry->d_inode->i_count)
<jhg_> & compiles. testing
<fche> yeah. so I'm seeing that here too.
<fche> & of course gives you the address of the putative struct
<jhg_> yep. no bueno on the output of the &$dentry->
<jhg_> $$vars$$ is not expanding or recognizing the inode struct: .d_inode=0xffff880067fdf000,
<jhg_> dentry={ ... .d_inode=0xffff880067fdf000, ... }
<fche> my guess is that the struct type is not defined, only declared, in that compilation uniot
<fche> unit
<fche> like typedef struct foo atomic_t; somewhere
<fche> not sure yet.
<jhg_> why wouldn't something like this work: @cast(d_inode, "inode", "kernel")
<fche> that casts the d_inode variable
<jhg_> @cast(inode, "struct inode")
<fche> the question here is the i_count one
<jhg_> oh
<jhg_> I suppose we can cast it to unsigned long. though fragile, maybe my quick fix
<fche> not sure it's that simple
<fche> keep trying stuff; I'll try to get to the rooter causer
<jhg_> @cast does not like unsigned longs
* jhg_ nods
<fche> you can do a kernel_long ( & @cast(d_inode, "inode")->i_count) ) if nothing else
<jhg_> WARNING: never-assigned local variable 'd_inode': identifier 'd_inode' at osi_dentry_trace.stp:29:75
<jhg_> interesting
<jhg_> ERROR: kernel long copy fault at 0x0000000000000148 [man error::fault] near identifier 'kernel_long' at /usr/share/systemtap/tapset/linux/conversions.stp:248:10
<jhg_> whoops... kernel_long ( & @cast($dentry->d_inode, "inode")->i_count)
<jhg_> it's happier now =)
<fche> righto
<jhg_> it works! $dentry->d_inode->i_count 0x3
ph7 has quit [Read error: Connection timed out]
lindi- has quit [Ping timeout: 258 seconds]
ph7 has joined #systemtap
<jhg_> is there a way to get the postfix $$ behavior on arbitrarily specified structures like we can for $$vars$$ and $$params$$?
ananth has quit [Quit: Leaving]
lindi- has joined #systemtap
<fche> yes.
<fche> $context$ or $context$$ works
<fche> hm, doesn't make sense
<fche> probe kernel.function("dput") { println( @cast($dentry->d_inode, "struct inode")->i_count$) } works
<fche> maybe it's a struct with only one member, so $ traverses it quietly
<fche> yeah, exactly
<fche> { .counter=%i }
<fche> so yeah ->i_count->counter would be the way to get at the integer
ton31337 has quit [Ping timeout: 240 seconds]
ph7 has quit [Quit: Leaving.]
ton31337 has joined #systemtap
ton31337 has quit [Ping timeout: 250 seconds]
ton31337 has joined #systemtap
ton31337 has quit [Ping timeout: 264 seconds]
<jhg_> fche: thanks
lindi- has quit [Ping timeout: 250 seconds]
<jhg_> fche: do you know of any good ways to instrument a test harness for the interface between the kernel and a module?
<fche> would start first by simple blanket function entry/exit tracing
<jhg_> the last time I did anything like this, it was cppunit and in userland.
lindi- has joined #systemtap
lindi- has quit [Changing host]
lindi- has joined #systemtap
<jhg_> hm. entry/exit trace, give the edge case arguments, verify the intended behavior
ton31337 has joined #systemtap
hchiramm_ has quit [Ping timeout: 240 seconds]
ton31337 has quit [Ping timeout: 240 seconds]
ton31337 has joined #systemtap
IZh has joined #systemtap
<IZh> Hi! There is a minor issue in systemtap.spec. It should have both "Requires: systemd" and "BuildRequires: systemd".
<IZh> BuildRequires because it uses %{_unitdir} and %{_tmpfilesdir}, and Requires because of systemctl in %post.
<fche> you're probably right!
<fche> if you'd like, a one-line patch like that to the mailing list or fpaste or whatnot can get your name into the Bright Lights of AUTHORS
<IZh> I suppose, something like this: https://paste.fedoraproject.org/397394/ Although you may prefer to set BuildRequires no to main package but to particular subpackages, but then it must be copied to several places instead of one.
<fche> lgtm; under what name shall we credit it?
<fche> or email?
<IZh> fche: Igor Zhbanov <izh1979@gmail.com>
<fche> righto
<fche> thanks igor
irker046 has joined #systemtap
<irker046> systemtap: izh1979 systemtap.git:refs/heads/master * release-3.0-189-g10a7ba1 / systemtap.spec: systemtap.spec: add systemd as BuildRequires & Requires if %{with_systemd} http://tinyurl.com/hcugbxt
<IZh> fche: Welcome. :-)
tromey has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
djellemah has quit [Ping timeout: 276 seconds]
wcohen has quit [Remote host closed the connection]
nkambo1 has joined #systemtap
drsmith has left #systemtap [#systemtap]
nkambo has quit [Ping timeout: 260 seconds]
irker046 has quit [Quit: transmission timeout]
wcohen has joined #systemtap
mbenitez has quit [Quit: Leaving]
brolley has left #systemtap [#systemtap]
scox has quit [Quit: scox]
wcohen has quit [Ping timeout: 258 seconds]
wcohen has joined #systemtap
blU0 has quit [Quit: blU0]
gila has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
naveen has quit [Ping timeout: 250 seconds]
srikar_away has quit [Ping timeout: 260 seconds]
naveen has joined #systemtap
srikar_away has joined #systemtap
srikar_away is now known as srikar
srikar is now known as srikar_away
nkambo1 has quit [Ping timeout: 252 seconds]