libnvme(9)
π 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 to0h. 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 fromFFhto0hβ very demure, very cyclical πpmaβ Power Measurement Attributes. checkenum nvme_pmafor 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 afterFFFFFFFFh. and she's cleared to0hwhen 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.0hmeans not specified β so don't read anything into it βsmtsβ Stop Measurement Timestamp. the timestamp of when interval power measurements stopped being collected. seestruct nvme_timestampfor 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 is0h, thenNPHDshall be cleared to0hand 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 afterFFFFFFFFh. 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) β seeenum 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) β seeenum 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. seestruct nvme_timestampagain, 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'sstruct nvme_power_histogram_desc. this is the flexible array member, the icon, the finale π
β οΈ real talk: fields marked Shall be cleared to0hor Shall be set to something mean exactly that. that's spec language, not a suggestion, and the bit ranges onaipwr/mipwrare 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
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms