On 16/03/2016 3:12 AM, Gleb Smirnoff wrote:
   Ravi,

On Mon, Mar 14, 2016 at 05:33:06PM -0700, Ravi Pokala wrote:
R> To make sure I'm reading this correctly:
R>
R> (1) The sysctl operates on an opaque array of (uint64_t)s. The elements of 
the array are not individually accessible.

On array of counter_u64_t. The elements are individually accessible of course,
but not by this sysctl API.

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

Right.

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

Right.

but it is not atomic. since the user process decides the time delay between a read and write (zero) there could be a lot of missed counts if you are resetting to zero after each read. better to just read in a loop and not zero..
here are somethings I've wanted at various times:
  read/zero atomic
read timestamp as part of imported struct. (because you really can't do accurate timing from user space, but knowing when the data was read is a good replacement). read a "mib" (for want of a better term) for each set, giving individual field names.



_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to