Page MenuHomeFreeBSD

hwpmc: snapshot grouped counter values and run time
Needs ReviewPublic

Authored by afscoelho_gmail.com on Sep 3 2026, 9:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 14, 10:23 PM
Unknown Object (File)
Wed, Oct 14, 6:56 PM
Unknown Object (File)
Wed, Oct 14, 3:06 AM
Unknown Object (File)
Tue, Oct 13, 3:21 AM
Unknown Object (File)
Mon, Oct 12, 10:46 AM
Unknown Object (File)
Mon, Oct 12, 4:58 AM
Unknown Object (File)
Thu, Oct 8, 9:23 PM
Unknown Object (File)
Wed, Oct 7, 8:13 PM
Subscribers

Details

Summary

Add PMCGROUPREAD, which returns the counts of every member of a group
and the run time of the group in one call.

A caller that reads the members one at a time with PMCRW gets values
from different intervals, and cannot tell how long the group actually
ran. That makes the counts of a multiplexed group meaningless: the
reader cannot scale them.

PMCGROUPREAD takes the values of all members at one point. It stops the
members on the CPUs that hold them, reads them, and reports the enabled
time and the running time of the group with the counts. A reader scales
a multiplexed count by the ratio of the two.

A caller that passes a zero member capacity gets the member count and
the times, and can then size its buffer.

Sponsored by: AMD

Signed-off-by: Andre Silva <andasilv@amd.com>

Diff Detail

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

Event Timeline

Rebase on main (D60141 and D60185 are committed). No change.