diff --git a/test/emu/ovni/flush-overhead.c b/test/emu/ovni/flush-overhead.c index 24ddd51..6bed3dd 100644 --- a/test/emu/ovni/flush-overhead.c +++ b/test/emu/ovni/flush-overhead.c @@ -1,35 +1,9 @@ /* Copyright (c) 2021-2022 Barcelona Supercomputing Center (BSC) * SPDX-License-Identifier: GPL-3.0-or-later */ -#define _POSIX_C_SOURCE 200112L #define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -#include "compat.h" -#include "ovni.h" - -static inline void -init(void) -{ - char hostname[HOST_NAME_MAX]; - - if (gethostname(hostname, HOST_NAME_MAX) != 0) { - perror("gethostname failed"); - exit(EXIT_FAILURE); - } - - ovni_proc_init(0, hostname, getpid()); - ovni_thread_init(gettid()); - ovni_add_cpu(0, 0); -} +#include "instr_ovni.h" static void emit(uint8_t *buf, size_t size) @@ -45,19 +19,16 @@ emit(uint8_t *buf, size_t size) int main(void) { - size_t payload_size; - uint8_t *payload_buf; - if (setenv("OVNI_TMPDIR", "/dev/shm/ovni-flush-overhead", 1) != 0) { perror("setenv failed"); exit(EXIT_FAILURE); } - init(); + instr_start(0, 1); /* Use 1 MiB of payload */ - payload_size = 1024 * 1024; - payload_buf = calloc(1, payload_size); + size_t payload_size = 1024 * 1024; + uint8_t *payload_buf = calloc(1, payload_size); if (!payload_buf) { perror("calloc failed"); @@ -97,7 +68,7 @@ main(void) exit(EXIT_FAILURE); } - ovni_proc_fini(); + instr_end(); free(payload_buf); free(times);