From patchwork Tue May 8 14:38:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [v4,4/7] trace: [monitor] Use new event control interface From: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 157738 Message-Id: <20120508143837.18271.22124.stgit@fimbulvetr.bsc.es> To: qemu-devel@nongnu.org Date: Tue, 8 May 2012 16:38:37 +0200 Signed-off-by: LluĂ­s Vilanova --- monitor.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 8946a10..86c2538 100644 --- a/monitor.c +++ b/monitor.c @@ -625,10 +625,19 @@ static void do_trace_event_set_state(Monitor *mon, const QDict *qdict) { const char *tp_name = qdict_get_str(qdict, "name"); bool new_state = qdict_get_bool(qdict, "option"); - int ret = trace_event_set_state(tp_name, new_state); - if (!ret) { - monitor_printf(mon, "unknown event name \"%s\"\n", tp_name); + if (trace_event_is_pattern(tp_name)) { + TraceEvent *ev = NULL; + while ((ev = trace_event_pattern(tp_name, ev)) != NULL) { + trace_event_set_state_dynamic(ev, new_state); + } + } else { + TraceEvent *ev = trace_event_name(tp_name); + if (ev == NULL) { + monitor_printf(mon, "unknown event name \"%s\"\n", tp_name); + } else { + trace_event_set_state_dynamic(ev, new_state); + } } }