svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys

Ravi Pokala rpokala at mac.com
Tue Mar 15 01:33:14 UTC 2016


-----Original Message-----

From: <owner-src-committers at freebsd.org> on behalf of Gleb Smirnoff <glebius at FreeBSD.org>
Date: 2016-03-14, Monday at 17:05
To: <src-committers at freebsd.org>, <svn-src-all at freebsd.org>, <svn-src-head at 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@)



More information about the svn-src-head mailing list