Allow counters_read(9) to take an optional scratch buffer.
authormpi <mpi@openbsd.org>
Sat, 16 Sep 2023 09:33:27 +0000 (09:33 +0000)
committermpi <mpi@openbsd.org>
Sat, 16 Sep 2023 09:33:27 +0000 (09:33 +0000)
commitbf0d449c49808ab2d0a67677895f728770d3c8af
treed4004826280a5a13de8724a4db5d7df4eabd640c
parent24b27aa0d89c3d59a1fb5ddd5e14059e469d1bed
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@
25 files changed:
share/man/man9/counters_alloc.9
sys/kern/kern_sysctl.c
sys/kern/subr_evcount.c
sys/kern/subr_percpu.c
sys/net/if.c
sys/net/if_etherip.c
sys/net/if_pfsync.c
sys/net/pfkeyv2_convert.c
sys/net/pipex.c
sys/net/rtsock.c
sys/netinet/igmp.c
sys/netinet/ip_carp.c
sys/netinet/ip_divert.c
sys/netinet/ip_icmp.c
sys/netinet/ip_input.c
sys/netinet/ip_ipip.c
sys/netinet/ipsec_input.c
sys/netinet/tcp_usrreq.c
sys/netinet/udp_usrreq.c
sys/netinet6/icmp6.c
sys/netinet6/ip6_divert.c
sys/netinet6/ip6_input.c
sys/netinet6/raw_ip6.c
sys/sys/percpu.h
sys/uvm/uvm_meter.c