Page MenuHomeFreeBSD

libpmc: userland support and pmc.rapl.3 for the RAPL class
AcceptedPublic

Authored by afscoelho_gmail.com on Fri, Jul 3, 6:00 PM.
Tags
None
Referenced Files
F163465853: D58029.diff
Thu, Jul 23, 10:24 AM
Unknown Object (File)
Tue, Jul 21, 11:25 AM
Unknown Object (File)
Mon, Jul 20, 8:54 AM
Unknown Object (File)
Sun, Jul 19, 3:04 PM
Unknown Object (File)
Sun, Jul 19, 6:34 AM
Unknown Object (File)
Sun, Jul 19, 6:27 AM
Unknown Object (File)
Sat, Jul 11, 5:36 PM
Unknown Object (File)
Sat, Jul 11, 12:19 AM
Subscribers

Details

Summary

Register PMC_CLASS_RAPL in libpmc: event table, allocator, class-table
descriptor, and the event-name/class-listing lookups, all x86-guarded
and modeled on the TSC class. Energy events are read-only and
unqualified. The class prefix (RAPL-) supplies the friendly spelling, so
pmcstat -S rapl-energy-pkg resolves to the canonical ENERGY_PKG event.

Add a pmc.rapl.3 manual page documenting the events, counter scope, the
microjoule unit and wrap handling, and the NUMA/package domain mapping;
link it from pmc.3.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74804
Build 71687: arc lint + arc unit

Event Timeline

lib/libpmc/pmc.rapl.3
28

sentence after the semicolon doesn't follow. If your talking about the bug fix drop it?

41

Maybe something close to: The RAPL PMC driver provides a virtual 64-bit counter that is guaranteed to be monotonic, by periodically sampling the 32-bit hardware counters that wrap frequently. Saying the kernel folds them is awkward.

mhorne added inline comments.
lib/libpmc/libpmc.c
895

Are the casts needed?

899
This revision is now accepted and ready to land.Fri, Jul 10, 4:48 PM

Address review feedback: drop the unneeded (int) casts on pe in rapl_allocate_pmc, since the RAPL bounds are enum pmc_event members (mhorne); reword the microjoule-scaling sentence and describe wrap handling as a virtual 64-bit counter in pmc.rapl.3 (ali_mashtizadeh).

This revision now requires review to proceed.Tue, Jul 14, 7:51 PM
afscoelho_gmail.com marked 2 inline comments as done.

Address review: use explicit 'ctrspec != NULL' in rapl_allocate_pmc (mhorne, style(9)).

afscoelho_gmail.com added inline comments.
lib/libpmc/libpmc.c
895

No, they are not! I copied this from soft_allocate_pmc and didn't check, thanks for the warning !

lib/libpmc/pmc.rapl.3
28

right, I reworded it.

41

I did as you suggested, thanks!

mhorne added inline comments.
lib/libpmc/pmc.rapl.3
2–5
This revision is now accepted and ready to land.Thu, Jul 16, 6:21 PM