Skip to content

Commit c55a475

Browse files
committed
KVM: selftests: Convert the memslot performance test to printf guest asserts
Use the printf-based GUEST_ASSERT_EQ() in the memslot perf test instead of an half-baked open code version. Link: https://lore.kernel.org/r/20230729003643.1053367-16-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent d0ad3ba commit c55a475

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/testing/selftests/kvm/memslot_perf_test.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*
77
* Basic guest setup / host vCPU thread code lifted from set_memory_region_test.
88
*/
9+
#define USE_GUEST_ASSERT_PRINTF 1
10+
911
#include <pthread.h>
1012
#include <sched.h>
1113
#include <semaphore.h>
@@ -157,7 +159,7 @@ static void *vcpu_worker(void *__data)
157159
goto done;
158160
break;
159161
case UCALL_ABORT:
160-
REPORT_GUEST_ASSERT_1(uc, "val = %lu");
162+
REPORT_GUEST_ASSERT(uc);
161163
break;
162164
case UCALL_DONE:
163165
goto done;
@@ -560,7 +562,7 @@ static void guest_code_test_memslot_rw(void)
560562
ptr < MEM_TEST_GPA + MEM_TEST_SIZE; ptr += page_size) {
561563
uint64_t val = *(uint64_t *)ptr;
562564

563-
GUEST_ASSERT_1(val == MEM_TEST_VAL_2, val);
565+
GUEST_ASSERT_EQ(val, MEM_TEST_VAL_2);
564566
*(uint64_t *)ptr = 0;
565567
}
566568

0 commit comments

Comments
 (0)