perf_event_c...rnel_counter(9)
π perf_event_c...rnel_counter(9) π
okay so bestie, welcome to the Kernel API Manual β yes THE kernel API manual, we're in the big leagues now π this one's about perf_event_create_kernel_counter, and the name is literally truncated in the header but we're not gonna let a lil ... stop us, we're reading the whole thing π
β¨ NAME β¨
perf_event_create_kernel_counter β
and that's... it. that's the description. the NAME section gave us a name and then a dash and then nothing, and honestly? iconic minimalism π the manpage said "figure it out bestie" and moved on. the real tea is down in ARGUMENTS, keep scrolling π«Ά
πΈ SYNOPSIS πΈ
struct perf_event * perf_event_create_kernel_counter (struct
perf_event_attr *attr , int cpu , struct task_struct *task ,
perf_overflow_handler_t overflow_handler , void *context );
so it hands you back a struct perf_event * β that's your shiny new counter, bestie β¨ β and it takes five things to make it happen. let's get into them π
π¦ ARGUMENTS π¦
attrβ the attributes of the counter you're creating. this is the whole vibe spec for your event, no cap πcpuβ the cpu in which the counter is bound. yes, it's bound to a cpu, it's very committed, main character energy fr π₯taskβ the task to profile. and here's the moment:NULLmeans percpu π«Ά so if you passNULLyou're profiling per-cpu instead of a specific task. noted.overflow_handlerβ the callback that triggers when we hit the event π₯ this is the one that fires off, don't forget about itcontextβ context data that could be used in theoverflow_handlercallback. lil care package for your handler π
π SEE ALSO π
- the kernel file
./kernel/events/core.cβ go read the source if you wanna be that girl π task_function_call(9)cpu_function_call(9)sys_perf_event_open(9)
all of these are right there in SEE ALSO, i'm just passing them along bestie, no gatekeeping here π
lowkey reminder:taskbeingNULLmeaning percpu is doing a lot of heavy lifting in this manpage, so don't sleep on it π
and that's the whole page, bestie!! short, sweet, absolutely slayed β¨ this cutie lives in ./kernel/events and the date on the tin is October 2026 β go be iconic with your counters ππ§β
π¦ 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