]> git.proxmox.com Git - mirror_qemu.git/commitdiff
trace: Send "-d trace:help" output to stdout
authorDoug Evans <dje@google.com>
Wed, 25 Nov 2020 21:52:45 +0000 (13:52 -0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 4 Jan 2021 14:24:40 +0000 (14:24 +0000)
... for consistency with "-d help".

Signed-off-by: Doug Evans <dje@google.com>
Message-id: 20201125215245.3514695-1-dje@google.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
trace/control.c
trace/control.h

index b82fb87316daed1fe855579fbcc919c5b807511d..cd04dd4e0c1cd009410c9d1021b9b5cb468ab158 100644 (file)
@@ -125,18 +125,18 @@ TraceEvent *trace_event_iter_next(TraceEventIter *iter)
     return NULL;
 }
 
-void trace_list_events(void)
+void trace_list_events(FILE *f)
 {
     TraceEventIter iter;
     TraceEvent *ev;
     trace_event_iter_init(&iter, NULL);
     while ((ev = trace_event_iter_next(&iter)) != NULL) {
-        fprintf(stderr, "%s\n", trace_event_get_name(ev));
+        fprintf(f, "%s\n", trace_event_get_name(ev));
     }
 #ifdef CONFIG_TRACE_DTRACE
-    fprintf(stderr, "This list of names of trace points may be incomplete "
-                    "when using the DTrace/SystemTap backends.\n"
-                    "Run 'qemu-trace-stap list %s' to print the full list.\n",
+    fprintf(f, "This list of names of trace points may be incomplete "
+               "when using the DTrace/SystemTap backends.\n"
+               "Run 'qemu-trace-stap list %s' to print the full list.\n",
             error_get_progname());
 #endif
 }
@@ -176,7 +176,7 @@ static void do_trace_enable_events(const char *line_buf)
 void trace_enable_events(const char *line_buf)
 {
     if (is_help_option(line_buf)) {
-        trace_list_events();
+        trace_list_events(stdout);
         if (monitor_cur() == NULL) {
             exit(0);
         }
index 05b95ea4532afc77d47e943184400350480e799b..9522a7b318e21294fabd36864c27f7402dc9425e 100644 (file)
@@ -201,10 +201,11 @@ void trace_fini_vcpu(CPUState *vcpu);
 
 /**
  * trace_list_events:
+ * @f: Where to send output.
  *
  * List all available events.
  */
-void trace_list_events(void);
+void trace_list_events(FILE *f);
 
 /**
  * trace_enable_events: