STRUCT CDEV_DEBUGFS(9)

📦 version 7.3.1, in nixpkgs unstable

✨ struct cdev_debugfs(9) ✨

okay so bestie, welcome to the Kernel API Manual entry for struct cdev_debugfs 💅 this is the per cooling device statistics structure, and honestly? it's giving genius-level data structure design 🎀

🌸 NAME 🌸

struct cdev_debugfs — per cooling device statistics structure.

so here's the tea ☕ a cooling device can have a high number of states. and like, showing the transitions on a matrix based representation can be overkill given most of the transitions won't happen — you'd just end up with a matrix filled with zero 😭 which is so not the vibe. instead, we show the transitions which actually happened. obsessed. 🔥


🦋 SYNOPSIS 🦋

struct cdev_debugfs {
    u32 total;
    int current_state;
    ktime_t timestamp;
    struct list_head transitions[CDEVSTATS_HASH_SIZE];
    struct list_head durations[CDEVSTATS_HASH_SIZE];
 };

like, look at her. main character struct energy fr fr 👑


💜 Members 💜

  • total — the number of transitions for this cooling device ✨
  • current_state — the current cooling device state, aka where we're at right now 💅
  • timestamp — the state change timestamp ⏰
  • transitions — an array of lists containing the state transitions 🦋
  • durations — an array of lists containing the residencies of each state 🌸

🎀 Description 🎀

every transition updates the current_state and the timestamp — no cap, both of them, every single time 🫶 and the transitions and the durations are stored in lists. that's it, that's the whole lore ✨


🔥 SEE ALSO 🔥

kernel file ./drivers/thermal/thermal_debugfs.c plus the whole friend group:


💀 reminder bestie: this is a kernel struct, so treat it with the respect it deserves — none of that guessing-at-behaviour stuff, okay? 🙈

and that's the whole page! this lil gem lives over in ./drivers/thermal, dated October 2026, and it goes by struct cdev_debugfs(9) around the manual pages 🌈 bye bestie, go read some thermal code 💖 🧚 ⭐

📦 where this page comes from