This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
newbie question : how to access ptr->member.member->data?
- From: Om Narasimhan <om dot turyx at gmail dot com>
- To: systemtap at sourceware dot org
- Date: Wed, 20 Aug 2008 23:40:37 -0700
- Subject: newbie question : how to access ptr->member.member->data?
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=UrHgHZf1rgKZr3DDKVU2BPlCVkhbaIGgfVgzHdJNWkM=; b=Dgojyn1DhsYgqopT+rV3Q9/NW1XZ87txEGjH5TX7Yg0zyQCnYuzNRdoidbYd+MeWQV pemxQyQr6/YLFQfoi4/4expeynn6hg+M201m3Slw/xHCMgR8ApDTDvyBc4RA8qy82l3P ow7pF2I8i+D0WzSpd9iVSTjnUBzxNEYeYpIGI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=ILaX25ASH714dDVKoR8+N9mKz9D2Nt744rUvRzPKyd1Cm4kjSdkfwOupJVjleGcmGb 4sMA/IdvEJoGrqE8Syuyr0A2NDPHRaP8nwME1EaJ8u+jm/wqU5n9leFoOVmu7aGiVool VHNeOA3j6WPtAquOem8uCXHAddky5QYlfOlQk=
Hi,
Trying out systemtap. Running into this problem.
--script begin--
[om@testserv ~]$ cat /space/stap/inode-watch.stp
# Usage:
# taps the vfs_write and vfs_read
#
probe kernel.function ("vfs_read"), kernel.function("vfs_write")
{
inode = $file->f_dentry->d_inode->i_ino
dev_nr = $file->f_dentry->d_inode->i_sb->s_dev
}
-- script end--
--errors begin--
[om@testserv ~]$ stap -vv -u /space/stap/inode-watch.stp
SystemTap translator/driver (version 0.6.2/0.127 built 2008-03-27)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stap6uzgp4"
Searched '/usr/share/systemtap/tapset/x86_64/*.stp', found 1
Searched '/usr/share/systemtap/tapset/*.stp', found 37
Pass 1: parsed user script and 38 library script(s) in
130usr/0sys/134real ms.
probe vfs_read@fs/read_write.c:257 kernel section=.text
pc=0xffffffff81098064
probe vfs_write@fs/read_write.c:315 kernel section=.text
pc=0xffffffff81097eed
semantic error: field 'f_dentry' not found (alternatives: f_u f_path
f_op f_count f_flags f_mode f_pos f_owner f_uid f_gid f_ra f_version
f_security private_data f_ep_links f_ep_lock f_mapping): identifier
'$file' at /space/stap/inode-watch.stp:7:10
semantic error: field 'f_dentry' not found (alternatives: f_u f_path
f_op f_count f_flags f_mode f_pos f_owner f_uid f_gid f_ra f_version
f_security private_data f_ep_links f_ep_lock f_mapping): identifier
'$file' at /space/stap/inode-watch.stp:8:11
semantic error: probe_1063 with unresolved type: identifier 'inode' at
/space/stap/inode-watch.stp:7:2
semantic error: probe_1063 with unresolved type: identifier 'dev_nr' at
/space/stap/inode-watch.stp:8:2
semantic error: probe_1064 with unresolved type: identifier 'inode' at
/space/stap/inode-watch.stp:7:2
semantic error: probe_1064 with unresolved type: identifier 'dev_nr' at
/space/stap/inode-watch.stp:8:2
Pass 2: analyzed script: 2 probe(s), 0 function(s), 0 embed(s), 0
global(s) in 230usr/70sys/306real ms.
Pass 2: analysis failed. Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stap6uzgp4
--errors end--
I know why the error occur.
From include/linux/fs.h,
#define f_dentry f_path.dentry
Apparently f_dentry cannot be used from systemtap.
If I replace f_dentry with fpath.dentry, systemtap complains about
string operations because `.` is string concatenation operator.
Any idea? Any pointers?
Thanks,
Om.