qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] tracing: Use double-dash spelling for trace option
@ 2018-07-04  3:17 Yaowei Bai
  2018-07-10 14:17 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Yaowei Bai @ 2018-07-04  3:17 UTC (permalink / raw)
  To: mjt, laurent
  Cc: stefanha, baiyaowei, eblake, cota, qemu-trivial, armbru,
	qemu-devel

The '-trace' and '--trace' spellings are only both supported in qemu
binary, while for qemu-nbd or qemu-img only '--trace' spelling is
supported. So for the consistency of trace option invocation, we
should use double-dash spelling in our documentation.

This's also mentioned in
https://wiki.qemu.org/BiteSizedTasks#Consistent_option_usage_in_documentation
.

Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 docs/devel/tracing.txt | 6 +++---
 trace/control.c        | 4 ++--
 trace/control.h        | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt
index 6f815ec..bc52f12 100644
--- a/docs/devel/tracing.txt
+++ b/docs/devel/tracing.txt
@@ -18,7 +18,7 @@ for debugging, profiling, and observing execution.
 
 3. Run the virtual machine to produce a trace file:
 
-    qemu -trace events=/tmp/events ... # your normal QEMU invocation
+    qemu --trace events=/tmp/events ... # your normal QEMU invocation
 
 4. Pretty-print the binary trace file:
 
@@ -157,11 +157,11 @@ The state of events can also be queried and modified through monitor commands:
 * trace-event NAME on|off
   Enable/disable a given trace event or a group of events (using wildcards).
 
-The "-trace events=<file>" command line argument can be used to enable the
+The "--trace events=<file>" command line argument can be used to enable the
 events listed in <file> from the very beginning of the program. This file must
 contain one event name per line.
 
-If a line in the "-trace events=<file>" file begins with a '-', the trace event
+If a line in the "--trace events=<file>" file begins with a '-', the trace event
 will be disabled instead of enabled.  This is useful when a wildcard was used
 to enable an entire family of events but one noisy event needs to be disabled.
 
diff --git a/trace/control.c b/trace/control.c
index e40cfca..43fb786 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -253,7 +253,7 @@ void trace_init_file(const char *file)
 #ifdef CONFIG_TRACE_SIMPLE
     st_set_trace_file(file);
 #elif defined CONFIG_TRACE_LOG
-    /* If both the simple and the log backends are enabled, "-trace file"
+    /* If both the simple and the log backends are enabled, "--trace file"
      * only applies to the simple backend; use "-D" for the log backend.
      */
     if (file) {
@@ -261,7 +261,7 @@ void trace_init_file(const char *file)
     }
 #else
     if (file) {
-        fprintf(stderr, "error: -trace file=...: "
+        fprintf(stderr, "error: --trace file=...: "
                 "option not supported by the selected tracing backends\n");
         exit(1);
     }
diff --git a/trace/control.h b/trace/control.h
index eb65c8e..0716f90 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -193,7 +193,7 @@ void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
 /**
  * trace_init_backends:
  * @file:   Name of trace output file; may be NULL.
- *          Corresponds to commandline option "-trace file=...".
+ *          Corresponds to commandline option "--trace file=...".
  *
  * Initialize the tracing backend.
  *
@@ -204,7 +204,7 @@ bool trace_init_backends(void);
 /**
  * trace_init_file:
  * @file:   Name of trace output file; may be NULL.
- *          Corresponds to commandline option "-trace file=...".
+ *          Corresponds to commandline option "--trace file=...".
  *
  * Record the name of the output file for the tracing backend.
  * Exits if no selected backend does not support specifying the
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH v2] tracing: Use double-dash spelling for trace option
  2018-07-04  3:17 [Qemu-devel] [PATCH v2] tracing: Use double-dash spelling for trace option Yaowei Bai
@ 2018-07-10 14:17 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2018-07-10 14:17 UTC (permalink / raw)
  To: Yaowei Bai; +Cc: mjt, laurent, stefanha, qemu-trivial, armbru, qemu-devel, cota

[-- Attachment #1: Type: text/plain, Size: 827 bytes --]

On Wed, Jul 04, 2018 at 11:17:27AM +0800, Yaowei Bai wrote:
> The '-trace' and '--trace' spellings are only both supported in qemu
> binary, while for qemu-nbd or qemu-img only '--trace' spelling is
> supported. So for the consistency of trace option invocation, we
> should use double-dash spelling in our documentation.
> 
> This's also mentioned in
> https://wiki.qemu.org/BiteSizedTasks#Consistent_option_usage_in_documentation
> .
> 
> Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> ---
>  docs/devel/tracing.txt | 6 +++---
>  trace/control.c        | 4 ++--
>  trace/control.h        | 4 ++--
>  3 files changed, 7 insertions(+), 7 deletions(-)

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

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-10 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-04  3:17 [Qemu-devel] [PATCH v2] tracing: Use double-dash spelling for trace option Yaowei Bai
2018-07-10 14:17 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).