From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4220 invoked by alias); 24 Aug 2010 17:49:08 -0000 Received: (qmail 4213 invoked by uid 22791); 24 Aug 2010 17:49:07 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,SARE_SUB_ENC_UTF8,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from osbern.bearstech.com (HELO osbern.bearstech.com) (78.40.125.115) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Aug 2010 17:49:02 +0000 Received: from localhost (localhost [127.0.0.1]) by osbern.bearstech.com (Postfix) with ESMTP id 50FA52E2F2E for ; Tue, 24 Aug 2010 19:49:00 +0200 (CEST) Received: from osbern.bearstech.com ([127.0.0.1]) by localhost (osbern.bearstech.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GuuI4g8szTMQ for ; Tue, 24 Aug 2010 19:49:00 +0200 (CEST) Received: from mail.bearstech.com (localhost [127.0.0.1]) by osbern.bearstech.com (Postfix) with ESMTPA id 3740F2E2F2A for ; Tue, 24 Aug 2010 19:49:00 +0200 (CEST) MIME-Version: 1.0 Date: Tue, 24 Aug 2010 17:49:00 -0000 From: To: Subject: Re: NFSD tapset: how can I get filename from filehandles =?UTF-8?Q?=3F?= In-Reply-To: <4C73F66B.1060002@redhat.com> References: <66152641961643b384b762190abb1a70@127.0.0.1> <4C73EFBE.1050904@redhat.com> <4C73F66B.1060002@redhat.com> Message-ID: X-Sender: sbocahu@bearstech.com User-Agent: Bearstech Webmail powered by RoundCube Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UTF-8" Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2010-q3/txt/msg00286.txt.bz2 >> When(/if) I figure out how to get the filename, I'll let you know. If >> you figure it out, let me know. > > OK, here's what I found after some more experimentation. Kernel > function nfsd3_proc_write() (which is what 'nfsd.proc3.write' probes) > sets up a few things, then calls nfsd_write() (which is what > 'nfsd.write' probes). nfsd_write() makes sure the file pointer is set > up and then calls nfsd_vfs_write(). So, that's the first place the file > pointer is valid. aaaaaah 8) ! It explains my read faults, I was looking at the wrong place... > Here's that previous script updated to probe nfsd_vfs_write(). Let me > know if this doesn't work for you. ...script deleted... It works ! I only changed printf("nfsd_vfs_write: file = %p (%s)\n", $file, d_name($file->f_dentry)) to printf("nfsd_vfs_write: file = %p (%s)\n", $file, d_name($file->f_path->dentry)) Although my kernel's fs.h has #define f_dentry f_path.dentry in the 'struct file' definition, systemtap shows this error when accessing its f_dentry member: semantic error: unable to find member 'f_dentry' for struct file (alternatives: f_u f_path f_op f_lock f_count f_flags f_mode f_pos f_owner f_cred f_ra f_version f_security private_data f_ep_links f_mapping): operator '->' at ./nfsd-filestats.stp:53:16 source: d_name($file->f_dentry) I guess I'm now able to achieve my script :) Thank you very much for your very good and quick help ! Cheers, Sebastien