diff mbox series

[1/1] trace: Send "-d trace:help" output to stdout

Message ID 20201125215245.3514695-1-dje@google.com (mailing list archive)
State New, archived
Headers show
Series [1/1] trace: Send "-d trace:help" output to stdout | expand

Commit Message

Doug Evans Nov. 25, 2020, 9:52 p.m. UTC
... for consistency with "-d help".

Signed-off-by: Doug Evans <dje@google.com>
---
 trace/control.c | 12 ++++++------
 trace/control.h |  3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)

Comments

Stefan Hajnoczi Dec. 10, 2020, 11:25 a.m. UTC | #1
On Wed, Nov 25, 2020 at 01:52:45PM -0800, Doug Evans wrote:
> ... for consistency with "-d help".
> 
> Signed-off-by: Doug Evans <dje@google.com>
> ---
>  trace/control.c | 12 ++++++------
>  trace/control.h |  3 ++-
>  2 files changed, 8 insertions(+), 7 deletions(-)

Thanks, applied to my tracing tree:
https://gitlab.com/stefanha/qemu/commits/tracing

Stefan
Philippe Mathieu-Daudé Dec. 10, 2020, 11:30 a.m. UTC | #2
Hi Stefan,

On 12/10/20 12:25 PM, Stefan Hajnoczi wrote:
> On Wed, Nov 25, 2020 at 01:52:45PM -0800, Doug Evans wrote:
>> ... for consistency with "-d help".

Do you mind replacing the '...' by the subject:
'Send "-d trace:help" output to stdout', so the
commit description makes more sense?

Thanks,

Phil.

>>
>> Signed-off-by: Doug Evans <dje@google.com>
>> ---
>>  trace/control.c | 12 ++++++------
>>  trace/control.h |  3 ++-
>>  2 files changed, 8 insertions(+), 7 deletions(-)
> 
> Thanks, applied to my tracing tree:
> https://gitlab.com/stefanha/qemu/commits/tracing
> 
> Stefan
>
Doug Evans Dec. 11, 2020, 9:55 p.m. UTC | #3
Thanks.
I gather this is a first step in getting the patch into master?
If so, OOC, how many separate "staging" trees are there for the master
branch? (is there a list?)

On Thu, Dec 10, 2020 at 3:25 AM Stefan Hajnoczi <stefanha@redhat.com> wrote:

> On Wed, Nov 25, 2020 at 01:52:45PM -0800, Doug Evans wrote:
> > ... for consistency with "-d help".
> >
> > Signed-off-by: Doug Evans <dje@google.com>
> > ---
> >  trace/control.c | 12 ++++++------
> >  trace/control.h |  3 ++-
> >  2 files changed, 8 insertions(+), 7 deletions(-)
>
> Thanks, applied to my tracing tree:
> https://gitlab.com/stefanha/qemu/commits/tracing
>
> Stefan
>
diff mbox series

Patch

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);
         }
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: