STRUCT MSM_PERFCNTR_STREAM(9)
๐ struct msm_perfcntr_stream(9) ๐
okay bestie, welcome to the Kernel API Manual โ section 9, no less. this page is all about struct msm_perfcntr_stream, and it's giving "state for a single open stream fd" energy. periodt. ๐ซถ
๐ธ NAME ๐ธ
struct msm_perfcntr_stream - state for a single open stream fd. that's it, that's the name. โจ
โจ SYNOPSIS โจ
struct msm_perfcntr_stream {
struct msm_gpu *gpu;
struct hrtimer sample_timer;
wait_queue_head_t poll_wq;
uint64_t sample_period_ns;
uint32_t nr_groups;
uint32_t seqno;
uint32_t sel_fence;
struct work_struct sel_work;
struct kthread_work sample_work;
struct mutex read_lock;
uint32_t *group_idx;
struct circ_buf fifo;
size_t fifo_size;
size_t period_size;
};
๐ Members ๐
okay now the member-by-member vibe check. every field gets its moment. ๐
gpuโ Back-link to the GPU. literally the GPS back to the GPU. ๐ฆsample_timerโ Timer to sample counters. it's the clock bestie. โฐpoll_wqโ Wait queue for waiting for OA data to be available. yes, the OA data has to show up before anyone gets to poll. ๐คsample_period_nsโ Sampling period. it's giving timing energy. โฑ๏ธnr_groupsโ # of counter groups with enabled counters. not "number" โ it says "#" and I respect it. ๐ขseqnoโ counter for collected samples. keeping count, always. ๐งฎsel_fenceโ Fence for SEL reg programming. a little fence, doing fence things. ๐งsel_workโ Worker for SEL reg programming.
important caveat time, bestie: Initial SEL reg programming (as opposed to restoring the SEL regs onrunpmresume) must run on the same ordered wq as is used bydrm_sched, to serialize it withGEM_SUBMITs written into the same ringbuffer. no cap, that serialization is the whole point. ๐
sample_workโ Worker for collecting samples. get those samples, queen. ๐งบread_lockโ Fifo access is synchronied on the producer side by virtue of there being a single timer collecting samples and writing into the fifo. It is protected on the consumer side byread_lock. producer side? one timer, one fifo, that's the synchronization vibe. consumer side?read_lockhas your back. ๐group_idxโ array ofnr_groups.
it maps the order of groups in the PERFCNTR_CONFIG ioctl to group idx, so that results in the results stream can be ordered to match the ioctl call that setup the stream. yes, the ordering is matching on purpose. ๐ฏ
fifoโ circular buffer for samples. it's a circle, it's a buffer, it's for samples. ๐fifo_sizeโ circular buffer size. how big is the circle? this big. ๐period_sizeโ size of data for single sampling period. one period, one size. ๐ซ
๐ฆ SEE ALSO ๐ฆ
- Kernel file
./drivers/gpu/drm/msm/msm_perfcntr.h, plusstruct msm_perfcntr_context_state(9). go read those too, bestie. ๐
mwah ๐ โ this page lives at ./drivers/gpu/drm/msm, dated October 2026, and it's all about struct msm_perfcntr_stream(9). slay. ๐
๐ฆ 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