From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47952 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsdPT-00056A-Ux for qemu-devel@nongnu.org; Mon, 06 Sep 2010 11:15:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OsdPN-0003yJ-RO for qemu-devel@nongnu.org; Mon, 06 Sep 2010 11:15:03 -0400 Received: from mtagate7.de.ibm.com ([195.212.17.167]:49146) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsdPN-0003xh-Fn for qemu-devel@nongnu.org; Mon, 06 Sep 2010 11:14:57 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.1/8.13.1) with ESMTP id o86FEutt018316 for ; Mon, 6 Sep 2010 15:14:56 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o86FEruu2486376 for ; Mon, 6 Sep 2010 17:14:55 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o86FErJg018128 for ; Mon, 6 Sep 2010 17:14:53 +0200 From: Stefan Hajnoczi Date: Mon, 6 Sep 2010 16:14:05 +0100 Message-Id: <1283786051-29530-9-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1283786051-29530-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1283786051-29530-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 08/14] trace: Add LTTng Userspace Tracer backend List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Anthony Liguori , "Michael S. Tsirkin" , Stefan Hajnoczi , Prerna Saxena This patch adds LTTng Userspace Tracer (UST) backend support. The UST system requires no kernel support but libust and liburcu must be installed. $ ./configure --trace-backend ust $ make Start the UST daemon: $ ustd & List available tracepoints and enable some: $ ustctl --list-markers $(pgrep qemu) [...] {PID: 5458, channel/marker: ust/paio_submit, state: 0, fmt: "acb %p opaque %p sector_num %lu nb_sectors %lu type %lu" 0x4b32ba} $ ustctl --enable-marker "ust/paio_submit" $(pgrep qemu) Run the trace: $ ustctl --create-trace $(pgrep qemu) $ ustctl --start-trace $(pgrep qemu) [...] $ ustctl --stop-trace $(pgrep qemu) $ ustctl --destroy-trace $(pgrep qemu) Trace results can be viewed using lttv-gui. More information about UST: http://lttng.org/ust Signed-off-by: Stefan Hajnoczi trace: Check for LTTng Userspace Tracer headers When using the 'ust' backend, check if the relevant headers are available at host. Signed-off-by: Prerna Saxena Signed-off-by: Stefan Hajnoczi --- configure | 20 +++++++++++++- tracetool | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 234e75b..4061cb7 100755 --- a/configure +++ b/configure @@ -903,7 +903,7 @@ 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 " --trace-backend=B Trace backend nop simple" +echo " --trace-backend=B Trace backend nop simple ust" echo " --trace-file=NAME Full PATH,NAME of file to store traces" echo " Default:trace-" echo "" @@ -2080,6 +2080,24 @@ if test "$?" -ne 0 ; then exit 1 fi +########################################## +# For 'ust' backend, test if ust headers are present +if test "$trace_backend" = "ust"; then + cat > $TMPC << EOF +#include +#include +int main(void) { return 0; } +EOF + if compile_prog "" "" ; then + LIBS="-lust $LIBS" + else + echo + echo "Error: Trace backend 'ust' missing libust header files" + echo + exit 1 + fi +fi +########################################## # End of CC checks # After here, no more $cc or $ld runs diff --git a/tracetool b/tracetool index 8aeac48..b74b630 100755 --- a/tracetool +++ b/tracetool @@ -13,12 +13,13 @@ set -f usage() { cat >&2 <" + ust_clean_namespace +} + +linetoh_ust() +{ + local name args argnames + name=$(get_name "$1") + args=$(get_args "$1") + argnames=$(get_argnames "$1") + + cat < +$(ust_clean_namespace) +#include "trace.h" +EOF +} + +linetoc_ust() +{ + local name args argnames fmt + name=$(get_name "$1") + args=$(get_args "$1") + argnames=$(get_argnames "$1") + fmt=$(get_fmt "$1") + + cat <