diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-01-23 22:24:55 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-01-23 22:24:55 +0100 |
| commit | 1fe8249bbc782d28185e0e893504e8ac3a1fcaec (patch) | |
| tree | 15790721d2806918327d62e9c4448fc68ef34cd2 /test/util.h | |
| parent | 0dc0595ee1d84bc77cb431b2417223f3b4a5bd57 (diff) | |
| download | cachepc-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.h | 16 |
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); |
