Received: from eggs.gnu.org ([208.118.235.92]:44539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCsDd-0004Ry-B6 for qemu-devel@nongnu.org; Tue, 05 Mar 2013 08:47:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCsDZ-0004iR-UZ for qemu-devel@nongnu.org; Tue, 05 Mar 2013 08:47:49 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:45149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCsDZ-0004i2-I8 for qemu-devel@nongnu.org; Tue, 05 Mar 2013 08:47:45 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 5 Mar 2013 14:47:43 +0100 Message-Id: <20130305134743.11421.80281.stgit@fimbulvetr.bsc.es> In-Reply-To: <20130305134720.11421.39327.stgit@fimbulvetr.bsc.es> References: <20130305134720.11421.39327.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v12 4/7] trace: [monitor] Use new event control interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Stefan Hajnoczi Signed-off-by: Llu=C3=ADs 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, c= onst QDict *qdict) { const char *tp_name =3D qdict_get_str(qdict, "name"); bool new_state =3D qdict_get_bool(qdict, "option"); - int ret =3D trace_event_set_state(tp_name, new_state); =20 - if (!ret) { + bool found =3D false; + TraceEvent *ev =3D NULL; + while ((ev =3D trace_event_pattern(tp_name, ev)) !=3D NULL) { + found =3D true; + if (!trace_event_get_state_static(ev)) { + monitor_printf(mon, "event \"%s\" is not traceable\n", tp_na= me); + } 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); } }