diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-01-07 16:55:26 +0300 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:30:23 -0600 |
commit | 344d947316c04a7c6842b601c749cd6ed59e6658 (patch) | |
tree | 79c0c64d7c5525395bc878f8aeb03b6055fb866f /vl.c | |
parent | 28d4d1090857d1c20289f920b44d5fd2259c36f9 (diff) | |
download | hqemu-344d947316c04a7c6842b601c749cd6ed59e6658.zip hqemu-344d947316c04a7c6842b601c749cd6ed59e6658.tar.gz |
trace: add "-trace enable=..."
Allow enabling events without going through a file, for example:
qemu-system-x86_64 -trace bdrv_aio_writev -trace bdrv_aio_readv
or with globbing too:
qemu-system-x86_64 -trace 'bdrv_aio_*'
if an appropriate backend is enabled (simple, stderr, ftrace).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1452174932-28657-6-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -270,10 +270,14 @@ static QemuOptsList qemu_sandbox_opts = { static QemuOptsList qemu_trace_opts = { .name = "trace", - .implied_opt_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, },{ @@ -3900,10 +3904,13 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_trace: { opts = qemu_opts_parse_noisily(qemu_find_opts("trace"), - optarg, false); + 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); |