Page MenuHomeFreeBSD

tools/regression/pmc: hwpmc grouping regression test
Needs ReviewPublic

Authored by raghavendra.kt_amd.com on Thu, Jun 18, 7:06 AM.
Tags
None
Referenced Files
F160803481: D57638.diff
Sun, Jun 28, 1:25 AM
Unknown Object (File)
Fri, Jun 26, 8:21 AM
Unknown Object (File)
Thu, Jun 25, 4:41 PM
Unknown Object (File)
Wed, Jun 24, 12:42 PM
Unknown Object (File)
Wed, Jun 24, 10:33 AM
Unknown Object (File)
Sun, Jun 21, 6:17 PM
Unknown Object (File)
Fri, Jun 19, 6:50 PM
Unknown Object (File)
Fri, Jun 19, 2:57 AM
Subscribers
None

Details

Summary

Self-contained regression test for the grouping-only paths:

  • allocate two deferred PMCs, group them, commit, attach, start, stop, read, release;
  • all-or-none semantics: build a 4-event group on a 6-counter Zen, expect commit to succeed; build a (cores+1)-event group, expect ENOSPC;
  • row exclusivity: assigner gives each sibling a distinct global ri.

The probe_core_pmcs() helper allocates "instructions" counters until
EBUSY/EAGAIN to discover the actual core-PMC count at run time
(pmc_npmc(0) returns the sum across classes -- e.g., 47 on Zen5 --
which is wrong for sizing CORE-class group tests). Every sibling is
also explicitly pmc_attach()-ed before pmc_start(), now mandatory
under multiplexing semantics.

A companion pmcstat_test.sh exercises the pmcstat(8) -b / {a,b,c}
brace syntax end to end (basic group, two groups, system mode,
sampling, single-element brace, mixed grouped/ungrouped, malformed
brace, and an over-subscribed multiplex group). The regression
Makefile invokes it from "make check-root" when present.

The C test is x86-only (PMC_CLASS_K8) and skips itself politely on
hosts that do not have AMD core PMCs; the shell test SKIPs on
non-AMD CPUs.

Sponsored by: AMD
Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>

Diff Detail

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