aboutsummaryrefslogtreecommitdiff
path: root/trace/control.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-01-07 16:55:24 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2016-02-03 09:19:09 +0000
commit41fc57e44ed64cd4ab5393d83624afd897dabd4f (patch)
tree8402d21c2011befea319ad11ba22e14a4bacdb38 /trace/control.c
parent45bd0b41bdbf554e49fb510673309164c513a8c8 (diff)
trace: split trace_init_file out of trace_init_backends
This is cleaner, and improves error reporting with -daemonize. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-4-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'trace/control.c')
-rw-r--r--trace/control.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/trace/control.c b/trace/control.c
index 931d64c0c8..f5a497a391 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -145,17 +145,24 @@ void trace_init_events(const char *fname)
loc_pop(&loc);
}
-bool trace_init_backends(const char *file)
+void trace_init_file(const char *file)
{
#ifdef CONFIG_TRACE_SIMPLE
- if (!st_init(file)) {
- fprintf(stderr, "failed to initialize simple tracing backend.\n");
- return false;
- }
+ st_set_trace_file(file);
#else
if (file) {
fprintf(stderr, "error: -trace file=...: "
"option not supported by the selected tracing backends\n");
+ exit(1);
+ }
+#endif
+}
+
+bool trace_init_backends(void)
+{
+#ifdef CONFIG_TRACE_SIMPLE
+ if (!st_init()) {
+ fprintf(stderr, "failed to initialize simple tracing backend.\n");
return false;
}
#endif