Remove rthread and rproc definitions from ovni.h

This commit is contained in:
Rodrigo Arias 2023-10-27 14:52:37 +02:00
parent 7a33deffb7
commit 5d9aef4ed8
2 changed files with 39 additions and 42 deletions

View File

@ -18,9 +18,6 @@ extern "C" {
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
/* Hardcode the JSON_Value to avoid a dependency with janson */
typedef struct json_value_t JSON_Value;
#define OVNI_METADATA_VERSION 1 #define OVNI_METADATA_VERSION 1
#define OVNI_TRACEDIR "ovni" #define OVNI_TRACEDIR "ovni"
@ -89,45 +86,6 @@ struct __attribute__((__packed__)) ovni_stream_header {
/* ----------------------- runtime ------------------------ */ /* ----------------------- 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) #define ovni_version_check() ovni_version_check_str(OVNI_LIB_VERSION)
void ovni_version_check_str(const char *version); void ovni_version_check_str(const char *version);
void ovni_version_get(const char **version, const char **commit); void ovni_version_get(const char **version, const char **commit);

View File

@ -17,6 +17,45 @@
#include "parson.h" #include "parson.h"
#include "version.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 */ /* Data per process */
struct ovni_rproc rproc = {0}; struct ovni_rproc rproc = {0};