diff --git a/src/emu/emu_trace.c b/src/emu/emu_trace.c index 6ab6a39..a96ccdb 100644 --- a/src/emu/emu_trace.c +++ b/src/emu/emu_trace.c @@ -14,7 +14,7 @@ static struct emu_trace *cur_trace = NULL; static void -trace_add(struct emu_trace *trace, struct emu_stream *stream) +add_stream(struct emu_trace *trace, struct emu_stream *stream) { DL_APPEND(trace->streams, stream); trace->nstreams++; @@ -41,7 +41,7 @@ load_stream(struct emu_trace *trace, const char *path) return -1; } - trace_add(trace, stream); + add_stream(trace, stream); return 0; } @@ -84,6 +84,8 @@ cb_nftw(const char *fpath, const struct stat *sb, int emu_trace_load(struct emu_trace *trace, const char *tracedir) { + memset(trace, 0, sizeof(struct emu_trace)); + cur_trace = trace; if (snprintf(trace->tracedir, PATH_MAX, "%s", tracedir) >= PATH_MAX) { diff --git a/src/emu/emu_trace.h b/src/emu/emu_trace.h index e8ff49d..1b0dcd6 100644 --- a/src/emu/emu_trace.h +++ b/src/emu/emu_trace.h @@ -13,8 +13,6 @@ struct emu_trace { long nstreams; struct emu_stream *streams; - - heap_head_t sorted_stream; }; int emu_trace_load(struct emu_trace *trace, const char *tracedir);