Use .obs extension for ovni binary streams

This commit is contained in:
Rodrigo Arias 2023-02-13 11:23:47 +01:00 committed by Rodrigo Arias Mallo
parent 0746d2a0ec
commit 8727126551
4 changed files with 9 additions and 7 deletions

View File

@ -31,6 +31,8 @@ typedef struct json_value_t JSON_Value;
#define OVNI_STREAM_VERSION 1
#define OVNI_MODEL_VERSION "O1 V1 T1 M1 D1 K1 61"
#define OVNI_STREAM_EXT ".obs"
/* Follow https://semver.org rules for versioning */
#define OVNI_LIB_VERSION "1.0.0"

View File

@ -75,7 +75,7 @@ cb_nftw(const char *fpath, const struct stat *sb,
if (typeflag != FTW_F)
return 0;
if (!has_suffix(fpath, ".ovnistream"))
if (!has_suffix(fpath, OVNI_STREAM_EXT))
return 0;
return load_stream(cur_trace, fpath);

View File

@ -61,12 +61,12 @@ create_trace_stream(void)
{
char path[PATH_MAX];
int written = snprintf(path, PATH_MAX, "%s/thread.%d.ovnistream",
rproc.procdir, rthread.tid);
int written = snprintf(path, PATH_MAX, "%s/thread.%d%s",
rproc.procdir, rthread.tid, OVNI_STREAM_EXT);
if (written >= PATH_MAX)
die("thread trace path too long: %s/thread.%d.ovnistream\n",
rproc.procdir, rthread.tid);
die("thread trace path too long: %s/thread.%d%s\n",
rproc.procdir, rthread.tid, OVNI_STREAM_EXT);
rthread.streamfd = open(path, O_WRONLY | O_CREAT, 0644);

View File

@ -29,7 +29,7 @@ test_oversubscription(void)
struct thread th0, th1;
if (thread_init_begin(&th0, &proc, "loom.0/proc.0/thread.0.ovnistream") != 0)
if (thread_init_begin(&th0, &proc, "loom.0/proc.0/thread.0.obs") != 0)
die("thread_init_begin failed");
thread_set_gindex(&th0, 0);
@ -37,7 +37,7 @@ test_oversubscription(void)
if (thread_init_end(&th0) != 0)
die("thread_init_end failed");
if (thread_init_begin(&th1, &proc, "loom.1/proc.1/thread.1.ovnistream") != 0)
if (thread_init_begin(&th1, &proc, "loom.1/proc.1/thread.1.obs") != 0)
die("thread_init_begin failed");
thread_set_gindex(&th1, 1);