Set the loom in the process

This commit is contained in:
Rodrigo Arias 2021-10-14 09:06:11 +02:00
parent 8790ef5da9
commit 151f5a2b77
2 changed files with 6 additions and 2 deletions

3
emu.h
View File

@ -236,6 +236,9 @@ struct ovni_eproc {
int gindex; int gindex;
int appid; int appid;
/* The loom of the current process */
struct ovni_loom *loom;
/* Path of the process tracedir */ /* Path of the process tracedir */
char dir[PATH_MAX]; char dir[PATH_MAX];

5
ovni.c
View File

@ -624,7 +624,7 @@ load_proc_metadata(struct ovni_eproc *proc)
static int static int
load_proc(struct ovni_eproc *proc, int index, int pid, char *procdir) load_proc(struct ovni_eproc *proc, struct ovni_loom *loom, int index, int pid, char *procdir)
{ {
static int total_procs = 0; static int total_procs = 0;
@ -637,6 +637,7 @@ load_proc(struct ovni_eproc *proc, int index, int pid, char *procdir)
proc->pid = pid; proc->pid = pid;
proc->index = index; proc->index = index;
proc->gindex = total_procs++; proc->gindex = total_procs++;
proc->loom = loom;
sprintf(path, "%s/%s", procdir, "metadata.json"); sprintf(path, "%s/%s", procdir, "metadata.json");
proc->meta = json_parse_file_with_comments(path); proc->meta = json_parse_file_with_comments(path);
@ -713,7 +714,7 @@ load_loom(struct ovni_loom *loom, int loomid, char *loomdir)
proc = &loom->proc[loom->nprocs]; proc = &loom->proc[loom->nprocs];
if(load_proc(proc, loom->nprocs, pid, path) != 0) if(load_proc(proc, loom, loom->nprocs, pid, path) != 0)
return -1; return -1;
loom->nprocs++; loom->nprocs++;