From patchwork Tue Jul 6 20:13:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 58061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2B7B0B6EF2 for ; Wed, 7 Jul 2010 06:15:52 +1000 (EST) Received: from localhost ([127.0.0.1]:43100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWEYW-0006t5-OY for incoming@patchwork.ozlabs.org; Tue, 06 Jul 2010 16:15:48 -0400 Received: from [140.186.70.92] (port=51732 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWEXE-0006ri-Fr for qemu-devel@nongnu.org; Tue, 06 Jul 2010 16:14:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWEXD-0004DP-3V for qemu-devel@nongnu.org; Tue, 06 Jul 2010 16:14:28 -0400 Received: from mtagate6.uk.ibm.com ([194.196.100.166]:45563) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWEXC-0004D5-QQ for qemu-devel@nongnu.org; Tue, 06 Jul 2010 16:14:27 -0400 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate6.uk.ibm.com (8.13.1/8.13.1) with ESMTP id o66KEODX000984 for ; Tue, 6 Jul 2010 20:14:24 GMT Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o66KEH7f1630390 for ; Tue, 6 Jul 2010 21:14:24 +0100 Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o66KEHTl004607 for ; Tue, 6 Jul 2010 21:14:17 +0100 Received: from stefan-thinkpad.ibm.com (sig-9-146-153-238.uk.ibm.com [9.146.153.238]) by d06av01.portsmouth.uk.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o66KEFQ7004570; Tue, 6 Jul 2010 21:14:16 +0100 From: Stefan Hajnoczi To: Date: Tue, 6 Jul 2010 21:13:59 +0100 Message-Id: <1278447241-2709-1-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: sripathik@in.ibm.com, Stefan Hajnoczi , Prerna Saxena Subject: [Qemu-devel] [PATCH 1/3] trace: Document programmatically enabling/disabling trace events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The simple trace backend exports a function that can be used to programmatically enable/disable trace events at runtime. Signed-off-by: Stefan Hajnoczi --- This applies to the tracing branch at: http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/tracing-dev docs/tracing.txt | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/docs/tracing.txt b/docs/tracing.txt index ec44552..abbae6b 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -116,6 +116,17 @@ unless you have specific needs for more advanced backends. * trace-event NAME on|off Enable/disable a given trace event. +==== Enabling/disabling trace events programmatically ==== + +The change_trace_event_state() function can be used to enable or disable trace +events at runtime inside QEMU: + + #include "trace.h" + + change_trace_event_state("virtio_irq", true); /* enable */ + [...] + change_trace_event_state("virtio_irq", false); /* disable */ + ==== Analyzing trace files ==== The "simple" backend produces binary trace files that can be formatted with the