Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Apr 2013 01:26:07 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        arch@FreeBSD.org
Subject:   Re: [CFR][CFT] counter(9): new API for faster and raceless counters
Message-ID:  <20130402232606.GC1810@garage.freebsd.pl>
In-Reply-To: <20130401115128.GZ76816@FreeBSD.org>
References:  <20130401115128.GZ76816@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--HG+GLK89HZ1zG0kk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Apr 01, 2013 at 03:51:28PM +0400, Gleb Smirnoff wrote:
>   Hi!
>=20
>   Together with Konstantin Belousov (kib@) we developed a new API that is
> initially purposed for (but not limited to) collecting statistical
> data in kernel.

Is there any plan to implement universal way of exporting those
statistics out of the kernel?

Solaris has a framework for in-kernel statistics, which are exported via
kstat tool. For ZFS I export them via sysctl. If you have ZFS loaded you
can try 'sysctl kstat'.

It would be nice for counter_u64_alloc() to take additional argument
'name' and to create sysctl for the counter automatically. We could then
slowly start migrating userland tools to use sysctls (or some wrapper
userland API), but we immediately make those statistics available for
use in scripts.

> o Tiny API for counter(9):
>=20
>      counter_u64_t
>      counter_u64_alloc(int wait);
>=20
>      void
>      counter_u64_free(counter_u64_t cnt);
>=20
>      void
>      counter_u64_add(counter_u64_t cnt, uint64_t inc);
>=20
>      uint64_t
>      counter_u64_fetch(counter_u64_t cnt);

Do you really expect other types in the future? If so, could we at least
create generic counter_t that internally keeps the type?

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://tupytaj.pl

--HG+GLK89HZ1zG0kk
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlFbaQ4ACgkQForvXbEpPzSimwCeN6N1ztUz4EQrQrX9yDAouWAy
bEsAoOZkQe7H7tjPAXFK3beyZjv4LD8z
=qcsC
-----END PGP SIGNATURE-----

--HG+GLK89HZ1zG0kk--



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