trace: enable tracing in qemu-io/qemu-nbd/qemu-img
PATCH v6 1/7 doc: move text describing --trace to specific .texi file
In reply to Denis V. LunevThis text will be included to qemu-nbd/qemu-img mans in the next patches.
--- Makefile | 3 ++- qemu-option-trace.texi | 25 +++++++++++++++++++++++++ qemu-options.hx | 27 +-------------------------- 3 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 qemu-option-trace.texi
Makefile +2 -1
@@ -564,6 +564,7 @@ qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \ $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \ " GEN $@") +qemu.1: qemu-option-trace.texi qemu-img.1: qemu-img.texi qemu-img-cmds.texi $(call quiet-command, \
@@ -595,7 +596,7 @@ info: qemu-doc.info qemu-tech.info pdf: qemu-doc.pdf qemu-tech.pdf qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \ - qemu-img.texi qemu-nbd.texi qemu-options.texi \ + qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ qemu-monitor-info.texi
qemu-option-trace.texi new file +25 -0
@@ -0,0 +1,25 @@ +Specify tracing options. + +@table @option +@item [enable=]@var{pattern} +Immediately enable events matching @var{pattern}. +The file must contain one event name (as listed in the @file{trace-events} file) +per line; globbing patterns are accepted too. This option is only +available if QEMU has been compiled with the @var{simple}, @var{stderr} +or @var{ftrace} tracing backend. To specify multiple events or patterns, +specify the @option{-trace} option multiple times. + +Use @code{-trace help} to print a list of names of trace points. + +@item events=@var{file} +Immediately enable events listed in @var{file}. +The file must contain one event name (as listed in the @file{trace-events} file) +per line; globbing patterns are accepted too. This option is only +available if QEMU has been compiled with the @var{simple}, @var{stderr} or +@var{ftrace} tracing backend. + +@item file=@var{file} +Log output traces to @var{file}. +This option is only available if QEMU has been compiled with +the @var{simple} tracing backend. +@end table
qemu-options.hx +1 -26
@@ -3669,32 +3669,7 @@ HXCOMM This line is not accurate, as some sub-options are backend-specific but HXCOMM HX does not support conditional compilation of text. @item -trace [events=@var{file}][,file=@var{file}] @findex -trace - -Specify tracing options. - -@table @option -@item [enable=]@var{pattern} -Immediately enable events matching @var{pattern}. -The file must contain one event name (as listed in the @file{trace-events} file) -per line; globbing patterns are accepted too. This option is only -available if QEMU has been compiled with the @var{simple}, @var{stderr} -or @var{ftrace} tracing backend. To specify multiple events or patterns, -specify the @option{-trace} option multiple times. - -Use @code{-trace help} to print a list of names of trace points. - -@item events=@var{file} -Immediately enable events listed in @var{file}. -The file must contain one event name (as listed in the @file{trace-events} file) -per line; globbing patterns are accepted too. This option is only -available if QEMU has been compiled with the @var{simple}, @var{stderr} or -@var{ftrace} tracing backend. - -@item file=@var{file} -Log output traces to @var{file}. -This option is only available if QEMU has been compiled with -the @var{simple} tracing backend. -@end table +@include qemu-option-trace.texi ETEXI HXCOMM Internal use
Signature · 1 line
2.1.4
v6 cover trace: enable tracing in qemu-io/qemu-nbd/qemu-img
Changes from v5:
- added missed hunk into patch #7
Changes from v4:
- synced help descriprion for --trace with man for qemu.1/qemu-img.1/qemu-nbd.8
- moved @findex from qemu-option-trace.texi
Changes from v3:
- fixed difference in help/man for qemu-img/qemu-nbd
- created separate .texi to contain trace description, proper dependency is added to makefile
- added --version/--help description to qemu-img
- fixed crash induced by new option processing scheme in qemu-img which has happened when invoked as './qemu-img -K'
Changes from v2:
- tweaked man-pages of qemu-nbd/qemu-img
- added support for qemu-img (patches 4-5 as suggested)
Changes from v1:
- fixed nits found by Eric
Denis V. Lunev (7):
doc: move text describing --trace to specific .texi file
doc: sync help descriprion for --trace with man for qemu.1
trace: move qemu_trace_opts to trace/control.c
trace: enable tracing in qemu-io
trace: enable tracing in qemu-nbd
qemu-img: move common options parsing before commands processing
trace: enable tracing in qemu-img
Makefile | 7 ++++--- qemu-img.c | 55 ++++++++++++++++++++++++++++++++++++++------------ qemu-img.texi | 13 +++++++++++- qemu-io.c | 17 ++++++++++++---- qemu-nbd.c | 18 ++++++++++++++++- qemu-nbd.texi | 3 +++ qemu-option-trace.texi | 25 +++++++++++++++++++++++ qemu-options.hx | 29 ++------------------------ trace/control.c | 44 +++++++++++++++++++++++++++++++++++++++- trace/control.h | 24 ++++++++++++---------- vl.c | 37 +-------------------------------- 11 files changed, 175 insertions(+), 97 deletions(-) create mode 100644 qemu-option-trace.texi
Signature · 1 line
2.1.4
PATCH v6 2/7 doc: sync help descriprion for --trace with man for qemu.1
--- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +1 -1
@@ -3667,7 +3667,7 @@ DEF("trace", HAS_ARG, QEMU_OPTION_trace, STEXI HXCOMM This line is not accurate, as some sub-options are backend-specific but HXCOMM HX does not support conditional compilation of text. -@item -trace [events=@var{file}][,file=@var{file}] +@item -trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}] @findex -trace @include qemu-option-trace.texi ETEXI
Signature · 1 line
2.1.4
PATCH v6 3/7 trace: move qemu_trace_opts to trace/control.c
In reply to Denis V. LunevThe patch also creates trace_opt_parse() helper in trace/control.c to reuse this code in next patches for qemu-nbd and qemu-io.
The patch also makes trace_init_events() static, as this call is not used outside the module anymore.
--- trace/control.c | 44 +++++++++++++++++++++++++++++++++++++++++++- trace/control.h | 24 +++++++++++++----------- vl.c | 37 +------------------------------------ 3 files changed, 57 insertions(+), 48 deletions(-)
trace/control.c +43 -1
@@ -20,11 +20,33 @@#include "qemu/log.h" #endif #include "qemu/error-report.h" +#include "qemu/config-file.h" #include "monitor/monitor.h" int trace_events_enabled_count;bool trace_events_dstate[TRACE_EVENT_COUNT ]; +QemuOptsList qemu_trace_opts = { + .name ="trace" , + .implied_opt_name ="enable" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_trace_opts.head), + .desc = { + { + .name ="enable" , + .type =QEMU_OPT_STRING , + }, + { + .name ="events" , + .type =QEMU_OPT_STRING , + },{ + .name ="file" , + .type =QEMU_OPT_STRING , + }, + {/* end of list */ } + }, +}; + +TraceEvent *trace_event_name (const char *name) {assert (name !=NULL );
@@ -141,7 +163,7 @@ void trace_enable_events(const char *line_buf) } } -void trace_init_events (const char *fname) +static void trace_init_events (const char *fname) {Location loc;FILE *fp;
@@ -216,3 +238,23 @@ bool trace_init_backends(void)return true; } + +char *trace_opt_parse (const char *optarg,char *trace_file) +{ +QemuOpts *opts =qemu_opts_parse_noisily (qemu_find_opts ("trace" ), + optarg, true); +if (!opts) { +exit (1 ); + } +if (qemu_opt_get (opts,"enable" )) { +trace_enable_events (qemu_opt_get (opts,"enable" )); + } +trace_init_events (qemu_opt_get (opts,"events" )); +if (trace_file) { +g_free (trace_file); + } + trace_file =g_strdup (qemu_opt_get (opts,"file" )); +qemu_opts_del (opts); + +return trace_file; +}
trace/control.h +13 -11
@@ -160,17 +160,6 @@ static void trace_event_set_state_dynamic(TraceEvent *ev, bool state);bool trace_init_backends (void );/** -* trace_init_events: -* @events: Name of file with events to be enabled at startup; may be NULL. -* Corresponds to commandline option "-trace events=...". -* -* Read the list of enabled tracing events. -* -* Returns: Whether the backends could be successfully initialized. -*/ -void trace_init_events (const char *file); - -/** * trace_init_file: * @file: Name of trace output file; may be NULL. * Corresponds to commandline option "-trace file=...".
@@ -197,6 +186,19 @@ void trace_list_events(void);*/ void trace_enable_events (const char *line_buf); +/** +* Definition of QEMU options describing trace subsystem configuration +*/ +extern QemuOptsList qemu_trace_opts; + +/** +* trace_opt_parse: +* @optarg: A string argument of --trace command line argument +* @trace_file: current filename to save traces to +* +* Initialize tracing subsystem. +*/ +char *trace_opt_parse (const char *optarg,char *trace_file);#include "trace/control-internal.h"
vl.c +1 -36
@@ -262,26 +262,6 @@ static QemuOptsList qemu_sandbox_opts = { }, }; -static QemuOptsList qemu_trace_opts = { - .name ="trace" , - .implied_opt_name ="enable" , - .head =QTAILQ_HEAD_INITIALIZER (qemu_trace_opts.head), - .desc = { - { - .name ="enable" , - .type =QEMU_OPT_STRING , - }, - { - .name ="events" , - .type =QEMU_OPT_STRING , - },{ - .name ="file" , - .type =QEMU_OPT_STRING , - }, - {/* end of list */ } - }, -}; -static QemuOptsList qemu_option_rom_opts = { .name ="option-rom" , .implied_opt_name ="romfile" ,
@@ -3872,23 +3852,8 @@ int main(int argc, char **argv, char **envp) xen_mode =XEN_ATTACH ;break ;case QEMU_OPTION_trace: - { - opts =qemu_opts_parse_noisily (qemu_find_opts ("trace" ), - optarg, true); -if (!opts) { -exit (1 ); - } -if (qemu_opt_get (opts,"enable" )) { -trace_enable_events (qemu_opt_get (opts,"enable" )); - } -trace_init_events (qemu_opt_get (opts,"events" )); -if (trace_file) { -g_free (trace_file); - } - trace_file =g_strdup (qemu_opt_get (opts,"file" )); -qemu_opts_del (opts); + trace_file =trace_opt_parse (optarg, trace_file);break ; - }case QEMU_OPTION_readconfig: {int ret =qemu_read_config_file (optarg);
Signature · 1 line
2.1.4
PATCH v6 6/7 qemu-img: move common options parsing before commands processing
In reply to Denis V. LunevThis is necessary to enable creation of common qemu-img options which will be specified before command.
The patch also enables '-V' alias to '--version' (exactly like in other block utilities) and documents this change.
--- qemu-img.c | 39 ++++++++++++++++++++++++++------------- qemu-img.texi | 10 +++++++++- 2 files changed, 35 insertions(+), 14 deletions(-)
qemu-img.c +26 -13
@@ -91,9 +91,12 @@ static void QEMU_NORETURN help(void) {const char *help_msg =QEMU_IMG_VERSION -"usage: qemu-img command [command options]\n" +"usage: qemu-img [standard options] command [command options]\n" "QEMU disk image utility\n" "\n" +" '-h', '--help' display this help and exit\n" +" '-V', '--version' output version information and exit\n" +"\n" "Command syntax:\n"#define DEF (option, callback, arg_string) \ " " arg_string "\n"
@@ -3806,7 +3809,7 @@ int main(int argc, char **argv)int c;static const struct option long_options[] = { {"help" , no_argument,0 ,'h' }, - {"version" , no_argument,0 ,'v' }, + {"version" , no_argument,0 ,'V' }, {0 ,0 ,0 ,0 } };
@@ -3829,27 +3832,37 @@ int main(int argc, char **argv)if (argc <2 ) {error_exit ("Not enough arguments" ); } - cmdname = argv[1 ];qemu_add_opts (&qemu_object_opts);qemu_add_opts (&qemu_source_opts); -/* find the command */ -for (cmd = img_cmds; cmd->name !=NULL ; cmd++) { -if (!strcmp (cmdname, cmd->name)) { -return cmd->handler (argc -1 , argv +1 ); +while ((c =getopt_long (argc, argv,"+hV" , long_options,NULL )) !=-1 ) { +switch (c) { +case 'h' : +help (); +return 0 ; +case 'V' : +printf (QEMU_IMG_VERSION ); +return 0 ; } } - c =getopt_long (argc, argv,"h" , long_options,NULL ); + cmdname = argv[optind]; -if (c =='h' ) { -help (); - } -if (c =='v' ) { -printf (QEMU_IMG_VERSION ); +/* reset getopt_long scanning */ + argc -= optind; +if (argc <1 ) {return 0 ; } + argv += optind; + optind =1 ; + +/* find the command */ +for (cmd = img_cmds; cmd->name !=NULL ; cmd++) { +if (!strcmp (cmdname, cmd->name)) { +return cmd->handler (argc, argv); + } + }/* not found */ error_exit ("Command not found: %s" , cmdname);
qemu-img.texi +9 -1
@@ -1,6 +1,6 @@ @example @c man begin SYNOPSIS -@command{qemu-img} @var{command} [@var{command} @var{options}] +@command{qemu-img} [@var{standard} @var{options}] @var{command} [@var{command} @var{options}] @c man end @end example
@@ -16,6 +16,14 @@ inconsistent state. @c man begin OPTIONS +Standard options: +@table @option +@item -h, --help +Display this help and exit +@item -V, --version +Display version information and exit +@end table + The following commands are supported: @include qemu-img-cmds.texi
Signature · 1 line
2.1.4
PATCH v6 4/7 trace: enable tracing in qemu-io
In reply to Denis V. LunevMoving trace_init_backends() into trace_opt_parse() is not possible. This should be called after daemonize() in vl.c.
--- qemu-io.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
qemu-io.c +13 -4
@@ -18,6 +18,7 @@#include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/readline.h" +#include "qemu/log.h" #include "qapi/qmp/qstring.h" #include "qom/object_interfaces.h" #include "sysemu/block-backend.h"
@@ -253,7 +254,9 @@ static void usage(const char *name)" -k, --native-aio use kernel AIO implementation (on Linux only)\n" " -t, --cache=MODE use the given cache mode for the image\n" " -d, --discard=MODE use the given discard mode for the image\n" -" -T, --trace FILE enable trace events listed in the given file\n" +" -T, --trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n" +" specify tracing options\n" +" see qemu-img(1) man page for full description\n" " -h, --help display this help and exit\n" " -V, --version output version information and exit\n" "\n"
@@ -458,6 +461,7 @@ int main(int argc, char **argv)Error *local_error =NULL ;QDict *opts =NULL ;const char *format =NULL ; +char *trace_file =NULL ;#ifdef CONFIG_POSIX signal (SIGPIPE ,SIG_IGN );
@@ -470,6 +474,7 @@ int main(int argc, char **argv)module_call_init (MODULE_INIT_QOM );qemu_add_opts (&qemu_object_opts); +qemu_add_opts (&qemu_trace_opts);bdrv_init ();while ((c =getopt_long (argc, argv, sopt, lopt, &opt_index)) !=-1 ) {
@@ -509,9 +514,7 @@ int main(int argc, char **argv) }break ;case 'T' : -if (!trace_init_backends ()) { -exit (1 );/* error message will have been printed */ - } + trace_file =trace_opt_parse (optarg, trace_file);break ;case 'V' :printf ("%s version %s\n" , progname,QEMU_VERSION );
@@ -557,6 +560,12 @@ int main(int argc, char **argv)exit (1 ); } +if (!trace_init_backends ()) { +exit (1 ); + } +trace_init_file (trace_file); +qemu_set_log (LOG_TRACE ); +/* initialize commands */ qemuio_add_command (&quit_cmd);qemuio_add_command (&open_cmd);
Signature · 1 line
2.1.4
PATCH v6 5/7 trace: enable tracing in qemu-nbd
In reply to Denis V. LunevPlease note, trace_init_backends() must be called in the final process, i.e. after daemonization. This is necessary to keep tracing thread in the proper process.
--- Makefile | 2 +- qemu-nbd.c | 18 +++++++++++++++++- qemu-nbd.texi | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-)
Makefile +1 -1
@@ -578,7 +578,7 @@ fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \ " GEN $@") -qemu-nbd.8: qemu-nbd.texi +qemu-nbd.8: qemu-nbd.texi qemu-option-trace.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \ $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
qemu-nbd.c +17 -1
@@ -27,12 +27,14 @@#include "qemu/error-report.h" #include "qemu/config-file.h" #include "qemu/bswap.h" +#include "qemu/log.h" #include "block/snapshot.h" #include "qapi/util.h" #include "qapi/qmp/qstring.h" #include "qom/object_interfaces.h" #include "io/channel-socket.h" #include "crypto/init.h" +#include "trace/control.h" #include <getopt.h> #include <libgen.h>
@@ -88,6 +90,8 @@ static void usage(const char *name)"General purpose options:\n" " --object type,id=ID,... define an object such as 'secret' for providing\n" " passwords and/or encryption keys\n" +" -T, --trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n" +" specify tracing options\n" #ifdef __linux__"Kernel NBD client support:\n" " -c, --connect=DEV connect FILE to the local NBD device DEV\n"
@@ -470,7 +474,7 @@ int main(int argc, char **argv)off_t fd_size;QemuOpts *sn_opts =NULL ;const char *sn_id_or_name =NULL ; -const char *sopt ="hVb:o:p:rsnP:c:dvk:e:f:tl:x:" ; +const char *sopt ="hVb:o:p:rsnP:c:dvk:e:f:tl:x:T:" ;struct option lopt[] = { {"help" , no_argument,NULL ,'h' }, {"version" , no_argument,NULL ,'V' },
@@ -498,6 +502,7 @@ int main(int argc, char **argv) { "export-name", required_argument, NULL, 'x' }, { "tls-creds", required_argument, NULL, QEMU_NBD_OPT_TLSCREDS }, { "image-opts", no_argument, NULL, QEMU_NBD_OPT_IMAGE_OPTS }, + { "trace", required_argument, NULL, 'T' }, { NULL, 0, NULL, 0 } };int ch;
@@ -518,6 +523,7 @@ int main(int argc, char **argv)const char *tlscredsid =NULL ;bool imageOpts = false;bool writethrough = true; +char *trace_file =NULL ;/* The client thread uses SIGTERM to interrupt the server. A signal * handler ensures that "qemu-nbd -v -c" exits with a nice status code.
@@ -531,6 +537,7 @@ int main(int argc, char **argv)module_call_init (MODULE_INIT_QOM );qemu_add_opts (&qemu_object_opts); +qemu_add_opts (&qemu_trace_opts);qemu_init_exec_dir (argv[0 ]);while ((ch =getopt_long (argc, argv, sopt, lopt, &opt_ind)) !=-1 ) {
@@ -703,6 +710,9 @@ int main(int argc, char **argv)case QEMU_NBD_OPT_IMAGE_OPTS : imageOpts = true;break ; +case 'T' : + trace_file =trace_opt_parse (optarg, trace_file); +break ; } }
@@ -718,6 +728,12 @@ int main(int argc, char **argv)exit (EXIT_FAILURE ); } +if (!trace_init_backends ()) { +exit (1 ); + } +trace_init_file (trace_file); +qemu_set_log (LOG_TRACE ); +if (tlscredsid) {if (sockpath) {error_report ("TLS is only supported with IPv4/IPv6" );
qemu-nbd.texi +3 -0
@@ -92,6 +92,9 @@ Display extra debugging information Display this help and exit @item -V, --version Display version information and exit +@item -T, --trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}] +@findex --trace +@include qemu-option-trace.texi @end table @c man end
Signature · 1 line
2.1.4
PATCH v6 7/7 trace: enable tracing in qemu-img
In reply to Denis V. LunevThe command will work this way:
qemu-img --trace qcow2* create -f qcow2 1.img 64G
Suggested by: Daniel P. Berrange <[email protected]>
CC: Eric Blake <[email protected]>
CC: Paolo Bonzini <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
CC: Kevin Wolf <[email protected]>
--- Makefile | 2 +- qemu-img.c | 18 +++++++++++++++++- qemu-img.texi | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-)
Makefile +1 -1
@@ -566,7 +566,7 @@ qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi " GEN $@") qemu.1: qemu-option-trace.texi -qemu-img.1: qemu-img.texi qemu-img-cmds.texi +qemu-img.1: qemu-img.texi qemu-option-trace.texi qemu-img-cmds.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \ $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
qemu-img.c +17 -1
@@ -32,6 +32,7 @@#include "qemu/config-file.h" #include "qemu/option.h" #include "qemu/error-report.h" +#include "qemu/log.h" #include "qom/object_interfaces.h" #include "sysemu/sysemu.h" #include "sysemu/block-backend.h"
@@ -39,6 +40,7 @@#include "block/blockjob.h" #include "block/qapi.h" #include "crypto/init.h" +#include "trace/control.h" #include <getopt.h> #define QEMU_IMG_VERSION "qemu-img version " QEMU_VERSION QEMU_PKGVERSION \
@@ -96,6 +98,8 @@ static void QEMU_NORETURN help(void)"\n" " '-h', '--help' display this help and exit\n" " '-V', '--version' output version information and exit\n" +" '-T', '--trace' [[enable=]<pattern>][,events=<file>][,file=<file>]\n" +" specify tracing options\n" "\n" "Command syntax:\n" #define DEF(option, callback, arg_string) \
@@ -3806,10 +3810,12 @@ int main(int argc, char **argv)const img_cmd_t *cmd;const char *cmdname;Error *local_error =NULL ; +char *trace_file =NULL ;int c;static const struct option long_options[] = { {"help" , no_argument,0 ,'h' }, {"version" , no_argument,0 ,'V' }, + {"trace" , required_argument,NULL ,'T' }, {0 ,0 ,0 ,0 } };
@@ -3835,8 +3841,9 @@ int main(int argc, char **argv)qemu_add_opts (&qemu_object_opts);qemu_add_opts (&qemu_source_opts); +qemu_add_opts (&qemu_trace_opts); -while ((c =getopt_long (argc, argv,"+hV" , long_options,NULL )) !=-1 ) { +while ((c =getopt_long (argc, argv,"+hVT:" , long_options,NULL )) !=-1 ) {switch (c) {case 'h' :help ();
@@ -3844,6 +3851,9 @@ int main(int argc, char **argv)case 'V' :printf (QEMU_IMG_VERSION );return 0 ; +case 'T' : + trace_file =trace_opt_parse (optarg, trace_file); +break ; } }
@@ -3857,6 +3867,12 @@ int main(int argc, char **argv) argv += optind; optind =1 ; +if (!trace_init_backends ()) { +exit (1 ); + } +trace_init_file (trace_file); +qemu_set_log (LOG_TRACE ); +/* find the command */ for (cmd = img_cmds; cmd->name !=NULL ; cmd++) {if (!strcmp (cmdname, cmd->name)) {
qemu-img.texi +3 -0
@@ -22,6 +22,9 @@ Standard options: Display this help and exit @item -V, --version Display version information and exit +@item -T, --trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}] +@findex --trace +@include qemu-option-trace.texi @end table The following commands are supported:
Signature · 1 line
2.1.4
Re: [Qemu-devel] [PATCH 1/7] doc: move text describing --trace to specific .texi file
In reply to Denis V. LunevQuoted 16 lines · Denis V. Lunev
This text will be included to qemu-nbd/qemu-img mans in the next patches.
Signed-off-by Denis V. Lunev <[email protected]>CC Eric Blake <[email protected]>CC Paolo Bonzini <[email protected]>CC Stefan Hajnoczi <[email protected]>CC Kevin Wolf <[email protected]>--- Makefile | 3 ++- qemu-option-trace.texi | 25 +++++++++++++++++++++++++ qemu-options.hx | 27 +-------------------------- 3 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 qemu-option-trace.texi+++ b/qemu-options.hx
qemu-options.hx HXCOMM This line is not accurate, as some sub-options are backend-specific but · line 3671
Quoted 3 lines
qemu-options.hx +0
-0@@ -3669,32 +3669,7 @@ HXCOMM This line is not accurate, as some sub-options are backend-specific but HXCOMM HX does not support conditional compilation of text. @item -trace [events=@var{file}][,file=@var{file}] @findex -trace
As long as you are touching here, change the -trace line to match --help output:
-trace [[enable=]<pattern>][,events=<file>][,file=<file>]
With that change:
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH 2/7] doc: sync help descriprion for --trace with man for qemu.1
In reply to Denis V. LunevQuoted 8 lines · Denis V. Lunev
Signed-off-by Denis V. Lunev <[email protected]>CC Eric Blake <[email protected]>CC Paolo Bonzini <[email protected]>CC Stefan Hajnoczi <[email protected]>CC Kevin Wolf <[email protected]>--- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Ah, this was the change I requested on 1/7. I might have squashed the two, or put this one first. But it's obviously correct.
Quoted 15 lines
qemu-options.hx +1
-1@@ -3667,7 +3667,7 @@ DEF("trace", HAS_ARG, QEMU_OPTION_trace, STEXI HXCOMM This line is not accurate, as some sub-options are backend-specific but HXCOMM HX does not support conditional compilation of text. -@item -trace [events=@var{file}][,file=@var{file}] +@item -trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}] @findex -trace @include qemu-option-trace.texi ETEXI
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH 1/7] doc: move text describing --trace to specific .texi file
In reply to Eric BlakeQuoted 24 lines · Eric Blake
Quoted 16 lines · Denis V. Lunev
This text will be included to qemu-nbd/qemu-img mans in the next patches.
Signed-off-by Denis V. Lunev <[email protected]>CC Eric Blake <[email protected]>CC Paolo Bonzini <[email protected]>CC Stefan Hajnoczi <[email protected]>CC Kevin Wolf <[email protected]>--- Makefile | 3 ++- qemu-option-trace.texi | 25 +++++++++++++++++++++++++ qemu-options.hx | 27 +-------------------------- 3 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 qemu-option-trace.texi+++ b/qemu-options.hx
qemu-options.hx HXCOMM This line is not accurate, as some sub-options are backend-specific but · line 3671
Quoted 3 lines
qemu-options.hx +0
-0@@ -3669,32 +3669,7 @@ HXCOMM This line is not accurate, as some sub-options are backend-specific but HXCOMM HX does not support conditional compilation of text. @item -trace [events=@var{file}][,file=@var{file}] @findex -traceAs long as you are touching here, change the -trace line to match --help output:
Quoted 1 line
-trace [[enable=]<pattern>][,events=<file>][,file=<file>]
Nevermind - I see you do that in 2/7.
Quoted 5 lines
With that change:
Reviewed-by Eric Blake <[email protected]>
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH 5/7] trace: enable tracing in qemu-nbd
In reply to Denis V. LunevQuoted 9 lines · Denis V. Lunev
Please note,
trace_init_backends()must be called in the final process, i.e. after daemonization. This is necessary to keep tracing thread in the proper process.Signed-off-by Denis V. Lunev <[email protected]>CC Eric Blake <[email protected]>CC Paolo Bonzini <[email protected]>CC Stefan Hajnoczi <[email protected]>CC Kevin Wolf <[email protected]>
Quoted 5 lines
--- Makefile | 2 +- qemu-nbd.c | 18 +++++++++++++++++- qemu-nbd.texi | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-)
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH 7/7] trace: enable tracing in qemu-img
In reply to Denis V. LunevQuoted 9 lines · Denis V. Lunev
The command will work this way:
qemu-img --trace qcow2* create -f qcow2 1.img 64GSigned-off-by Denis V. Lunev <[email protected]>Suggested by: Daniel P. Berrange <[email protected]>
CC: Eric Blake <[email protected]>
CC: Paolo Bonzini <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
CC: Kevin Wolf <[email protected]>
Quoted 6 lines
--- Makefile | 2 +- qemu-img.c | 18 +++++++++++++++++- qemu-img.texi | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-)
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org