From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22109 invoked by alias); 24 Aug 2010 14:24:08 -0000 Received: (qmail 22099 invoked by uid 22791); 24 Aug 2010 14:24:07 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_00,SARE_SUB_ENC_UTF8,TW_KN,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 14:24:02 +0000 Received: from localhost (localhost [127.0.0.1]) by osbern.bearstech.com (Postfix) with ESMTP id 4B26E2E2F2E for ; Tue, 24 Aug 2010 16:23:59 +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 UBrNL3pddWeh for ; Tue, 24 Aug 2010 16:23:59 +0200 (CEST) Received: from mail.bearstech.com (localhost [127.0.0.1]) by osbern.bearstech.com (Postfix) with ESMTPA id 2BFAC2E2F21 for ; Tue, 24 Aug 2010 16:23:59 +0200 (CEST) MIME-Version: 1.0 Date: Tue, 24 Aug 2010 14:24:00 -0000 From: To: Subject: NFSD tapset: how can I get filename from filehandles =?UTF-8?Q?=3F?= Message-ID: <66152641961643b384b762190abb1a70@127.0.0.1> 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/msg00282.txt.bz2 Hi all, I hope I'm not disturbing too much... I'm a new systemtap user without any kernel knowledge, trying to write a few scripts. Since I fail to write the second one, I would like to ask you for pointers: I would like to gather some stats from nfsd probes to know which files are most accessed/written/read/etc... This is pretty easy with the create(), remove() and lookup() nfsops as the nfsd tapset exposes the filename variable (wich seems to be easy as well, because the filename is given as argument to the call). The problem is: I can't get the filename for other nfsops. The filename is not given as argument. I guess it is possible to get it from the filehandle, though: (warning: I might be _totally_ wrong, I just tried to read the source and understand things by myself...) from the nfsd tapset, nfsd.proc3.write: fh = & @cast($argp, "nfsd3_writeargs", "kernel:nfsd")->fh * fh seems to be of type of svc_fh: linux/include/linux/nfsd/xdr3.h: struct nfsd3_writeargs { svc_fh fh; __u64 offset; __u32 count; int stable; __u32 len; int vlen; }; * svc_fh seems to contain a dentry* member linux/nfsd/nfsfh.h: typedef struct svc_fh { struct knfsd_fh fh_handle; /* FH data */ struct dentry * fh_dentry; /* validated dentry */ struct svc_export * fh_export; /* export pointer */ ... * there should be a qstr member in dentry... linux/dcache.h: struct dentry { atomic_t d_count; ... struct qstr d_name; ... * ... which contains the filename linux/dcache.h: struct qstr { unsigned int hash; unsigned int len; const unsigned char *name; }; I've tried a few things without success... such as: filename = @cast($argp, "nfsd3_writeargs", "kernel:nfsd")->fh->fh_dentry->d_name->name which ended with a segfault. Well, would you correct me and give me pointers on how achieving this, please ? Thanks a lot ! Best regards, Sébastien