x86_perf_rdpmc_index(9)
okay so bestie, this is the x86_perf_rdpmc_index(9) page from the Kernel API Manual π and it's short, but the safety note is important important, so stay with me.
πΈ NAME πΈ
x86_perf_rdpmc_index β return the PMC counter used for event β¨
β¨ SYNOPSIS β¨
int x86_perf_rdpmc_index (struct perf_event *event );
π ARGUMENTS π
eventβ theperf_eventto which the PMC counter was assigned π«Ά
π DESCRIPTION π
okay so here's the tea β: the counter assigned to this performance event may change if interrupts are enabled π. so this counter should never be used while interrupts are enabled β periodt, no cap. π¨
before this function is used to obtain the assigned counter, the event should be checked for validity β using, for example, perf_event_read_local β and that check needs to happen within the same interrupt disabled section in which this counter is planned to be used. iykyk π
π«Ά RETURN π«Ά
The index of the performance monitoring counter assigned to perf_event π
π₯ SEE ALSO π₯
- Kernel file
./arch/x86/events/core.cβ go look, bestie π
xoxo π source/version: ./arch/x86/events Β· date: October 2026
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms