Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2005 14:12:11 +0200
From:      Max Laier <max@love2party.net>
To:        freebsd-current@freebsd.org
Cc:        Eric Anderson <anderson@centtech.com>
Subject:   Re: ufsstat - testers / feedback wanted!
Message-ID:  <200510131412.23525.max@love2party.net>
In-Reply-To: <434E46C0.7060903@centtech.com>
References:  <434E46C0.7060903@centtech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart10456337.dubLW3Ud8u
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Thursday 13 October 2005 13:36, Eric Anderson wrote:
> [resend to -current for broader test audience]
>
> I've just finished the first version of ufsstat, a tool to show local
> filesystem statistics much like nfsstat does for NFS.  The patch and
> tool is against 6.0, but it will probably apply and work fine under
> -CURRENT and possibly 5.x as well.
>
> I'm looking for bug reports, comments/suggestions on style(9), and
> anything else, since this is my first C project, and of course first
> real FreeBSD contribution. :)

The patch contains some jitter in the first three or four files due to olde=
r=20
versions in src-patched.  As all the statistic gathering is #ifdef'ed it=20
should not hurt performance in the disabled case.  It will look nicer if yo=
u=20
define a macro to update statistics like:

#ifdef UFS_STATS
#define	UFS_STATS_UPDATE(field)	ufsstats.field++
#else
#define	UFS_STATS_UPDATE(field)
#end

This will in turn only use one line per update point and you don't have to =
do=20
the ugly:
#ifdef UFS_STATS
       ufsstats.fsync++;
#endif

Also, make sure to declare "extern struct ufsstats ufsstats" in ufsstats.h=
=20
under _KERNEL and define it in just one place.  As is, you don't record the=
=20
updates from ffs_vnops.c into the right structure.  Finally, you should=20
consider 64 bit counter for some, if not all, fields as they will overflow=
=20
quickly.

> To use it, do this:
> cd /tmp
> fetch http://www.googlebit.com/software/ufsstat/ufsstat-20051011.tar.gz
> cd /usr
> tar xvzf /tmp/ufsstat-20051011.tar.gz
> patch <./ufsstats.patch
>
> add:
> OPTIONS		UFS_STAT
> to your kernel.
>
> Rebuild and install world/kernel.
>
> Now, you can use ufsstat to show you statistics from your local
> filesystems, like this:
>
> # ufsstat
>     Create    Remove      Link   Symlink     Mkdir     Rmdir    Rename
>     289048    794043      4361     12558     25796    117739         0
>    GetAttr   SetAttr      Open     Close   ReadDir  ReadLink     VInit
>   64868230    759824  10701553   9891642   5042948         0  45315645
>      Chmod     Chown  Whiteout  Strategy    Access     Mknod  NewInode
>     409782     79612         0   4020035         0         3         0
>      Fsync SyncVnode LockVnode   RdVnode   WrVNode
>          0         0         0         0         0
>    ExtRead  Extwrite FndExtAtt RdExtAttr OpnExtAtt ClseExtAt ExtStrtgy
>          0         0         0         0         0         0         0
>
> or watch over time with the -w switch.
>
> I have not done any performance testing yet to see if it impacts
> filesystem performance by any measurable amount, so if someone does do
> this testing before I do, please post your results!

I don't think you can measure one single interger (or 64bit) increase in fa=
ce=20
of a operation that has to access backing store.  Even if there is a=20
performance hit, you don't have to build your kernel with the option enable=
d.

It might be (more) interesting to have these stats on a per-mountpoint basi=
s. =20
Not sure if you have enough state available to record all of the above, but=
=20
since you asked for input - this might be worth investigating.

=2D-=20
/"\  Best regards,                      | mlaier@freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News

--nextPart10456337.dubLW3Ud8u
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQBDTk8nXyyEoT62BG0RAt82AJ4oNwBQizLFy/mjd0TRzO39b+lWYgCeJqc+
nvQ2r8DEzdGGCeALeewVY2A=
=hhfi
-----END PGP SIGNATURE-----

--nextPart10456337.dubLW3Ud8u--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510131412.23525.max>