Skip to content

Commit

Permalink
tracing: Use double-dash spelling for trace option
Browse files Browse the repository at this point in the history
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>
Message-id: 1530674247-31200-1-git-send-email-baiyaowei@cmss.chinamobile.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
Yaowei Bai authored and stefanhaRH committed Jul 19, 2018
1 parent ea6abff commit db817b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/devel/tracing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions trace/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@ 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) {
qemu_set_log_filename(file, &error_fatal);
}
#else
if (file) {
fprintf(stderr, "error: -trace file=...: "
fprintf(stderr, "error: --trace file=...: "
"option not supported by the selected tracing backends\n");
exit(1);
}
Expand Down
4 changes: 2 additions & 2 deletions trace/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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
Expand Down

0 comments on commit db817b8

Please sign in to comment.