aboutsummaryrefslogtreecommitdiff
path: root/trace/simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace/simple.c')
-rw-r--r--trace/simple.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/trace/simple.c b/trace/simple.c
index de355e9675..369e860305 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -16,6 +16,7 @@
#include <pthread.h>
#include "qemu-timer.h"
#include "trace.h"
+#include "trace/control.h"
/** Trace file header event ID */
#define HEADER_EVENT_ID (~(uint64_t)0) /* avoids conflicting with TraceEventIDs */
@@ -330,7 +331,7 @@ void st_flush_trace_buffer(void)
flush_trace_file(true);
}
-bool st_init(const char *file)
+bool trace_backend_init(const char *file)
{
pthread_t thread;
pthread_attr_t attr;
@@ -346,10 +347,11 @@ bool st_init(const char *file)
pthread_sigmask(SIG_SETMASK, &oldset, NULL);
if (ret != 0) {
- return false;
+ fprintf(stderr, "warning: unable to initialize simple trace backend\n");
+ } else {
+ atexit(st_flush_trace_buffer);
+ st_set_trace_file(file);
}
- atexit(st_flush_trace_buffer);
- st_set_trace_file(file);
return true;
}