svn commit: r249045 - projects/counters/share/man/man9

Gleb Smirnoff glebius at FreeBSD.org
Wed Apr 3 10:49:05 UTC 2013


Author: glebius
Date: Wed Apr  3 10:49:05 2013
New Revision: 249045
URL: http://svnweb.freebsd.org/changeset/base/249045

Log:
  Document recent changes and improve wording[1].
  
  Submitted by:	bde [1]

Modified:
  projects/counters/share/man/man9/counter.9

Modified: projects/counters/share/man/man9/counter.9
==============================================================================
--- projects/counters/share/man/man9/counter.9	Wed Apr  3 10:37:26 2013	(r249044)
+++ projects/counters/share/man/man9/counter.9	Wed Apr  3 10:49:05 2013	(r249045)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 17, 2013
+.Dd April 3, 2013
 .Dt COUNTER 9
 .Os
 .Sh NAME
@@ -39,9 +39,13 @@
 .Ft void
 .Fn counter_u64_free "counter_u64_t cnt"
 .Ft void
-.Fn counter_u64_add "counter_u64_t cnt" "uint64_t inc"
+.Fn counter_u64_add "counter_u64_t cnt" "int64_t value"
 .Ft void
-.Fn counter_u64_subtract "counter_u64_t cnt" "uint64_t dec"
+.Fn counter_enter
+.Ft void
+.Fn counter_exit
+.Ft void
+.Fn counter_u64_add_protected "counter_u64_t cnt" "int64_t value"
 .Ft uint64_t
 .Fn counter_u64_fetch "counter_u64_t cnt"
 .Ft void
@@ -92,21 +96,28 @@ is specified the operation may fail.
 Free previously allocated
 .Nm
 .Fa cnt .
-.It Fn counter_u64_add cnt inc
-Add value of
-.Fa inc
-to
-.Nm
-.Fa cnt .
-.It Fn counter_u64_subtract cnt dec
-Subtract value of
-.Fa dec
-from
+.It Fn counter_u64_add cnt value
+Add
+.Fa value
+to the
 .Nm
 .Fa cnt .
 The KPI does not guarantee any protection from underflow.
+.It Fn counter_enter
+Enter mode that would allow to safely update several counters via
+.Fn counter_u64_add_protected .
+On some machines this expands to
+.Xr critical 9
+section, while on other is a nop.
 See
 .Sx IMPLEMENTATION DETAILS .
+.It Fn counter_exit
+Exit mode for updating several counters.
+.It Fn counter_u64_add_protected cnt value
+Same as
+.Fn counter_u64_add ,
+but should be preceded by
+.Fn counter_enter .
 .It Fn counter_u64_fetch cnt
 Obtain current snapshot of the data collected in
 .Nm
@@ -176,7 +187,7 @@ section.
 .Xr critical 9 ,
 .Xr locking 9 ,
 .Xr malloc 9 ,
-.Xr sysctl 9,
+.Xr sysctl 9 ,
 .Xr uma 9
 .Sh HISTORY
 The


More information about the svn-src-projects mailing list