From owner-freebsd-fs@FreeBSD.ORG Tue Mar 24 11:23:36 2015 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB863BC3 for ; Tue, 24 Mar 2015 11:23:36 +0000 (UTC) Received: from smtp.digiware.nl (unknown [IPv6:2001:4cb8:90:ffff::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 376EB8A7 for ; Tue, 24 Mar 2015 11:23:36 +0000 (UTC) Received: from rack1.digiware.nl (unknown [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id E5BDE16A402 for ; Tue, 24 Mar 2015 12:23:30 +0100 (CET) X-Virus-Scanned: amavisd-new at digiware.nl Received: from smtp.digiware.nl ([127.0.0.1]) by rack1.digiware.nl (rack1.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8fskDVKxqNZl; Tue, 24 Mar 2015 12:23:19 +0100 (CET) Received: from [192.168.101.198] (unknown [192.168.101.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 76CBD16A405 for ; Tue, 24 Mar 2015 12:23:19 +0100 (CET) Message-ID: <5511492A.5020408@digiware.nl> Date: Tue, 24 Mar 2015 12:23:22 +0100 From: Willem Jan Withagen User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: fs@freebsd.org Subject: Re: Missing some ZFS values in sysctl output References: <550F45CA.5000302@digiware.nl> In-Reply-To: <550F45CA.5000302@digiware.nl> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2015 11:23:36 -0000 On 22-3-2015 23:44, Willem Jan Withagen wrote: > Hoi, > > There is this zfs-snmp script that allows one the graph certain things > from a ZFS setup. > The original uses solaris' kstat, but just about all values are in > Sysctl with FreeBSD. > > However I seem to overlook the values for: > > Original code: > ==== > def zfs_read(oid): > return ('counter', kstat("unix:0:vopstats_zfs:read_bytes") / 1024 % > 2**32) # 32 bit KB counter > > def zfs_readdir(oid): > return ('counter', kstat("unix:0:vopstats_zfs:readdir_bytes") / 1024 > % 2**32) # 32 bit KB counter > > def zfs_write(oid): > return ('counter', kstat("unix:0:vopstats_zfs:write_bytes") / 1024 % > 2**32) # 32 bit KB counter > ======= > > Read and write are available for L2 arc, but for the global values I > seem to miss them. > > Are they really not in ZFS? > And is it possible to add them? Right, Just to answer my own question.... I looked into the illumos code, and it looks like the vopstats are stats that are kept per filesystem-type on solaris, and these are the ZFS variants.... typedef struct vopstats { kstat_named_t nopen; /* VOP_OPEN */ kstat_named_t nclose; /* VOP_CLOSE */ kstat_named_t nread; /* VOP_READ */ kstat_named_t read_bytes; kstat_named_t nwrite; /* VOP_WRITE */ kstat_named_t write_bytes; kstat_named_t nioctl; /* VOP_IOCTL */ kstat_named_t nsetfl; /* VOP_SETFL */ kstat_named_t ngetattr; /* VOP_GETATTR */ kstat_named_t nsetattr; /* VOP_SETATTR */ kstat_named_t naccess; /* VOP_ACCESS */ kstat_named_t nlookup; /* VOP_LOOKUP */ kstat_named_t ncreate; /* VOP_CREATE */ kstat_named_t nremove; /* VOP_REMOVE */ kstat_named_t nlink; /* VOP_LINK */ kstat_named_t nrename; /* VOP_RENAME */ kstat_named_t nmkdir; /* VOP_MKDIR */ kstat_named_t nrmdir; /* VOP_RMDIR */ kstat_named_t nreaddir; /* VOP_READDIR */ kstat_named_t readdir_bytes; kstat_named_t nsymlink; /* VOP_SYMLINK */ kstat_named_t nreadlink; /* VOP_READLINK */ kstat_named_t nfsync; /* VOP_FSYNC */ kstat_named_t ninactive; /* VOP_INACTIVE */ kstat_named_t nfid; /* VOP_FID */ kstat_named_t nrwlock; /* VOP_RWLOCK */ kstat_named_t nrwunlock; /* VOP_RWUNLOCK */ kstat_named_t nseek; /* VOP_SEEK */ kstat_named_t ncmp; /* VOP_CMP */ kstat_named_t nfrlock; /* VOP_FRLOCK */ kstat_named_t nspace; /* VOP_SPACE */ kstat_named_t nrealvp; /* VOP_REALVP */ kstat_named_t ngetpage; /* VOP_GETPAGE */ kstat_named_t nputpage; /* VOP_PUTPAGE */ kstat_named_t nmap; /* VOP_MAP */ kstat_named_t naddmap; /* VOP_ADDMAP */ kstat_named_t ndelmap; /* VOP_DELMAP */ kstat_named_t npoll; /* VOP_POLL */ kstat_named_t ndump; /* VOP_DUMP */ kstat_named_t npathconf; /* VOP_PATHCONF */ kstat_named_t npageio; /* VOP_PAGEIO */ kstat_named_t ndumpctl; /* VOP_DUMPCTL */ kstat_named_t ndispose; /* VOP_DISPOSE */ kstat_named_t nsetsecattr; /* VOP_SETSECATTR */ kstat_named_t ngetsecattr; /* VOP_GETSECATTR */ kstat_named_t nshrlock; /* VOP_SHRLOCK */ kstat_named_t nvnevent; /* VOP_VNEVENT */ kstat_named_t nreqzcbuf; /* VOP_REQZCBUF */ kstat_named_t nretzcbuf; /* VOP_RETZCBUF */ } vopstats_t; As far as I can tell we do not have these structures in vnode.{c,h} and as such do not keep tracks of these statistics. Nothing equal to this jumps out from the sysctl-tree. But I happily stand corrected. Tinkering this in just the ZFS code would be a serious undertaking. At least for me. And all this just to some snmp-stats. --WjW