From 769e05dd63ed0379e7325da6e82c0c46c151ef4e Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Sat, 21 Jan 2023 02:23:52 +0100 Subject: Reimplement test and prime+probe in asm, make self-tests harder and improve noise --- test/eviction.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'test/eviction.c') diff --git a/test/eviction.c b/test/eviction.c index 69103af..fc11630 100644 --- a/test/eviction.c +++ b/test/eviction.c @@ -1,3 +1,4 @@ +#include "test/util.h" #include "cachepc/uapi.h" #include @@ -14,7 +15,7 @@ main(int argc, const char **argv) { uint8_t counts[L1_SETS]; uint32_t set; - int i, fd, ret; + int fd, ret; fd = open("/dev/kvm", O_RDONLY); if (fd < 0) err(1, "open"); @@ -30,16 +31,9 @@ main(int argc, const char **argv) ret = ioctl(fd, KVM_CPC_READ_COUNTS, counts); if (ret == -1) err(1, "ioctl KVM_CPC_READ_COUNTS"); - for (i = 0; i < 64; i++) { - if (i % 16 == 0 && i) - printf("\n"); - if (counts[i] > 0) - printf("\x1b[91m"); - printf("%2i ", i); - if (counts[i] > 0) - printf("\x1b[0m"); - } + print_counts(counts); printf("\n"); + print_counts_raw(counts); close(fd); } -- cgit v1.2.3-71-gd317