Set the trace duration in the PRV header
This commit is contained in:
parent
5dc195a037
commit
e05f78bb0f
9
emu.c
9
emu.c
@ -707,6 +707,14 @@ open_pcfs(struct ovni_emu *emu, char *tracedir)
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix the trace duration at the end */
|
||||
static void
|
||||
fix_prv_headers(struct ovni_emu *emu)
|
||||
{
|
||||
prv_fix_header(emu->prv_thread, emu->delta_time, emu->total_nthreads);
|
||||
prv_fix_header(emu->prv_cpu, emu->delta_time, emu->total_ncpus);
|
||||
}
|
||||
|
||||
static void
|
||||
close_prvs(struct ovni_emu *emu)
|
||||
{
|
||||
@ -1084,6 +1092,7 @@ emu_post(struct ovni_emu *emu)
|
||||
static void
|
||||
emu_destroy(struct ovni_emu *emu)
|
||||
{
|
||||
fix_prv_headers(emu);
|
||||
close_prvs(emu);
|
||||
close_pcfs(emu);
|
||||
destroy_metadata(emu);
|
||||
|
10
prv.c
10
prv.c
@ -81,5 +81,13 @@ prv_ev_autocpu(struct ovni_emu *emu, int type, int val)
|
||||
void
|
||||
prv_header(FILE *f, int nrows)
|
||||
{
|
||||
fprintf(f, "#Paraver (19/01/38 at 03:14):00000000000000000000_ns:0:1:1(%d:1)\n", nrows);
|
||||
fprintf(f, "#Paraver (19/01/38 at 03:14):%020ld_ns:0:1:1(%d:1)\n", 0LU, nrows);
|
||||
}
|
||||
|
||||
void
|
||||
prv_fix_header(FILE *f, uint64_t duration, int nrows)
|
||||
{
|
||||
/* Go to the first byte */
|
||||
fseek(f, 0, SEEK_SET);
|
||||
fprintf(f, "#Paraver (19/01/38 at 03:14):%020ld_ns:0:1:1(%d:1)\n", duration, nrows);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user