On 1/4/21 3:31 PM, Stefan Hajnoczi wrote: > From: Doug Evans <d...@google.com> > > ... for consistency with "-d help".
Doh the request to make sense with this comment got lost :/ https://www.mail-archive.com/qemu-devel@nongnu.org/msg765789.html Not a big deal as the patch is trivial. > > Signed-off-by: Doug Evans <d...@google.com> > Message-id: 20201125215245.3514695-1-...@google.com > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> > --- > trace/control.h | 3 ++- > trace/control.c | 12 ++++++------ > 2 files changed, 8 insertions(+), 7 deletions(-) > > diff --git a/trace/control.h b/trace/control.h > index 05b95ea453..9522a7b318 100644 > --- a/trace/control.h > +++ b/trace/control.h > @@ -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: > diff --git a/trace/control.c b/trace/control.c > index b82fb87316..cd04dd4e0c 100644 > --- a/trace/control.c > +++ b/trace/control.c > @@ -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); > } >