STRUCT CDEV_RECORD(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 β€” a ktime_t representing 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:


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