Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Mar 2016 17:33:06 -0700
From:      Ravi Pokala <rpokala@mac.com>
To:        Gleb Smirnoff <glebius@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys
Message-ID:  <BBC31E16-31C0-426A-96C0-1393CA3DC379@panasas.com>
In-Reply-To: <201603150005.u2F050ps086390@repo.freebsd.org>
References:  <201603150005.u2F050ps086390@repo.freebsd.org>

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

From: <owner-src-committers@freebsd.org> on behalf of Gleb Smirnoff <glebius@FreeBSD.org>
Date: 2016-03-14, Monday at 17:05
To: <src-committers@freebsd.org>, <svn-src-all@freebsd.org>, <svn-src-head@freebsd.org>
Subject: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys

>Author: glebius
>Date: Tue Mar 15 00:05:00 2016
>New Revision: 296880
>URL: https://svnweb.freebsd.org/changeset/base/296880
>
>Log:
>  Provide sysctl(9) macro to deal with array of counter(9).

Hi Gleb,


To make sure I'm reading this correctly:

(1) The sysctl operates on an opaque array of (uint64_t)s. The elements of the array are not individually accessible.

(2) Reading the sysctl populates each element of the userspace array by calling counter_u64_fetch() on the corresponding element of the kernelspace array.

(3) Writing the sysctl clears the kernelspace array by calling counter_u64_zero() on each element.

For example, if you have a bunch of device statistics, this interface will let you get or clear them all in one shot, but they won't have distinct names. You would have to define an enum to set up names for the array indices.

Does that sound correct?

Thanks,

Ravi (rpokala@)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BBC31E16-31C0-426A-96C0-1393CA3DC379>