From 899b82c36faee9cd755a8672072642ea2301e174 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 20 Feb 2023 18:57:48 +0100 Subject: [PATCH] Update flush-overhead too --- test/emu/ovni/flush-overhead.c | 39 +++++----------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) 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);