|
NAMEkvm_dpcpu_setcpu , kvm_getmaxcpu ,
kvm_getpcpu —
access per-CPU data
LIBRARYKernel Data Access Library (libkvm, -lkvm)SYNOPSIS#include <sys/param.h>
#include <sys/pcpu.h>
#include <sys/sysctl.h>
#include <kvm.h>
int
int
int
void *
ssize_t
uint64_t
DESCRIPTIONThekvm_dpcpu_setcpu (),
kvm_getmaxcpu (), and
kvm_getpcpu () functions are used to access the per-CPU
data of active processors in the kernel indicated by kd.
Per-CPU storage comes in two flavours: data stored directly in a
struct pcpu associated with each CPU, and dynamic
per-CPU storage (DPCPU), in which a single kernel symbol refers to different
data depending on what CPU it is accessed from.
The The The The The Symbols for dynamic per-CPU data are accessed via
kvm_nlist(3)
as with other symbols. CACHINGkvm_getmaxcpu () and
kvm_getpcpu () cache the nlist values for various
kernel variables which are reused in successive calls. You may call either
function with kd set to NULL to
clear this cache.
RETURN VALUESOn success, thekvm_getmaxcpu () function returns the
maximum number of CPUs supported by the kernel. If an error occurs, it returns
-1 instead.
On success, the On success, the On success, the If any function encounters an error, then an error message may be retrieved via kvm_geterr(3). SEE ALSOfree(3), kvm(3), counter(9), zone(9)
Visit the GSP FreeBSD Man Page Interface. |