Changeset View
Changeset View
Standalone View
Standalone View
lib/libpmc/pmc_allocate.3
Show All 35 Lines | |||||
.In pmc.h | .In pmc.h | ||||
.Ft int | .Ft int | ||||
.Fo pmc_allocate | .Fo pmc_allocate | ||||
.Fa "const char *eventspecifier" | .Fa "const char *eventspecifier" | ||||
.Fa "enum pmc_mode mode" | .Fa "enum pmc_mode mode" | ||||
.Fa "uint32_t flags" | .Fa "uint32_t flags" | ||||
.Fa "int cpu" | .Fa "int cpu" | ||||
.Fa "pmc_id_t *pmcid" | .Fa "pmc_id_t *pmcid" | ||||
.Fa "uint64_t count" | |||||
.Fc | .Fc | ||||
.Ft int | .Ft int | ||||
.Fn pmc_release "pmc_id_t pmc" | .Fn pmc_release "pmc_id_t pmc" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
Function | Function | ||||
.Fn pmc_allocate | .Fn pmc_allocate | ||||
allocates a performance monitoring counter that measures the events | allocates a performance monitoring counter that measures the events | ||||
named by argument | named by argument | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
.Pp | .Pp | ||||
For system scope PMCs, the argument | For system scope PMCs, the argument | ||||
.Fa cpu | .Fa cpu | ||||
is a non-negative value that specifies the CPU number | is a non-negative value that specifies the CPU number | ||||
that the PMC is to be allocated on. | that the PMC is to be allocated on. | ||||
Process scope PMC allocations should specify the constant | Process scope PMC allocations should specify the constant | ||||
.Dv PMC_CPU_ANY | .Dv PMC_CPU_ANY | ||||
for this argument. | for this argument. | ||||
.Pp | |||||
The | |||||
.Fa count | |||||
argument behaves identically to the | |||||
.Xr pmc_set 3 | |||||
function's | |||||
.Fa value | |||||
argument. | |||||
For counting PMCs, | |||||
.Fa count | |||||
specifies the initial value of the allocated PMC. | |||||
For sampling PMCs, | |||||
.Fa count | |||||
specifies the reload count. | |||||
.Pp | .Pp | ||||
Function | Function | ||||
.Fn pmc_release | .Fn pmc_release | ||||
releases the PMC denoted by argument | releases the PMC denoted by argument | ||||
.Fa pmcid . | .Fa pmcid . | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
If successful, function | If successful, function | ||||
.Fn pmc_allocate | .Fn pmc_allocate | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |