Skip to content

Commit 54108e7

Browse files
committed
KVM: selftests: Print out the actual Top-Down Slots count on failure
Print out the expected vs. actual count of the Top-Down Slots event on failure in the Intel PMU counters test. GUEST_ASSERT() only expands constants/macros, i.e. only prints the value of the expected count, which makes it difficult to debug and triage failures. Link: https://lore.kernel.org/r/20250117234204.2600624-6-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 0e67147 commit 54108e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/testing/selftests/kvm/x86/pmu_counters_test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ static void guest_assert_event_count(uint8_t idx, uint32_t pmc, uint32_t pmc_msr
174174
GUEST_ASSERT_NE(count, 0);
175175
break;
176176
case INTEL_ARCH_TOPDOWN_SLOTS_INDEX:
177-
GUEST_ASSERT(count >= NUM_INSNS_RETIRED);
177+
__GUEST_ASSERT(count >= NUM_INSNS_RETIRED,
178+
"Expected top-down slots >= %u, got count = %lu",
179+
NUM_INSNS_RETIRED, count);
178180
break;
179181
default:
180182
break;

0 commit comments

Comments
 (0)