From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz2Ip-00048c-5Y for qemu-devel@nongnu.org; Thu, 01 Sep 2011 04:07:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qz2Ie-0007iY-4O for qemu-devel@nongnu.org; Thu, 01 Sep 2011 04:07:10 -0400 Received: from mtagate1.uk.ibm.com ([194.196.100.161]:56857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz2Id-0007f5-QS for qemu-devel@nongnu.org; Thu, 01 Sep 2011 04:07:00 -0400 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p8186hmX005436 for ; Thu, 1 Sep 2011 08:06:43 GMT Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8186htI1605844 for ; Thu, 1 Sep 2011 09:06:43 +0100 Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8186VZi020237 for ; Thu, 1 Sep 2011 02:06:33 -0600 From: Stefan Hajnoczi Date: Thu, 1 Sep 2011 09:06:24 +0100 Message-Id: <1314864386-14202-14-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1314864386-14202-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1314864386-14202-1-git-send-email-stefanha@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 13/15] trace: [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 Cc: Anthony Liguori , =?UTF-8?q?Llu=C3=ADs?= , Fabien Chouteau , =?UTF-8?q?Llu=C3=ADs=20Vilanova?= From: Llu=C3=ADs Uses the generic interface provided in "trace/control.h" in order to prov= ide a programmatic interface as well as command line and monitor controls. Signed-off-by: Fabien Chouteau Signed-off-by: Llu=C3=ADs 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) +=3D default.o trace-nested-$(CONFIG_TRACE_SIMPLE) +=3D simple.o trace-obj-$(CONFIG_TRACE_SIMPLE) +=3D qemu-timer-common.o =20 +trace-nested-$(CONFIG_TRACE_STDERR) +=3D stderr.o + trace-nested-y +=3D control.o =20 trace-obj-y +=3D $(addprefix trace/, $(trace-nested-y)) diff --git a/configure b/configure index 4f9b27c..300d34b 100755 --- a/configure +++ b/configure @@ -3078,6 +3078,7 @@ if test "$trace_backend" =3D "simple"; then fi if test "$trace_backend" =3D "stderr"; then echo "CONFIG_TRACE_STDERR=3Dy" >> $config_host_mak + trace_default=3Dno fi if test "$trace_backend" =3D "ust"; then echo "CONFIG_TRACE_UST=3Dy" >> $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(). =20 -Note that with this backend trace events cannot be programmatically -enabled/disabled. Thus, in order to trim down the amount of output and t= he -performance impact of tracing, you might want to add the "disable" prope= rty in -the "trace-events" file for those events you are not interested in. - =3D=3D=3D Simpletrace =3D=3D=3D =20 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. =20 -This option is only available when using the @var{simple} tracing backen= d. +This option is only available when using the @var{simple} and @var{stder= r} +tracing backends. @item file=3D@var{file} Log output traces to @var{file}. =20 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=3D0 } =20 linetoh_stderr() @@ -260,29 +265,47 @@ linetoh_stderr() cat <