From patchwork Wed Aug 31 18:31:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?Q?Llu=C3=ADs?= X-Patchwork-Id: 112653 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 4A5C8B6F81 for ; Thu, 1 Sep 2011 05:12:19 +1000 (EST) Received: from localhost ([::1]:49858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QypbG-0007x5-2M for incoming@patchwork.ozlabs.org; Wed, 31 Aug 2011 14:33:22 -0400 Received: from eggs.gnu.org ([140.186.70.92]:54614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QypbA-0007q1-Oi for qemu-devel@nongnu.org; Wed, 31 Aug 2011 14:33:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QypaW-0002JC-U9 for qemu-devel@nongnu.org; Wed, 31 Aug 2011 14:32:44 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:38505) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QypaW-0002FO-FF for qemu-devel@nongnu.org; Wed, 31 Aug 2011 14:32:36 -0400 Received: (qmail invoked by alias); 31 Aug 2011 18:32:16 -0000 Received: from unknown (EHLO localhost) [84.88.53.92] by mail.gmx.net (mp047) with SMTP; 31 Aug 2011 20:32:16 +0200 X-Authenticated: #12333383 X-Provags-ID: V01U2FsdGVkX1/umescz5/uEVe6106Au/wSBybrMbumsQHKK70itK Pn15wLrPs+3130 To: qemu-devel@nongnu.org, chouteau@adacore.com From: =?utf-8?b?TGx1w61z?= Date: Wed, 31 Aug 2011 20:31:51 +0200 Message-ID: <20110831183151.849.52047.stgit@ginnungagap.bsc.es> In-Reply-To: <20110831183023.849.39499.stgit@ginnungagap.bsc.es> References: <20110831183023.849.39499.stgit@ginnungagap.bsc.es> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.23 Cc: stefanha@gmail.com Subject: [Qemu-devel] [PATCH v9 13/14] trace-state: [stderr] add support for dynamically enabling/disabling events 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 Uses the generic interface provided in "trace/control.h" in order to provide a programmatic interface as well as command line and monitor controls. Signed-off-by: Fabien Chouteau Signed-off-by: LluĂ­s Vilanova --- Makefile.objs | 2 ++ configure | 1 + docs/tracing.txt | 5 ----- qemu-options.hx | 3 ++- scripts/tracetool | 33 ++++++++++++++++++++++++++++----- trace/stderr.c | 37 +++++++++++++++++++++++++++++++++++++ trace/stderr.h | 11 +++++++++++ 7 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 trace/stderr.c create mode 100644 trace/stderr.h diff --git a/Makefile.objs b/Makefile.objs index 036a4eb..26b885b 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -384,6 +384,8 @@ trace-nested-$(CONFIG_TRACE_DEFAULT) += default.o trace-nested-$(CONFIG_TRACE_SIMPLE) += simple.o trace-obj-$(CONFIG_TRACE_SIMPLE) += qemu-timer-common.o +trace-nested-$(CONFIG_TRACE_STDERR) += stderr.o + trace-nested-y += control.o trace-obj-y += $(addprefix trace/, $(trace-nested-y)) diff --git a/configure b/configure index f38847a..4d22470 100755 --- a/configure +++ b/configure @@ -3078,6 +3078,7 @@ if test "$trace_backend" = "simple"; then fi if test "$trace_backend" = "stderr"; then echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak + trace_default=no fi if test "$trace_backend" = "ust"; then echo "CONFIG_TRACE_UST=y" >> $config_host_mak diff --git a/docs/tracing.txt b/docs/tracing.txt index d1d4e8c..4b27ab0 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -178,11 +178,6 @@ effectively turns trace events into debug printfs. This is the simplest backend and can be used together with existing code that uses DPRINTF(). -Note that with this backend trace events cannot be programmatically -enabled/disabled. Thus, in order to trim down the amount of output and the -performance impact of tracing, you might want to add the "disable" property in -the "trace-events" file for those events you are not interested in. - === Simpletrace === The "simple" backend supports common use cases and comes as part of the QEMU diff --git a/qemu-options.hx b/qemu-options.hx index edd181b..f672365 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2454,7 +2454,8 @@ Immediately enable events listed in @var{file}. The file must contain one event name (as listed in the @var{trace-events} file) per line. -This option is only available when using the @var{simple} tracing backend. +This option is only available when using the @var{simple} and @var{stderr} +tracing backends. @item file=@var{file} Log output traces to @var{file}. diff --git a/scripts/tracetool b/scripts/tracetool index c740080..743d246 100755 --- a/scripts/tracetool +++ b/scripts/tracetool @@ -241,7 +241,12 @@ linetoh_begin_stderr() { cat < +#include "trace/stderr.h" + +extern TraceEvent trace_list[]; EOF + + stderr_event_num=0 } linetoh_stderr() @@ -260,29 +265,47 @@ linetoh_stderr() cat <