This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: systemtap question..
- From: "Peter Teoh" <htmldeveloper at gmail dot com>
- To: systemtap at sources dot redhat dot com
- Cc: "Om Narasimhan" <om dot turyx at gmail dot com>
- Date: Sat, 23 Aug 2008 12:27:55 +0800
- Subject: Re: systemtap question..
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=7380kVomrRXsMcb1rSi3H1ku/OOrYmRhnm/hYtlNXFc=; b=LR4ADQlv/5Ae3gsYfg1hOAQ4WV1QMhEgwFccEi0sZOJUntZoiJOVPPc3VXzwoASTbo hX58RO9rmIDkshCb6bdz3J6YfbtENzwH8CFr2Oc8ikO6lykpA5JYg49nmw0gVCS1WEEa XBZcH1XGuX1XNhBvcLVDOnGJJMiEB+zbFanDg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=hnCyMDzk3PxGVr3pRkk3xDbmlb0/67l5BujkwrV6HNncJZkXxfxQEMPDOrJloLryIZ kGAXw/Xfdyxq6f6mvIAYW20C1qd5a2X2eeDV3qaIzA3JkO4qcOq8Vw2XWH5lxlfVczST YICAnbBdlMNBYsFTYjKqzLcG6Nl7opkYZU4wA=
- References: <48ACFC02.3080002@gmail.com>
as discovered by narasimhan, the following script will lead to kernel
freezing and hanged for me:
I execute via "stap -kvvv script.stp" command.
Question is: why does he get a compilation error when using the -u
option? (same for me as well, which goes away when removed?)
On Thu, Aug 21, 2008 at 1:24 PM, Om Narasimhan <om.turyx@gmail.com> wrote:
> --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.
--
Regards,
Peter Teoh