summaryrefslogtreecommitdiffstats
path: root/test/util.h
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-01-23 22:24:55 +0100
committerLouis Burda <quent.burda@gmail.com>2023-01-23 22:24:55 +0100
commit1fe8249bbc782d28185e0e893504e8ac3a1fcaec (patch)
tree15790721d2806918327d62e9c4448fc68ef34cd2 /test/util.h
parent0dc0595ee1d84bc77cb431b2417223f3b4a5bd57 (diff)
downloadcachepc-1fe8249bbc782d28185e0e893504e8ac3a1fcaec.tar.gz
cachepc-1fe8249bbc782d28185e0e893504e8ac3a1fcaec.zip
Move kvm to guest process and add ipc for synchronization
Diffstat (limited to 'test/util.h')
-rw-r--r--test/util.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/util.h b/test/util.h
index dbeb4a8..8ad09b8 100644
--- a/test/util.h
+++ b/test/util.h
@@ -7,6 +7,15 @@
#define ARRLEN(x) (sizeof(x) / sizeof((x)[0]))
#define MIN(a,b) ((a) > (b) ? (b) : (a))
+struct ipc {
+ pthread_mutex_t lock;
+ pthread_cond_t sig_parent;
+ bool has_sig_parent;
+ pthread_cond_t sig_child;
+ bool has_sig_child;
+ bool init;
+};
+
void hexdump(void *data, int len);
bool pin_process(pid_t pid, int cpu, bool assert);
@@ -15,3 +24,10 @@ int read_stat_core(pid_t pid);
void print_counts(uint8_t *counts);
void print_counts_raw(uint8_t *counts);
+
+struct ipc *ipc_alloc(void);
+void ipc_free(struct ipc *ipc);
+void ipc_signal_child(struct ipc *ipc);
+void ipc_wait_child(struct ipc *ipc);
+void ipc_signal_parent(struct ipc *ipc);
+void ipc_wait_parent(struct ipc *ipc);