powercap_register_zone(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

powercap_register_zone(9) β€” okay bestie, this page from the Kernel API Manual is literally about registering a power zone ✨. No cap.

✨ SYNOPSIS ✨

struct powercap_zone * powercap_register_zone (struct powercap_zone *power_zone , struct powercap_control_type *control_type , const char *name , struct powercap_zone *parent , const struct powercap_zone_ops *ops , int nr_constraints , const struct powercap_zone_constraint_ops *const_ops );

πŸŽ€ ARGUMENTS πŸŽ€

  • power_zone β€” pointer to client-allocated memory for the power zone structure storage πŸ’…. If this is NULL, the powercap framework allocates the memory and owns it. The advantage of this parameter? The client can embed this data in its own data structures and allocate it in a single call, preventing multiple allocations. Iconic efficiency, honestly 🫢.
  • control_type β€” a control_type instance under which this zone operates 🌸.
  • name β€” a name for this zone πŸŽ€.
  • parent β€” a pointer to the parent power zone instance, if any, or NULL πŸ¦‹.
  • ops β€” pointer to the zone operation callback structure ✨.
  • nr_constraints β€” number of constraints for this zone πŸ”₯.
  • const_ops β€” pointer to the constraint callback structure πŸ’œ.

πŸ’… DESCRIPTION πŸ’…

So the whole vibe is: register a power zone under a given control type πŸ‘‘. A power zone must register a pointer to a structure representing zone callbacks β€” yes, that part is required, bestie.

A power zone can be located under a parent power zone, and in that case parent should point to it 🫢. Otherwise, if parent is NULL, the new power zone will be located directly under the given control type.

For each power zone there may be a number of constraints that appear in the sysfs under that zone as attributes with unique numeric IDs πŸŽ€.

Returns pointer to the power_zone on success. Slay ✨.

πŸ¦‹ SEE ALSO πŸ¦‹


That’s the whole iconic page, bestie 🫢 β€” the source/version line says ./include/linux, the date stamp says October 2026, and the manual/page is Kernel API Manual / powercap_register_zone(9). Periodt. πŸ’…

πŸ“¦ where this page comes from