From 5d9aef4ed89323bab5bac26d8289ec47ff33ac43 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Fri, 27 Oct 2023 14:52:37 +0200 Subject: [PATCH] Remove rthread and rproc definitions from ovni.h --- include/ovni.h.in | 42 ------------------------------------------ src/rt/ovni.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 42 deletions(-) diff --git a/include/ovni.h.in b/include/ovni.h.in index d1907db..a30d730 100644 --- a/include/ovni.h.in +++ b/include/ovni.h.in @@ -18,9 +18,6 @@ extern "C" { #include #include -/* Hardcode the JSON_Value to avoid a dependency with janson */ -typedef struct json_value_t JSON_Value; - #define OVNI_METADATA_VERSION 1 #define OVNI_TRACEDIR "ovni" @@ -89,45 +86,6 @@ struct __attribute__((__packed__)) ovni_stream_header { /* ----------------------- runtime ------------------------ */ -/* State of each thread on runtime */ -struct ovni_rthread { - /* Current thread id */ - pid_t tid; - - /* Stream trace file descriptor */ - int streamfd; - - int ready; - - /* The number of bytes filled with events */ - size_t evlen; - - /* Buffer to write events */ - uint8_t *evbuf; -}; - -/* State of each process on runtime */ -struct ovni_rproc { - /* Where the process trace is finally copied */ - char procdir_final[PATH_MAX]; - - /* Where the process trace is flushed */ - char procdir[PATH_MAX]; - - /* If needs to be moved at the end */ - int move_to_final; - - int app; - int pid; - char loom[OVNI_MAX_HOSTNAME]; - int ncpus; - clockid_t clockid; - - int ready; - - JSON_Value *meta; -}; - #define ovni_version_check() ovni_version_check_str(OVNI_LIB_VERSION) void ovni_version_check_str(const char *version); void ovni_version_get(const char **version, const char **commit); diff --git a/src/rt/ovni.c b/src/rt/ovni.c index 7ac523d..221e36e 100644 --- a/src/rt/ovni.c +++ b/src/rt/ovni.c @@ -17,6 +17,45 @@ #include "parson.h" #include "version.h" +/* State of each thread on runtime */ +struct ovni_rthread { + /* Current thread id */ + pid_t tid; + + /* Stream trace file descriptor */ + int streamfd; + + int ready; + + /* The number of bytes filled with events */ + size_t evlen; + + /* Buffer to write events */ + uint8_t *evbuf; +}; + +/* State of each process on runtime */ +struct ovni_rproc { + /* Where the process trace is finally copied */ + char procdir_final[PATH_MAX]; + + /* Where the process trace is flushed */ + char procdir[PATH_MAX]; + + /* If needs to be moved at the end */ + int move_to_final; + + int app; + int pid; + char loom[OVNI_MAX_HOSTNAME]; + int ncpus; + clockid_t clockid; + + int ready; + + JSON_Value *meta; +}; + /* Data per process */ struct ovni_rproc rproc = {0};