PMC_SET(3)
π NAME π
okay so bestie, meet pmc_set(3) β the function that sets the reload count of a sampling PMC. Yes, weβre starting with the manual name folded right in, because weβre cute and organized π«Ά. This one lives in the Performance Counters Library, so letβs get into it.
π LIBRARY π
Performance Counters Library (libpmc, -lpmc) β¨. Thatβs the whole vibe β link it and youβre in.
β¨ SYNOPSIS β¨
#include <pmc.h>
int
pmc_set(pmc_id_t pmc, pmc_value_t value);
πΈ DESCRIPTION πΈ
Function pmc_set() is used to set the reload value of sampling PMCs. π
Argument pmc specifies the handle for a sampling-mode PMC you previously allocated. Argument value specifies the reload count. No cap.
Sampling PMCs will interrupt the CPU after the number of hardware events specified by the reload count are seen. π¨ After the sampling interrupt is processed, the underlying hardware will be reloaded with the specified count, and the hardware is automatically restarted by hwpmc(4). Thatβs the little loop-de-loop, iykyk.
Function pmc_set() should be called on a PMC in a quiescent state. πΏ
Bestie, lowkey do not skip the quiescent-state part β the page says it should be called that way.
π RETURN VALUES π
The pmc_set() function returns the value 0 if successful. Otherwise, the value -1 is returned, and the global variable errno is set to indicate the error. π
π ERRORS π
A call to pmc_set() may fail with the following errors:
[EINVAL]β The current process did not own a PMC with the specified handle. π[EBUSY]β The specified PMC was already running. π
π¦ SEE ALSO π¦
xoxo, your Debian bestie π β source/version: Debian; date: November 25, 2007. periodt π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2007 Joseph Koshy. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms