Update flush-overhead too
This commit is contained in:
parent
7b80aa6aaf
commit
899b82c36f
@ -1,35 +1,9 @@
|
|||||||
/* Copyright (c) 2021-2022 Barcelona Supercomputing Center (BSC)
|
/* Copyright (c) 2021-2022 Barcelona Supercomputing Center (BSC)
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later */
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
||||||
|
|
||||||
#define _POSIX_C_SOURCE 200112L
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include <limits.h>
|
#include "instr_ovni.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);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emit(uint8_t *buf, size_t size)
|
emit(uint8_t *buf, size_t size)
|
||||||
@ -45,19 +19,16 @@ emit(uint8_t *buf, size_t size)
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
size_t payload_size;
|
|
||||||
uint8_t *payload_buf;
|
|
||||||
|
|
||||||
if (setenv("OVNI_TMPDIR", "/dev/shm/ovni-flush-overhead", 1) != 0) {
|
if (setenv("OVNI_TMPDIR", "/dev/shm/ovni-flush-overhead", 1) != 0) {
|
||||||
perror("setenv failed");
|
perror("setenv failed");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
init();
|
instr_start(0, 1);
|
||||||
|
|
||||||
/* Use 1 MiB of payload */
|
/* Use 1 MiB of payload */
|
||||||
payload_size = 1024 * 1024;
|
size_t payload_size = 1024 * 1024;
|
||||||
payload_buf = calloc(1, payload_size);
|
uint8_t *payload_buf = calloc(1, payload_size);
|
||||||
|
|
||||||
if (!payload_buf) {
|
if (!payload_buf) {
|
||||||
perror("calloc failed");
|
perror("calloc failed");
|
||||||
@ -97,7 +68,7 @@ main(void)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ovni_proc_fini();
|
instr_end();
|
||||||
|
|
||||||
free(payload_buf);
|
free(payload_buf);
|
||||||
free(times);
|
free(times);
|
||||||
|
Loading…
Reference in New Issue
Block a user