diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-01-10 01:37:23 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-01-10 01:38:43 +0100 |
| commit | 252b11a01e061fd17821e53a41c8451a1d2c27bd (patch) | |
| tree | e887ead2faddc8691fc13da426655a0062351cdc /test/eviction.c | |
| parent | 864f5fa9d539734d823b3d0613dbf1a43beec334 (diff) | |
| download | cachepc-252b11a01e061fd17821e53a41c8451a1d2c27bd.tar.gz cachepc-252b11a01e061fd17821e53a41c8451a1d2c27bd.zip | |
Begin ioctl and test-case overhaul
Diffstat (limited to 'test/eviction.c')
| -rw-r--r-- | test/eviction.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/eviction.c b/test/eviction.c index 1570205..8cb5914 100644 --- a/test/eviction.c +++ b/test/eviction.c @@ -2,31 +2,31 @@ #include <sys/ioctl.h> #include <fcntl.h> -#include <stdint.h> #include <assert.h> #include <unistd.h> #include <err.h> -#include <stdlib.h> +#include <stdint.h> #include <stdio.h> +#include <stdlib.h> int main(int argc, const char **argv) { - cpc_msrmt_t counts[L1_SETS]; - uint32_t arg; + uint8_t counts[L1_SETS]; + uint32_t set; int i, fd, ret; fd = open("/dev/kvm", O_RDONLY); if (fd < 0) err(1, "open"); - arg = 48; - if (argc == 2) arg = atoi(argv[1]); + set = 48; + if (argc > 1) set = atoi(argv[1]); - ret = ioctl(fd, KVM_CPC_TEST_EVICTION, &arg); - if (ret == -1) err(1, "ioctl TEST_EVICTION"); + ret = ioctl(fd, KVM_CPC_TEST_EVICTION, &set); + if (ret == -1) err(1, "ioctl KVM_CPC_TEST_EVICTION"); ret = ioctl(fd, KVM_CPC_READ_COUNTS, counts); - if (ret == -1) err(1, "ioctl READ_COUNTS"); + if (ret == -1) err(1, "ioctl KVM_CPC_READ_COUNTS"); for (i = 0; i < 64; i++) { if (i % 16 == 0 && i) @@ -38,6 +38,6 @@ main(int argc, const char **argv) printf("\x1b[0m"); } printf("\n"); - + close(fd); } |
