From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwcFA-0006Ip-3z for qemu-devel@nongnu.org; Thu, 25 Aug 2011 11:53:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwcEz-0001xN-Cw for qemu-devel@nongnu.org; Thu, 25 Aug 2011 11:53:24 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:50343) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QwcEy-0001s0-T4 for qemu-devel@nongnu.org; Thu, 25 Aug 2011 11:53:13 -0400 From: =?utf-8?b?TGx1w61z?= Date: Thu, 25 Aug 2011 17:52:57 +0200 Message-ID: <20110825155256.19177.89067.stgit@ginnungagap.bsc.es> In-Reply-To: <20110825155128.19177.80104.stgit@ginnungagap.bsc.es> References: <20110825155128.19177.80104.stgit@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v6 13/14] trace-state: [stderr] add support for dynamically enabling/disabling events List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, chouteau@adacore.com Cc: stefanha@gmail.com 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 | 3 +++ docs/tracing.txt | 5 ----- scripts/tracetool | 33 ++++++++++++++++++++++++++++----- trace/stderr.c | 30 ++++++++++++++++++++++++++++++ trace/stderr.h | 11 +++++++++++ 6 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 trace/stderr.c create mode 100644 trace/stderr.h diff --git a/Makefile.objs b/Makefile.objs index 8950086..076974c 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -383,6 +383,8 @@ trace-obj-y += trace/control.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 373d007..8ccd5f4 100755 --- a/configure +++ b/configure @@ -3068,6 +3068,9 @@ echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak if test "$trace_backend" = "simple"; then echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak fi +if test "$trace_backend" = "stderr"; then + echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak +fi # Set the appropriate trace file. if test "$trace_backend" = "simple"; then trace_file="\"$trace_file-\" FMT_pid" diff --git a/docs/tracing.txt b/docs/tracing.txt index 448fdef..f14dbe3 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -164,11 +164,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/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 <