aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-01-07 16:55:26 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2016-02-03 09:19:09 +0000
commit10578a257d94fb59449d0b0e441990c45a036ccc (patch)
tree5fc5b4d0935e70c3c2c784bc7dec0694e12e0b23 /vl.c
parentf246b86672118e4f0d0782f4c240d3666aa36710 (diff)
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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 6370efee5f..58cc0507fe 100644
--- a/vl.c
+++ b/vl.c
@@ -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);