From patchwork Fri Feb 3 21:20:01 2012 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: 139473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 60372104792 for ; Sat, 4 Feb 2012 08:20:32 +1100 (EST) Received: from localhost ([::1]:45700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtQYT-0000Mt-5F for incoming@patchwork.ozlabs.org; Fri, 03 Feb 2012 16:20:25 -0500 Received: from eggs.gnu.org ([140.186.70.92]:38785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtQYI-0000Dq-D5 for qemu-devel@nongnu.org; Fri, 03 Feb 2012 16:20:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtQYH-0000TY-2j for qemu-devel@nongnu.org; Fri, 03 Feb 2012 16:20:14 -0500 Received: from gw.ac.upc.edu ([147.83.30.3]:52812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtQYG-0000TQ-T9 for qemu-devel@nongnu.org; Fri, 03 Feb 2012 16:20:13 -0500 Received: from localhost (unknown [84.88.53.92]) by gw.ac.upc.edu (Postfix) with ESMTP id 8F7DC2D000D; Fri, 3 Feb 2012 22:20:11 +0100 (CET) To: qemu-devel@nongnu.org From: =?utf-8?b?TGx1w61z?= Vilanova Date: Fri, 03 Feb 2012 22:20:01 +0100 Message-ID: <20120203212001.339.83795.stgit@ginnungagap.bsc.es> In-Reply-To: <20120203211915.339.99432.stgit@ginnungagap.bsc.es> References: <20120203211915.339.99432.stgit@ginnungagap.bsc.es> User-Agent: StGit/0.15 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 147.83.30.3 Cc: blauwirbel@gmail.com, stefanha@gmail.com Subject: [Qemu-devel] [PATCH 3/6] 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 | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 5e099bd..010f659 100644 --- a/monitor.c +++ b/monitor.c @@ -617,10 +617,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); + } } }