The legacy and modern (pmu-events) allocation paths are distinct.
Further clarify this by splitting the function in two.
Details
Details
- Reviewers
ali_mashtizadeh.com afscoelho_gmail.com gnn olivier - Group Reviewers
pmc
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 77418 Build 74301: arc lint + arc unit
Event Timeline
| sys/dev/hwpmc/hwpmc_amd.c | ||
|---|---|---|
| 413 | should we not check for PMC_F_EV_PMU here also? if ((a->pm_flags & PMC_F_EV_PMU) != 0)
return (EXTERROR(EINVAL,
"AMD pmu-events are not supported on this CPU")); | |
| 419 | PMCDBG2(MDP, ALL, 1,"amd-allocate-legacy ri=%d caps=0x%x", ri, caps); | |
| 468 | PMCDBG2(MDP, ALL, 2, "amd-allocate-legacy ri=%d -> config=0x%x", ri, config); | |
| 505 | I think you need to put this check also in the beginning of the legacy path, otherwise if a client fills all core counters, a wrong allocation can happen on the L3 row. For example, the command pmcstat -s k8-fr-retired-x86-instructions -s k8-bu-cpu-clk-unhalted \
-s k8-dc-access -s k8-dc-miss -s k8-ic-miss \
-s k8-fr-retired-taken-branches -s k8-ic-fetch sleep 5will put k8-ic-fetch on an L3 counter. Today it returns an error (expected): ❯ sudo pmcstat -s k8-fr-retired-x86-instructions -s k8-bu-cpu-clk-unhalted \ -s k8-dc-access -s k8-dc-miss -s k8-ic-miss \ -s k8-fr-retired-taken-branches -s k8-ic-fetch sleep 5 pmcstat: ERROR: Cannot allocate system-mode pmc with specification "k8-ic-fetch": Invalid argument (No PMC row accepted the allocation request) | |