summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_getpcpu.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libkvm/kvm_getpcpu.3')
-rw-r--r--lib/libkvm/kvm_getpcpu.337
1 files changed, 35 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_getpcpu.3 b/lib/libkvm/kvm_getpcpu.3
index 1e0c1f4..4087f1c 100644
--- a/lib/libkvm/kvm_getpcpu.3
+++ b/lib/libkvm/kvm_getpcpu.3
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 28, 2010
+.Dd April 11, 2013
.Dt KVM_GETPCPU 3
.Os
.Sh NAME
@@ -49,6 +49,10 @@
.Fn kvm_getmaxcpu "kvm_t *kd"
.Ft void *
.Fn kvm_getpcpu "kvm_t *kd" "int cpu"
+.Ft ssize_t
+.Fn kvm_read_zpcpu "kvm_t *kd" "void *buf" "u_long base" "size_t size" "int cpu"
+.Ft uint64_t
+.Fn kvm_counter_u64_fetch "kvm_t *kd" "u_long base"
.Sh DESCRIPTION
The
.Fn kvm_dpcpu_setcpu ,
@@ -83,6 +87,28 @@ is not active, then
.Dv NULL
is returned instead.
.Pp
+The
+.Fn kvm_read_zpcpu
+function is used to obtain private per-CPU copy from a
+.Dv UMA_ZONE_PCPU
+.Xr zone 9 .
+It takes
+.Fa base
+argument as base address of an allocation and copyies
+.Fa size
+bytes into
+.Fa buf
+from the part of allocation that is private to
+.Fa cpu .
+.Pp
+The
+.Fn kvm_counter_u64_fetch
+function fetches value of a
+.Xr counter 9
+pointed by
+.Fa base
+address.
+.Pp
Symbols for dynamic per-CPU data are accessed via
.Xr kvm_nlist 3
as with other symbols.
@@ -122,9 +148,16 @@ On success, the
.Fn kvm_dpcpu_setcpu
call returns 0; if an error occurs, it returns -1 instead.
.Pp
+On success, the
+.Fn kvm_read_zpcpu
+function returns number of bytes copied.
+If an error occurs, it returns -1 instead.
+.Pp
If any function encounters an error,
then an error message may be retrieved via
.Xr kvm_geterr 3 .
.Sh SEE ALSO
.Xr free 3 ,
-.Xr kvm 3
+.Xr kvm 3 ,
+.Xr counter 9 ,
+.Xr zone 9
OpenPOWER on IntegriCloud