STRUCT RAPL_IF_PRIV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct rapl_if_priv(9) 🌸

okay so this is from the Kernel API Manual β€” it's the page for struct rapl_if_priv, and it's literally just the private-data holder for the different RAPL interfaces. like, the little backpack each interface carries its own stuff in πŸ’…


✨ NAME ✨

struct rapl_if_priv β€” private data for different RAPL interfaces 🫢


πŸŽ€ SYNOPSIS πŸŽ€

struct rapl_if_priv {
    enum rapl_if_type type;
    struct powercap_control_type *control_type;
    enum cpuhp_state pcap_rapl_online;
    union rapl_reg reg_unit;
    union rapl_reg regs[RAPL_DOMAIN_MAX][RAPL_DOMAIN_REG_MAX];
    int limits[RAPL_DOMAIN_MAX];
    int (*read_raw)(int id, struct reg_action *ra, bool pmu_ctx);
    int (*write_raw)(int id, struct reg_action *ra);
    const struct rapl_defaults *defaults;
    struct rapl_primitive_info *rpi;
};

no cap, that's the whole shape of it πŸ’–


πŸ¦‹ Members πŸ¦‹

  • control_type β€” bestie, every single RAPL interface has to have its own powercap control type. no sharing, no borrowing, that one's yours πŸ‘‘
  • pcap_rapl_online β€” the CPU hotplug state, one for each RAPL interface 🌈
  • reg_unit β€” the register you go to when you need the energy/power/time unit. it's giving "conversion rate source of truth" fr fr ⭐
  • regs β€” the register sets for the different RAPL Domains. like a lil wardrobe, one outfit per domain πŸŽ€
  • limits β€” how many power limits each domain supports, as a number, plain and simple πŸ”₯
  • read_raw β€” the callback for reading RAPL interface specific registers. it's a function pointer: int (*read_raw)(int id, struct reg_action *ra, bool pmu_ctx) πŸ’œ
  • write_raw β€” the callback for writing RAPL interface specific registers. also a function pointer: int (*write_raw)(int id, struct reg_action *ra) 🌸
  • defaults β€” pointer to default settings. the fallback vibes ✨
  • rpi β€” pointer to interface primitive info. iykyk 🧚
oh and don't forget β€” type is sitting right there in the struct too (it's an enum rapl_if_type), it just doesn't get its own little paragraph down here πŸ™ˆ

πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./include/linux/intel_rapl.h
  • struct rapl_package_pmu_data(9) β€” go read that one next bestie, it's connected πŸ’«

okay that's the whole page, mwah πŸ’‹ β€” this gem lives in ./include/linux, dated October 2026, and it's filed under struct rapl_if_priv(9). go slay your RAPL interface setup, you've got this πŸ«ΆπŸ’–

πŸ“¦ where this page comes from