aboutsummaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorAndre Silva <andasilv@amd.com>2026-07-28 14:50:54 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2026-07-28 14:54:21 +0000
commita99d04f39dab0eac88eb4f5af425aceaf9238207 (patch)
treeffce88ea8195341dbdb8b846f6bfc5364c24c160 /include/llvm
parent77404ee1e99d502345a1f9356b05c09abfbde831 (diff)
hwpmc: add RAPL energy-counter class (AMD + Intel)
Add hwpmc_rapl.c/.h implementing PMC_CLASS_RAPL, a read-only system-scope class modeled on TSC and wired into x86 AMD and Intel MD init. A per-vendor MSR table covers AMD/Hygon and Intel; energy is reported in microjoules, with the Intel server 2^-16 J DRAM unit handled and 32-bit wraps recovered into a 64-bit accumulator. The overflow guard follows the PMC lifetime: armed on the first allocated PMC, callout_drain()d on the last release, and each tick only rendezvouses CPUs holding one. Per-CPU spin locks guard the accumulator against torn reads on i386. PMC_CAP_DOMWIDE lets pmcstat(8) allocate one counter per NUMA domain instead of per CPU. Reviewed by: mhorne, Ali Mashtizadeh <ali@mashtizadeh.com> Sponsored by: AMD Differential Revision: https://reviews.freebsd.org/D58028
Diffstat (limited to 'include/llvm')
0 files changed, 0 insertions, 0 deletions