diff options
| author | Louis Burda <quent.burda@gmail.com> | 2022-10-06 12:02:32 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2022-10-06 12:02:32 +0200 |
| commit | 572985d705e4575d53ec5d312a484a96a01bce9f (patch) | |
| tree | cade3b6ac3d2e07e60116abbac6495645d0a3a92 /test/eviction.c | |
| parent | d505f8bebab8214981a7b4ad63e2595fa497074c (diff) | |
| download | cachepc-572985d705e4575d53ec5d312a484a96a01bce9f.tar.gz cachepc-572985d705e4575d53ec5d312a484a96a01bce9f.zip | |
Move cachepc ioctl into kvm device and remove old procfs endpoint
Diffstat (limited to 'test/eviction.c')
| -rw-r--r-- | test/eviction.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/test/eviction.c b/test/eviction.c index 9fb57b5..9ad6e56 100644 --- a/test/eviction.c +++ b/test/eviction.c @@ -14,28 +14,26 @@ main(int argc, const char **argv) { uint16_t counts[64]; uint32_t arg; - size_t i, len; - int fd, ret; + int i, fd, ret; - fd = open("/proc/cachepc", O_RDONLY); + fd = open("/dev/kvm", O_RDONLY); if (fd < 0) err(1, "open"); arg = 48; if (argc == 2) arg = atoi(argv[1]); - ret = ioctl(fd, CACHEPC_IOCTL_TEST_EVICTION, &arg); - if (ret == -1) err(1, "ioctl"); + ret = ioctl(fd, KVM_CPC_TEST_EVICTION, &arg); + if (ret == -1) err(1, "ioctl TEST_EVICTION"); - len = read(fd, counts, sizeof(counts)); - if (len != sizeof(counts)) - errx(1, "invalid count read"); + ret = ioctl(fd, KVM_CPC_READ_COUNTS, counts); + if (ret == -1) err(1, "ioctl READ_COUNTS"); for (i = 0; i < 64; i++) { if (i % 16 == 0 && i) printf("\n"); if (counts[i] > 0) printf("\x1b[91m"); - printf("%2lu ", i); + printf("%2i ", i); if (counts[i] > 0) printf("\x1b[0m"); } |
