STRUCT CDEV_RECORD(9)
πΈ struct cdev_record(9) πΈ
okay bestie so we're in the Kernel API Manual today and the star of the show is struct cdev_record β pls stay with me, it's actually so good π
β¨ NAME β¨
struct cdev_record β the common structure for a cooling device entry. yeah. that's the whole vibe. π§
π¦ SYNOPSIS π¦
like, literally here's the shape of it, copy it exactly bestie:
struct cdev_record {
struct list_head node;
int id;
union {
ktime_t residency;
u64 count;
};
};
π Members π
okay so every field, one by one, no skipping, i promised:
nodeβ the node you use to insert this structure into a list. it's giving connective tissue π«Άidβ the identifier of the value, and that value can be a state or a transition. iykyk π{unnamed_union}β anonymous. that's it, that's the whole description, she has no name and she doesn't need one πresidencyβ aktime_trepresenting a state residency duration. time spent chilling, literally β³countβ a number of occurrences. how many times something happened, fr fr π’
π Description π
so the following common structure allows you to store the information related to the transitions and to the state residencies. no cap, that's the job.
they're identified with an id which is associated to a value β so the id is the main character and the value is its moment β¨
and it's used as nodes for the "transitions" and "durations" above. π that's a direct callback to the things mentioned above it, keep that in mind bestie π§
π SEE ALSO π
go look at the kernel file ./drivers/thermal/thermal_debugfs.c, and also these iconic siblings:
struct cdev_debugfs(9)struct trip_stats(9)struct tz_episode(9)struct tz_debugfs(9)struct thermal_debugfs(9)thermal_debug_cdev_state_update(9)thermal_debug_cdev_add(9)thermal_debug_cdev_remove(9)
and that's the page!! π this lil beauty lives in ./drivers/thermal, dated October 2026, and yes it's filed under struct cdev_record(9) in the Kernel API Manual β slay, go read the source, mwah ππ¦β
π¦ 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