STRUCT MSM_PERFCNTR_CONTEXT_STATE(9)
π struct msm_perfcntr_context_state(9) π
ok okay so this is a Kernel API Manual page, section 9, all about struct msm_perfcntr_context_state β the per-msm_context counter state. yes bestie, we're going deep into the DRM/msm mines today, grab a lil snack π
β¨ NAME β¨
struct msm_perfcntr_context_state β literally the per-msm_context counter state, that's the whole vibe π
π SYNOPSIS π
struct msm_perfcntr_context_state {
unsigned dummy;
unsigned reserved_counters[];
};
look at her. small. mighty. flexible array at the end. iconic behavior ngl π
πΈ Members πΈ
the little guys inside
dummyβ a whole unsigned just existing as structural support, because some compilers simply cannot handle a struct that's only a flex array π like they throw a fit. sodummyis here to keep the peace. main character energy honestly π«Άreserved_countersβ the number of reserved counters, indexed by perfcntr group. that's the index, that's the data, no cap π
π¦ Description π¦
ok so listen, a given counter can be in one of three states, and this is the whole plot:
- it can be completely unused β just chilling, not doing anything π
- it can be reserved for global counter collection exclusively β like, only for that, don't even try it
- it can be reserved for local per-context counter collection inclusively β the inclusive bestie version π
and here's the slay: multiple contexts can reserve the same counter at the same time. not a bug. not a fight. because SEL reg programming and counter begin/end sampling happen locally β meaning within a single GEM_SUBMIT ioctl π₯ so everyone's doing their own thing in their own little sandbox and nobody's stepping on anybody. periodt.
ngl this is the kind of design decision that makes you go "ohhhh" out loud π
β SEE ALSO β
- Kernel file
./drivers/gpu/drm/msm/msm_perfcntr.hβ go read it, it's right there, it's giving source-of-truth π§ struct msm_perfcntr_stream(9)β the sibling, the companion, the other one you also need π
and that's the whole page bestie!! π
β¨ this one lives in ./drivers/gpu/drm/msm and it's dated October 2026, so like... future vibes fr fr π°οΈπ love that for us. now go read msm_perfcntr_stream(9) too, i'm not asking π
π¦ 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