From patchwork Mon Aug 9 14:03:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 61281 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 802A1B70D8 for ; Tue, 10 Aug 2010 00:09:40 +1000 (EST) Received: from localhost ([127.0.0.1]:59026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiSyr-0002MI-6R for incoming@patchwork.ozlabs.org; Mon, 09 Aug 2010 10:05:33 -0400 Received: from [140.186.70.92] (port=47694 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiSx0-0002Hn-VM for qemu-devel@nongnu.org; Mon, 09 Aug 2010 10:03:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiSwz-0004NN-3P for qemu-devel@nongnu.org; Mon, 09 Aug 2010 10:03:38 -0400 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:46707) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiSwy-0004Mq-Rv for qemu-devel@nongnu.org; Mon, 09 Aug 2010 10:03:37 -0400 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id o79E3Ylk016782 for ; Mon, 9 Aug 2010 14:03:34 GMT Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o79E3YrH843892 for ; Mon, 9 Aug 2010 15:03:34 +0100 Received: from d06av04.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o79E3YOe009922 for ; Mon, 9 Aug 2010 15:03:34 +0100 Received: from stefan-thinkpad.manchester-maybrook.uk.ibm.com (dyn-9-174-219-22.manchester-maybrook.uk.ibm.com [9.174.219.22]) by d06av04.portsmouth.uk.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o79E3X5v009912; Mon, 9 Aug 2010 15:03:33 +0100 From: Stefan Hajnoczi To: Date: Mon, 9 Aug 2010 15:03:28 +0100 Message-Id: <1281362608-10106-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: Stefan Hajnoczi , Prerna Saxena Subject: [Qemu-devel] [PATCH] trace: Documentation update 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 Signed-off-by: Stefan Hajnoczi --- docs/tracing.txt | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/tracing.txt b/docs/tracing.txt index abbae6b..fe3c6ac 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -18,7 +18,7 @@ for debugging, profiling, and observing execution. 3. Pretty-print the binary trace file: - ./simpletrace.py trace-events /tmp/trace.log + ./simpletrace.py trace-events /tmp/trace-* == Trace events == @@ -70,11 +70,11 @@ trace events. == Trace backends == -The tracetool script not only automates tedious trace event code generation, -it also keeps the trace event declarations independent of the trace backend. -The trace events are not tightly coupled to a specific trace backend, such as -LTTng or SystemTap. Support for trace backends can be added by extending the -tracetool script. +The tracetool script automates tedious trace event code generation and also +keeps the trace event declarations independent of the trace backend. The trace +events are not tightly coupled to a specific trace backend, such as LTTng or +SystemTap. Support for trace backends can be added by extending the tracetool +script. The trace backend is chosen at configure time and only one trace backend can be built into the binary: @@ -116,16 +116,19 @@ unless you have specific needs for more advanced backends. * trace-event NAME on|off Enable/disable a given trace event. +* trace-file on|off|flush|set + Enable/disable/flush the trace file or set the trace file name. + ==== Enabling/disabling trace events programmatically ==== -The change_trace_event_state() function can be used to enable or disable trace +The st_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 */ + st_change_trace_event_state("virtio_irq", true); /* enable */ [...] - change_trace_event_state("virtio_irq", false); /* disable */ + st_change_trace_event_state("virtio_irq", false); /* disable */ ==== Analyzing trace files ====