Update flush-overhead too

This commit is contained in:
Rodrigo Arias 2023-02-20 18:57:48 +01:00 committed by Rodrigo Arias Mallo
parent 7b80aa6aaf
commit 899b82c36f

View File

@ -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 <limits.h>
#include <linux/limits.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
#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);