aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Silva <andasilv@amd.com>2026-08-11 16:17:57 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2026-08-11 16:22:01 +0000
commitaf3929c5152b47278c0b6ea66efbb782b9637495 (patch)
tree399c759b04a696c03bc6c134327fd8970b107d87
parent66118c3f1011d7852bce8b659899179a83781897 (diff)
hwpmc: fix false callchain assertion on the PMC_UR ring
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> Reviewed by: mhorne MFC after: 1 week Sponsored by: AMD Differential Revision: https://reviews.freebsd.org/D58572
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
index e2d5a044e0b8..bfa8a217235e 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -4983,7 +4983,7 @@ pmc_capture_user_callchain(int cpu, int ring, struct trapframe *tf)
pass = 0;
start_ticks = ticks;
- KASSERT(td->td_pflags & TDP_CALLCHAIN,
+ KASSERT(ring == PMC_UR || (td->td_pflags & TDP_CALLCHAIN) != 0,
("[pmc,%d] Retrieving callchain for thread that doesn't want it",
__LINE__));
restart: