diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2023-09-16 09:33:29 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2023-09-16 09:33:29 +0000 |
commit | fff317a1d2654248f137b1b92993cc737921b110 (patch) | |
tree | 4d1cb84a19d51934c530fd92b6321ff3519eb995 /share/man | |
parent | 817d1e1b3d749f30a8a76eba5823137fb9695bde (diff) |
Allow counters_read(9) to take an optional scratch buffer.
Using a scratch buffer makes it possible to take a consistent snapshot of
per-CPU counters without having to allocate memory.
Makes ddb(4) show uvmexp command work in OOM situations.
ok kn@, mvs@, cheloha@
Diffstat (limited to 'share/man')
-rw-r--r-- | share/man/man9/counters_alloc.9 | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/share/man/man9/counters_alloc.9 b/share/man/man9/counters_alloc.9 index 1de8bffc639..01d343d356c 100644 --- a/share/man/man9/counters_alloc.9 +++ b/share/man/man9/counters_alloc.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: counters_alloc.9,v 1.12 2022/02/20 23:11:01 dlg Exp $ +.\" $OpenBSD: counters_alloc.9,v 1.13 2023/09/16 09:33:28 mpi Exp $ .\" .\" Copyright (c) 2016 David Gwynne <dlg@openbsd.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 20 2022 $ +.Dd $Mdocdate: September 16 2023 $ .Dt COUNTERS_ALLOC 9 .Os .Sh NAME @@ -64,6 +64,7 @@ .Fa "struct cpumem *cm" .Fa "uint64_t *counters" .Fa "unsigned int ncounters" +.Fa "uint64_t *scratch" .Fc .Ft void .Fn counters_zero "struct cpumem *cm" "unsigned int ncounters" @@ -191,6 +192,12 @@ The sum of the counters is written to the array. The number of counters is specified with .Fa ncounters . +.Fa scratch +may point to a buffer used to temporarily hold +.Fa counters . +If +.Dv NULL , +one will be dynamically allocated and freed. .Pp .Fn counters_zero iterates over each CPU's set of counters referenced by |