From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwfS9-0000N8-Qi for qemu-devel@nongnu.org; Thu, 25 Aug 2011 15:19:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwfS8-0004Eb-2P for qemu-devel@nongnu.org; Thu, 25 Aug 2011 15:19:01 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:60016) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QwfS7-0004EW-MA for qemu-devel@nongnu.org; Thu, 25 Aug 2011 15:19:00 -0400 From: =?utf-8?b?TGx1w61z?= Date: Thu, 25 Aug 2011 21:18:49 +0200 Message-ID: <20110825191849.1413.19960.stgit@ginnungagap.bsc.es> In-Reply-To: <20110825191731.1413.26838.stgit@ginnungagap.bsc.es> References: <20110825191731.1413.26838.stgit@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v7 12/13] 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 --- configure | 3 +++ docs/tracing.txt | 5 ----- qemu-options.hx | 3 ++- scripts/tracetool | 33 ++++++++++++++++++++++++++++----- trace/stderr.c | 20 ++++++++++++++++---- trace/stderr.h | 11 +++++++++++ 6 files changed, 60 insertions(+), 15 deletions(-) create mode 100644 trace/stderr.h diff --git a/configure b/configure index c49c080..623d40f 100755 --- a/configure +++ b/configure @@ -3071,6 +3071,9 @@ fi 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/qemu-options.hx b/qemu-options.hx index 91144d9..455f1ef 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2450,7 +2450,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 <