From patchwork Fri Jan 25 16:34:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 215811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7E8752C0092 for ; Sat, 26 Jan 2013 03:41:51 +1100 (EST) Received: from localhost ([::1]:46952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TymF3-0004H2-Iw for incoming@patchwork.ozlabs.org; Fri, 25 Jan 2013 11:35:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TymEL-0002n4-3W for qemu-devel@nongnu.org; Fri, 25 Jan 2013 11:34:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TymEE-0006hN-Gq for qemu-devel@nongnu.org; Fri, 25 Jan 2013 11:34:16 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:57632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TymEE-0006hH-5l for qemu-devel@nongnu.org; Fri, 25 Jan 2013 11:34:10 -0500 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 r0PGY8Kc032686; Fri, 25 Jan 2013 17:34:08 +0100 Received: from localhost (unknown [84.88.51.85]) by gw.ac.upc.edu (Postfix) with ESMTP id C3C676B01C4; Fri, 25 Jan 2013 17:34:07 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Fri, 25 Jan 2013 17:34:08 +0100 Message-Id: <20130125163408.12616.57606.stgit@fimbulvetr.bsc.es> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <20130125163344.12616.85545.stgit@fimbulvetr.bsc.es> References: <20130125163344.12616.85545.stgit@fimbulvetr.bsc.es> User-Agent: StGit/0.16 MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id r0PGY8Kc032686 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.83.33.10 Cc: Blue Swirl , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v10 4/7] trace: [monitor] Use new event control interface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 9cf419b..dda7cf2 100644 --- a/monitor.c +++ b/monitor.c @@ -735,9 +735,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); } }