Changeset View
Changeset View
Standalone View
Standalone View
lib/libpmc/pmc_allocate.3
Show All 17 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd September 22, 2008 | .Dd April 21, 2021 | ||||
.Dt PMC_ALLOCATE 3 | .Dt PMC_ALLOCATE 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm pmc_allocate , | .Nm pmc_allocate , | ||||
.Nm pmc_release | .Nm pmc_release | ||||
.Nd allocate and free performance monitoring counters | .Nd allocate and free performance monitoring counters | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libpmc | .Lb libpmc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.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 |