libnvme(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’– struct nvme_power_meas_log πŸ’–

okay bestie, welcome to the libnvme API Manual, section 9 β€” today's main character is the struct that holds the Power Measurement Log Page (Log Identifier 25h). it's giving "controller is tracking its own watts and i'm obsessed" ✨


🌸 NAME 🌸

struct nvme_power_meas_log β€” the Power Measurement Log Page, aka Log Identifier 25h. yes, the 25h is part of the name, do not come for her πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

like, here's the literal shape of her, no cap, copy-paste faithful:

struct nvme_power_meas_log {
    __u8 ver;
    __u8 pmgn;
    __le16 pma;
    __le32 sze;
    __le32 pmc;
    __le16 nphd;
    __le16 smtr;
    struct nvme_timestamp   smts;
    __le16 phds;
    __le16 phbs;
    __le16 nphds;
    __le16 vss;
    __le32 phdoc;
    __u8 rsvd36[4];
    __le32 aipwr;
    __le32 mipwr;
    struct nvme_timestamp   mipwrt;
    __u8 ipwrpe;
    __u8 rsvd57[7];
    struct nvme_power_histogram_desc descs[];
};

look at that trailing flexible array member descs[] β€” she's flexible, she contains multitudes 🧚


πŸ‘‘ Members πŸ‘‘

every single field, in order, no skipping, we do not skip in this house 🫢

  • ver β€” the Version field, and it shall be cleared to 0h. that's it, that's the whole vibe. zero. nada. ✨
  • pmgn β€” Power Measurement Generation Number. she gets incremented every time a Set Features command with Action = 1h (Start Power Measurements) is successfully completed. and she rolls over from FFh to 0h β€” very demure, very cyclical πŸŽ€
  • pma β€” Power Measurement Attributes. check enum nvme_pma for the deets, iykyk πŸ”₯
  • sze β€” Size. tells you the size of this log page in bytes. yes bestie, she knows her own size πŸ’…
  • pmc β€” Power Measurement Count. the number of interval power measurements collected so far. important: she does not wrap after FFFFFFFFh. and she's cleared to 0h when Start Power Measurements succeeds, or if no measurement has happened at all. so like, zero means "nothing's happened yet or we just reset" 😭
  • nphd β€” Number of Power Histogram Descriptors in this log page. count 'em 🌈
  • smtr β€” Stop Measurement Time Remaining. time left, in minutes, until the controller stops collecting interval power measurements. 0h means not specified β€” so don't read anything into it ⭐
  • smts β€” Stop Measurement Timestamp. the timestamp of when interval power measurements stopped being collected. see struct nvme_timestamp for that whole situation πŸ¦‹
  • phds β€” Power Histogram Descriptor Size. size in bytes of each descriptor πŸ“
  • phbs β€” Power Histogram Bin Size. size in milliwatts of each bin, and it shall be set to 250 milliwatts. that's not a suggestion, that's the law πŸ’€
  • nphds β€” Number of Power Histogram Descriptors Supported. the max number of descriptors that can be reported. and if this is 0h, then NPHD shall be cleared to 0h and no descriptors are reported. like, zero support means zero vibes, periodt πŸ™ˆ
  • vss β€” Vendor Specific Size. size in bytes of the Vendor Specific field. vendors gotta vendor πŸŽ€
  • phdoc β€” Power Histogram Descriptor Overflow Count. the number of interval power measurements that were greater than the maximum power indicated by the last Power Histogram Descriptor. also does not wrap after FFFFFFFFh. overflow girlies stay counting πŸ”₯
  • rsvd36 β€” Reserved. nothing to see here, move along πŸ’œ
  • aipwr β€” Average Interval Power. bit layout is specific bestie: bits 31:18 are reserved, bits 17:16 hold the Power Scale (PWRS) β€” see enum nvme_psd_ps β€” and bits 15:0 hold the Power Value (PWRV). read the bits, don't guess ⭐
  • mipwr β€” Maximum Interval Power. same bit situation: bits 31:18 reserved, bits 17:16 are the Power Scale (PWRS) β€” see enum nvme_psd_ps β€” and bits 15:0 are the Power Value (PWRV) πŸ‘‘
  • mipwrt β€” Maximum Interval Power Timestamp. the timestamp of when the maximum interval power was collected. see struct nvme_timestamp again, she's everywhere πŸ¦‹
  • ipwrpe β€” Interval Power Percent Error. the maximum percent error, range 0-100%. values 101-254 are reserved. and 255 means not reported. so if you see 255, she's simply not telling you πŸ’€
  • rsvd57 β€” Reserved. again. reserved. the end πŸ’œ
  • descs β€” Power Histogram Descriptors β€” that's struct nvme_power_histogram_desc. this is the flexible array member, the icon, the finale 🌟

⚠️ real talk: fields marked Shall be cleared to 0h or Shall be set to something mean exactly that. that's spec language, not a suggestion, and the bit ranges on aipwr / mipwr are not decorative. respect the layout or your parsing will be a mess, fr fr 😭

and that's the whole page bestie, we ate and left no crumbs πŸ’…βœ¨ β€” this was the struct nvme_power_meas_log page from the libnvme API Manual, dated October 2026, with the manual name being libnvme(9) πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from