Received: from eggs.gnu.org ([208.118.235.92]:48140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlYr-0007Xt-FP for qemu-devel@nongnu.org; Tue, 08 May 2012 10:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRlYm-0001PD-99 for qemu-devel@nongnu.org; Tue, 08 May 2012 10:38:45 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:34198 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlYl-0001Nn-Ub for qemu-devel@nongnu.org; Tue, 08 May 2012 10:38:40 -0400 Received: from gw.ac.upc.edu (gw.ac.upc.es [147.83.30.3]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id q48EcbBE029859 for ; Tue, 8 May 2012 16:38:37 +0200 Received: from localhost (unknown [84.88.51.85]) by gw.ac.upc.edu (Postfix) with ESMTP id BC5B46B006A for ; Tue, 8 May 2012 16:38:37 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 8 May 2012 16:38:37 +0200 Message-Id: <20120508143837.18271.22124.stgit@fimbulvetr.bsc.es> In-Reply-To: <20120508143813.18271.15731.stgit@fimbulvetr.bsc.es> References: <20120508143813.18271.15731.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v4 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 Signed-off-by: Llu=C3=ADs 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 =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) { - monitor_printf(mon, "unknown event name \"%s\"\n", tp_name); + if (trace_event_is_pattern(tp_name)) { + TraceEvent *ev =3D NULL; + while ((ev =3D trace_event_pattern(tp_name, ev)) !=3D NULL) { + trace_event_set_state_dynamic(ev, new_state); + } + } else { + TraceEvent *ev =3D trace_event_name(tp_name); + if (ev =3D=3D NULL) { + monitor_printf(mon, "unknown event name \"%s\"\n", tp_name); + } else { + trace_event_set_state_dynamic(ev, new_state); + } } } =20