STRUCT COUNTER_COMPONENT(9)
π NAME π
okay so welcome to the Kernel API Manual, bestie β this page is all about struct counter_component, aka the Counter component identification situation, and it's lowkey iconic π
β¨
β¨ SYNOPSIS β¨
Here's the whole lil struct, no cap:
struct counter_component {
__u8 type;
__u8 scope;
__u8 parent;
__u8 id;
};
π Members π
typeβ component type (one ofenum counter_component_type) β literally the type field, keeping it classified πscopeβ component scope (one ofenum counter_scope) β it's giving scope vibes πΈparentβ parent ID (matching the ID suffix of the respective parent sysfs path as described by the ABI documentation fileDocumentation/ABI/testing/sysfs-bus-counter) β so the parent match is documented right there, iykyk π¦idβ component ID (matching the ID provided by the respective*_component_idsysfs attribute of the desired component) β find that attribute, grab the value, slay β¨
π¦ Description π¦
Okay so real talk: if the Count 2 ceiling extension of Counter device 4 is desired, set type equal to COUNTER_COMPONENT_EXTENSION, scope equal to COUNTER_SCOPE_COUNT, parent equal to 2, and id equal to the value provided by the respective /sys/bus/counter/devices/counter4/count2/ceiling_component_id sysfs attribute. That's the whole recipe, periodt π
π₯
π SEE ALSO π
- Kernel file
./include/uapi/linux/counter.hβ go peek, bestie π struct counter_watch(9)struct counter_event(9)
xoxo bestie, this page is from ./include/uapi/linux, dated October 2026 β that's the source/version + date sign-off, periodt ππ«Ά
π¦ 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