Initialize trace to zero
This commit is contained in:
parent
9a4af7e0ec
commit
0687197f08
@ -14,7 +14,7 @@
|
|||||||
static struct emu_trace *cur_trace = NULL;
|
static struct emu_trace *cur_trace = NULL;
|
||||||
|
|
||||||
static void
|
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);
|
DL_APPEND(trace->streams, stream);
|
||||||
trace->nstreams++;
|
trace->nstreams++;
|
||||||
@ -41,7 +41,7 @@ load_stream(struct emu_trace *trace, const char *path)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
trace_add(trace, stream);
|
add_stream(trace, stream);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -84,6 +84,8 @@ cb_nftw(const char *fpath, const struct stat *sb,
|
|||||||
int
|
int
|
||||||
emu_trace_load(struct emu_trace *trace, const char *tracedir)
|
emu_trace_load(struct emu_trace *trace, const char *tracedir)
|
||||||
{
|
{
|
||||||
|
memset(trace, 0, sizeof(struct emu_trace));
|
||||||
|
|
||||||
cur_trace = trace;
|
cur_trace = trace;
|
||||||
|
|
||||||
if (snprintf(trace->tracedir, PATH_MAX, "%s", tracedir) >= PATH_MAX) {
|
if (snprintf(trace->tracedir, PATH_MAX, "%s", tracedir) >= PATH_MAX) {
|
||||||
|
@ -13,8 +13,6 @@ struct emu_trace {
|
|||||||
|
|
||||||
long nstreams;
|
long nstreams;
|
||||||
struct emu_stream *streams;
|
struct emu_stream *streams;
|
||||||
|
|
||||||
heap_head_t sorted_stream;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int emu_trace_load(struct emu_trace *trace, const char *tracedir);
|
int emu_trace_load(struct emu_trace *trace, const char *tracedir);
|
||||||
|
Loading…
Reference in New Issue
Block a user