From patchwork Tue Mar 5 13:47:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [v12,4/7] trace: [monitor] Use new event control interface From: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 225038 Message-Id: <20130305134743.11421.80281.stgit@fimbulvetr.bsc.es> To: qemu-devel@nongnu.org Cc: Blue Swirl , Stefan Hajnoczi Date: Tue, 5 Mar 2013 14:47:43 +0100 Signed-off-by: LluĂ­s Vilanova --- monitor.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 32a6e74..e287c06 100644 --- a/monitor.c +++ b/monitor.c @@ -740,9 +740,18 @@ 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) { + bool found = false; + TraceEvent *ev = NULL; + while ((ev = trace_event_pattern(tp_name, ev)) != NULL) { + found = true; + if (!trace_event_get_state_static(ev)) { + monitor_printf(mon, "event \"%s\" is not traceable\n", tp_name); + } else { + trace_event_set_state_dynamic(ev, new_state); + } + } + if (!trace_event_is_pattern(tp_name) && !found) { monitor_printf(mon, "unknown event name \"%s\"\n", tp_name); } }