From patchwork Wed Oct 12 17:14:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wu X-Patchwork-Id: 119260 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 63762B6F77 for ; Thu, 13 Oct 2011 04:29:36 +1100 (EST) Received: from localhost ([::1]:55459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE2Pa-00006H-80 for incoming@patchwork.ozlabs.org; Wed, 12 Oct 2011 13:16:10 -0400 Received: from eggs.gnu.org ([140.186.70.92]:56857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE2Od-00066v-LR for qemu-devel@nongnu.org; Wed, 12 Oct 2011 13:15:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RE2Ob-0003K5-8M for qemu-devel@nongnu.org; Wed, 12 Oct 2011 13:15:10 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:55893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE2Oa-0003IU-N8 for qemu-devel@nongnu.org; Wed, 12 Oct 2011 13:15:09 -0400 Received: from /spool/local by au.ibm.com with XMail ESMTP for from ; Wed, 12 Oct 2011 18:10:34 +1000 Received: from d23relay03.au.ibm.com ([202.81.31.245]) by au.ibm.com ([202.81.31.206]) with XMail ESMTP; Wed, 12 Oct 2011 18:10:33 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9CHF5l92183412 for ; Thu, 13 Oct 2011 04:15:05 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9CHF4HI031413 for ; Thu, 13 Oct 2011 04:15:05 +1100 Received: from oc4654482034.ibm.com ([9.77.182.149]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p9CHEXkE030606; Thu, 13 Oct 2011 04:15:03 +1100 From: Mark Wu To: Stefan Hajnoczi Date: Thu, 13 Oct 2011 01:14:19 +0800 Message-Id: <1318439659-7525-7-git-send-email-wudxw@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1318439659-7525-1-git-send-email-wudxw@linux.vnet.ibm.com> References: <1318439659-7525-1-git-send-email-wudxw@linux.vnet.ibm.com> x-cbid: 11101208-3568-0000-0000-000000837CF7 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.81.31.142 Cc: Mark Wu , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 6/6] trace: Update doc for trace events group 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: Mark Wu --- docs/tracing.txt | 29 ++++++++++++++++++++++++++--- 1 files changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/tracing.txt b/docs/tracing.txt index 95ca16c..2bd4824 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -16,6 +16,7 @@ for debugging, profiling, and observing execution. echo bdrv_aio_readv > /tmp/events echo bdrv_aio_writev >> /tmp/events + echo group:virtio >> /tmp/events 3. Run the virtual machine to produce a trace file: @@ -53,6 +54,16 @@ source code like this: return ptr; } +== Trace events group == + +Trace events group is used to represent a set of trace events added for the same +component or feature. Each trace events group starts with a line containing +"group_start:GroupName" and end with a line containing "group_end". The range of +a trace events group is determined by the "tracetool" script when it processes +the "trace-events" file. You can change the state of a group of trace events at +one time through trace events group. + + === Declaring trace events === The "tracetool" script produces the trace.h header file which is included by @@ -106,8 +117,8 @@ respectively. This ensures portability between 32- and 64-bit platforms. == Generic interface and monitor commands == -You can programmatically query and control the dynamic state of trace events -through a backend-agnostic interface: +You can programmatically query and control the dynamic state of trace events or +groups through a backend-agnostic interface: * trace_print_events @@ -122,6 +133,11 @@ through a backend-agnostic interface: [...] trace_event_set_state("virtio_irq", false); /* disable */ +* trace_print_groups + +* trace_event_group_set_state + Enables or disables a given group of trace events at runtime inside QEMU. + Note that some of the backends do not provide an implementation for this interface, in which case QEMU will just print a warning. @@ -131,12 +147,19 @@ This functionality is also provided through monitor commands: View available trace events and their state. State 1 means enabled, state 0 means disabled. +* info trace-groups + View available trace event groups and their state. State 1 means enabled, state 0 + means disabled. + * trace-event NAME on|off Enable/disable a given trace event. +* trace-group NAME on|off + Enable/disable a given trace event group. + The "-trace events=" command line argument can be used to enable the events listed in from the very beginning of the program. This file must -contain one event name per line. +contain one event name or one group name, which is prefixed by "group:". == Trace backends ==