From patchwork Wed Jan 26 13:37:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Chouteau X-Patchwork-Id: 80505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EEB34B70F1 for ; Thu, 27 Jan 2011 00:42:52 +1100 (EST) Received: from localhost ([127.0.0.1]:34501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pi5e5-0001bi-DK for incoming@patchwork.ozlabs.org; Wed, 26 Jan 2011 08:42:49 -0500 Received: from [140.186.70.92] (port=42090 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pi5ZF-0006wO-Ik for qemu-devel@nongnu.org; Wed, 26 Jan 2011 08:37:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pi5ZD-00085S-Rj for qemu-devel@nongnu.org; Wed, 26 Jan 2011 08:37:49 -0500 Received: from mel.act-europe.fr ([194.98.77.210]:38447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pi5ZD-000859-FM for qemu-devel@nongnu.org; Wed, 26 Jan 2011 08:37:47 -0500 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 79797CB0246; Wed, 26 Jan 2011 14:37:46 +0100 (CET) X-Virus-Scanned: amavisd-new at eu.adacore.com Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CaZFHog0uewU; Wed, 26 Jan 2011 14:37:46 +0100 (CET) Received: from PomPomGalli.act-europe.fr (pompomgalli.act-europe.fr [10.10.1.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 66FC8CB0206; Wed, 26 Jan 2011 14:37:46 +0100 (CET) From: Fabien Chouteau To: qemu-devel@nongnu.org Date: Wed, 26 Jan 2011 14:37:45 +0100 Message-Id: <3fbb9d0a1ef25990d8914170cf04e5851424565a.1296048919.git.chouteau@adacore.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Fabien Chouteau Subject: [Qemu-devel] [PATCH v3] New trace-event backend: stderr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Acked-by: Stefan Hajnoczi --- configure | 3 +- docs/tracing.txt | 5 ++++ scripts/tracetool | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 210670c..06d824a 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..a80de70 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 <