LIBPFM(3)

✨ LIBPFM β€” libpfm_intel_rapl ✨

okay bestie, welcome to the Intel RAPL page of libpfm(3), from the Linux Programmer's Manual. this one's short, it's sweet, and it's literally about counting how many Joules your machine is munching. let's get into it πŸ“


πŸ’– NAME πŸ’–

libpfm_intel_rapl β€” support for Intel RAPL PMU

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <perfmon/pfmlib.h>
  • PMU name: rapl
  • PMU desc: Intel RAPL (Intel SandyBridge, IvyBridge, Haswell)

🌸 DESCRIPTION 🌸

so the library does support the Intel Running Average Power Limit (RAPL) energy consumption counters. no cap. it's giving "my CPU has a calorie tracker" energy πŸ’…

this is a socket-level set of counters, and it reports energy consumption in Joules. there are up to 3 counters, and each one measures only one event. not a buffet, a tasting menu.

the following events are defined:

  • RAPL_ENERGY_CORES β€” on all processors, the event reports the number of Joules consumed by all cores. (on all processors, bestie, all of them 🫢)
  • RAPL_ENERGYC_PKG β€” on all processors, the event reports the number of Joules consumed by all the cores and the Last Level cache (L3). yes, the name in the source is literally RAPL_ENERGYC_PKG with that extra C in there β€” do not "fix" it, do not touch it, type it exactly like that or it will not work, periodt 😭
  • RAPL_ENERGY_DRAM β€” on server processors, the event reports the number of Joules consumed by the DRAM controller.
⚠️ okay important lore: by construction, these events are socket-level and can only be measured in system-wide mode. it is necessary and sufficient to measure only one CPU per socket to get meaningful results. one. per socket. that's it. don't be out here measuring forty CPUs and expecting different numbers, the vibe check will fail πŸ™ˆ

πŸŽ€ MODIFIERS πŸŽ€

the PMU does not support any modifiers. that's the whole section. nothing. zero. empty. iconic of it honestly πŸ‘‘


πŸ‘‘ AUTHORS πŸ‘‘

Stephane Eranian <eranian@gmail.com>


🌈 SEE ALSO 🌈

literally nothing else listed here, this page is a solo act ✨


πŸ’œ and that's the whole page, bestie! this one came from the Linux Programmer's Manual, version LIBPFM(3), dated November, 2013. old but gold, fr fr. go measure some Joules and slay πŸ¦‹πŸ’–
πŸ“¦ where this page comes from