diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-02-07 07:38:12 -0600 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-02-07 07:39:04 -0600 |
| commit | a2cdd64c6f915d969dfa21e23049ff4b3836b13d (patch) | |
| tree | cfb335e21f99cd584d4821991d526d56cc431d00 /test/eviction.c | |
| parent | 546a50cb8bb80775c71e7469f2a2891ac1fa1b24 (diff) | |
| download | cachepc-a2cdd64c6f915d969dfa21e23049ff4b3836b13d.tar.gz cachepc-a2cdd64c6f915d969dfa21e23049ff4b3836b13d.zip | |
Add combined testcase based on exit codes
Diffstat (limited to 'test/eviction.c')
| -rw-r--r-- | test/eviction.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/eviction.c b/test/eviction.c index fc11630..ca404b9 100644 --- a/test/eviction.c +++ b/test/eviction.c @@ -14,7 +14,7 @@ int main(int argc, const char **argv) { uint8_t counts[L1_SETS]; - uint32_t set; + uint32_t arg, set; int fd, ret; fd = open("/dev/kvm", O_RDONLY); @@ -22,18 +22,23 @@ main(int argc, const char **argv) set = 48; if (argc > 1) set = atoi(argv[1]); - if (set >= L1_SETS) - errx(1, "set out-of-bounds"); + if (set >= L1_SETS) errx(1, "set out-of-bounds"); - ret = ioctl(fd, KVM_CPC_TEST_EVICTION, &set); - if (ret == -1) err(1, "ioctl KVM_CPC_TEST_EVICTION"); + ret = ioctl(fd, KVM_CPC_RESET, &arg); + if (ret == -1) err(1, "KVM_CPC_RESET"); + + arg = set; + ret = ioctl(fd, KVM_CPC_TEST_EVICTION, &arg); + if (ret == -1) err(1, "KVM_CPC_TEST_EVICTION"); ret = ioctl(fd, KVM_CPC_READ_COUNTS, counts); - if (ret == -1) err(1, "ioctl KVM_CPC_READ_COUNTS"); + if (ret == -1) err(1, "KVM_CPC_READ_COUNTS"); print_counts(counts); printf("\n"); print_counts_raw(counts); close(fd); + + return arg; } |
