summaryrefslogtreecommitdiffstats
path: root/test/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/util.h')
-rw-r--r--test/util.h17
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);