From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52701 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiO6F-0008GU-HN for qemu-devel@nongnu.org; Thu, 27 Jan 2011 04:25:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiO6D-0000iN-N7 for qemu-devel@nongnu.org; Thu, 27 Jan 2011 04:25:07 -0500 Received: from mel.act-europe.fr ([194.98.77.210]:48147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiO6D-0000bw-BB for qemu-devel@nongnu.org; Thu, 27 Jan 2011 04:25:05 -0500 From: Fabien Chouteau Date: Thu, 27 Jan 2011 10:24:41 +0100 Message-Id: <00f9ac47200684b4a0061dce755af0a280ebd648.1296120144.git.chouteau@adacore.com> Subject: [Qemu-devel] [PATCH v4] New trace-event backend: stderr List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Fabien Chouteau This backend sends trace events to standard error output during the emulation. Also add a "--list-backends" option to tracetool, so configure script can display the list of available backends. Signed-off-by: Fabien Chouteau --- configure | 3 +- docs/tracing.txt | 5 ++++ scripts/tracetool | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 210670c..fcc5a71 100755 --- a/configure +++ b/configure @@ -907,7 +907,8 @@ echo " --enable-docs enable documentation build" echo " --disable-docs disable documentation build" echo " --disable-vhost-net disable vhost-net acceleration support" echo " --enable-vhost-net enable vhost-net acceleration support" -echo " --enable-trace-backend=B Trace backend nop simple ust dtrace" +echo " --enable-trace-backend=B Set trace backend" +echo " Available backends:" $("$source_path"/scripts/tracetool --list-backends) echo " --with-trace-file=NAME Full PATH,NAME of file to store traces" echo " Default:trace-" echo " --disable-spice disable spice" diff --git a/docs/tracing.txt b/docs/tracing.txt index 963c504..21183f9 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -133,6 +133,11 @@ source tree. It may not be as powerful as platform-specific or third-party trace backends but it is portable. This is the recommended trace backend unless you have specific needs for more advanced backends. +=== Stderr === + +The "stderr" backend sends trace events directly to standard error output +during emulation. + ==== Monitor commands ==== * info trace diff --git a/scripts/tracetool b/scripts/tracetool index fce491c..e046683 100755 --- a/scripts/tracetool +++ b/scripts/tracetool @@ -13,12 +13,13 @@ set -f usage() { cat >&2 < +EOF +} + +linetoh_stderr() +{ + local name args argnames argc fmt + name=$(get_name "$1") + args=$(get_args "$1") + argnames=$(get_argnames "$1" ",") + argc=$(get_argc "$1") + fmt=$(get_fmt "$1") + + if [ "$argc" -gt 0 ]; then + argnames=", $argnames" + fi + + cat <