Page MenuHomeFreeBSD

hwpmc: fix false callchain assertion on the PMC_UR ring
Needs ReviewPublic

Authored by afscoelho_gmail.com on Fri, Jul 31, 2:21 PM.

Details

Summary

pmc_capture_user_callchain() asserts that TDP_CALLCHAIN is set on the
current thread, but PMC_UR samples never set that flag -- only PMC_HR
and PMC_SR do. That makes the assertion always fail for PMC_UR,
panicking INVARIANTS kernels as soon as pmcstat -U is used.

Skip the assertion for PMC_UR. No functional change on kernels built
without INVARIANTS.

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

Diff Detail

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

Event Timeline

These two diffs should be merged but does it fix the -U flag bug? I don’t see why we need to keep the two path I had a patch to unify them but I hit a different assert.

These two diffs should be merged but does it fix the -U flag bug? I don’t see why we need to keep the two path I had a patch to unify them but I hit a different assert.

Yes, we can merge, no problem. I just kept them separate because I thought the two assertion bugs were clearer as two small diffs. D58572 fixes the -U panic, while D58571 fixes the other runcount assertion. With both applied, -U survived my stress test.