diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-01-17 16:30:33 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-01-17 16:30:33 +0100 |
| commit | f2ea010b8180b4160d85c92e312971d0cd8a34d4 (patch) | |
| tree | 64e2598df2a0860187b1516e196ce7124de459a9 /test/util.h | |
| parent | 89785aa3c8d5d4007f856b14543a9b8aef31d661 (diff) | |
| download | cachepc-f2ea010b8180b4160d85c92e312971d0cd8a34d4.tar.gz cachepc-f2ea010b8180b4160d85c92e312971d0cd8a34d4.zip | |
Fixup kvm-eviction and refactor kvm-step
Diffstat (limited to 'test/util.h')
| -rw-r--r-- | test/util.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/util.h b/test/util.h new file mode 100644 index 0000000..dbeb4a8 --- /dev/null +++ b/test/util.h @@ -0,0 +1,17 @@ +#pragma once + +#include <sys/types.h> +#include <stdbool.h> +#include <stdint.h> + +#define ARRLEN(x) (sizeof(x) / sizeof((x)[0])) +#define MIN(a,b) ((a) > (b) ? (b) : (a)) + +void hexdump(void *data, int len); + +bool pin_process(pid_t pid, int cpu, bool assert); + +int read_stat_core(pid_t pid); + +void print_counts(uint8_t *counts); +void print_counts_raw(uint8_t *counts); |
