From patchwork Tue Apr 16 13:50:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 236987 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 81C0F2C00DC for ; Wed, 17 Apr 2013 00:43:55 +1000 (EST) Received: from localhost ([::1]:35320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US76v-0000IP-RO for incoming@patchwork.ozlabs.org; Tue, 16 Apr 2013 10:43:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US6uX-0005M3-R1 for qemu-devel@nongnu.org; Tue, 16 Apr 2013 10:31:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US6jq-0004w2-Nw for qemu-devel@nongnu.org; Tue, 16 Apr 2013 10:20:09 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:44847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US6Gv-0002zg-DE for qemu-devel@nongnu.org; Tue, 16 Apr 2013 09:50:09 -0400 Received: from gw.ac.upc.edu (gw.ac.upc.es [147.83.30.3]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id r3GDo8JB030802 for ; Tue, 16 Apr 2013 15:50:08 +0200 Received: from localhost (unknown [84.88.51.85]) by gw.ac.upc.edu (Postfix) with ESMTP id 614D66B01C9 for ; Tue, 16 Apr 2013 15:50:08 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Tue, 16 Apr 2013 15:50:08 +0200 Message-Id: <20130416135007.21588.42547.stgit@fimbulvetr.bsc.es> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <20130416134949.21588.80064.stgit@fimbulvetr.bsc.es> References: <20130416134949.21588.80064.stgit@fimbulvetr.bsc.es> User-Agent: StGit/0.16 MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id r3GDo8JB030802 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH v2 03/23] trace: Let the user specify her own trace-events file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org With this option the user can perform multiple builds of QEMU with different tracing event properties. Signed-off-by: LluĂ­s Vilanova --- Makefile.target | 2 +- configure | 19 +++++++++++++++++++ trace/Makefile.objs | 10 +++++----- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Makefile.target b/Makefile.target index 2bd6d14..f382559 100644 --- a/Makefile.target +++ b/Makefile.target @@ -47,7 +47,7 @@ else TARGET_TYPE=system endif -$(QEMU_PROG).stp: $(SRC_PATH)/trace-events +$(QEMU_PROG).stp: $(TRACE_EVENTS) $(call quiet-command,$(TRACETOOL) \ --format=stap \ --backend=$(TRACE_BACKEND) \ diff --git a/configure b/configure index 73df181..a3bd336 100755 --- a/configure +++ b/configure @@ -221,6 +221,7 @@ blobs="yes" pkgversion="" pie="" zero_malloc="" +trace_events=`dirname $0`/trace-events trace_backend="nop" trace_file="trace" spice="" @@ -639,6 +640,8 @@ for opt do ;; --target-list=*) target_list="$optarg" ;; + --with-trace-events=*) trace_events="$optarg" + ;; --enable-trace-backend=*) trace_backend="$optarg" ;; --with-trace-file=*) trace_file="$optarg" @@ -1158,6 +1161,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 " --with-trace-events=PATH file with tracing events description (default: $trace_events)" echo " --enable-trace-backend=B Set trace backend" echo " Available backends:" $($python "$source_path"/scripts/tracetool.py --list-backends) echo " --with-trace-file=NAME Full PATH,NAME of file to store traces" @@ -3009,6 +3013,18 @@ if compile_prog "" "" ; then fi ########################################## +# check if trace-events file exists + +if test ! -f "$trace_events"; then + echo + echo "Error: the given trace-events file does not exist" + echo + exit 1 +else + trace_events=`readlink -f "$trace_events"` +fi + +########################################## # check if trace backend exists $python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null @@ -3418,6 +3434,7 @@ echo "sigev_thread_id $sigev_thread_id" echo "uuid support $uuid" echo "libcap-ng support $cap_ng" echo "vhost-net support $vhost_net" +echo "Trace events $trace_events" echo "Trace backend $trace_backend" echo "Trace output file $trace_file-" echo "spice support $spice ($spice_protocol_version/$spice_server_version)" @@ -3810,6 +3827,8 @@ bsd) ;; esac +echo "TRACE_EVENTS=$trace_events" >> $config_host_mak + # use default implementation for tracing backend-specific routines trace_default=yes echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak diff --git a/trace/Makefile.objs b/trace/Makefile.objs index a043072..bf0a965 100644 --- a/trace/Makefile.objs +++ b/trace/Makefile.objs @@ -4,7 +4,7 @@ # Auto-generated event descriptions $(obj)/generated-events.h: $(obj)/generated-events.h-timestamp -$(obj)/generated-events.h-timestamp: $(SRC_PATH)/trace-events +$(obj)/generated-events.h-timestamp: $(TRACE_EVENTS) $(call quiet-command,$(TRACETOOL) \ --format=events-h \ --backend=events \ @@ -12,7 +12,7 @@ $(obj)/generated-events.h-timestamp: $(SRC_PATH)/trace-events @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@) $(obj)/generated-events.c: $(obj)/generated-events.c-timestamp $(BUILD_DIR)/config-host.mak -$(obj)/generated-events.c-timestamp: $(SRC_PATH)/trace-events +$(obj)/generated-events.c-timestamp: $(TRACE_EVENTS) $(call quiet-command,$(TRACETOOL) \ --format=events-c \ --backend=events \ @@ -27,7 +27,7 @@ util-obj-y += generated-events.o $(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp @cmp -s $< $@ || cp $< $@ -$(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak +$(obj)/generated-tracers.h-timestamp: $(TRACE_EVENTS) $(BUILD_DIR)/config-host.mak $(call quiet-command,$(TRACETOOL) \ --format=h \ --backend=$(TRACE_BACKEND) \ @@ -39,7 +39,7 @@ $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/conf ifneq ($(TRACE_BACKEND),dtrace) $(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp @cmp -s $< $@ || cp $< $@ -$(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak +$(obj)/generated-tracers.c-timestamp: $(TRACE_EVENTS) $(BUILD_DIR)/config-host.mak $(call quiet-command,$(TRACETOOL) \ --format=c \ --backend=$(TRACE_BACKEND) \ @@ -57,7 +57,7 @@ endif # rule file. So we use '.dtrace' instead ifeq ($(TRACE_BACKEND),dtrace) $(obj)/generated-tracers.dtrace: $(obj)/generated-tracers.dtrace-timestamp -$(obj)/generated-tracers.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak +$(obj)/generated-tracers.dtrace-timestamp: $(TRACE_EVENTS) $(BUILD_DIR)/config-host.mak $(call quiet-command,$(TRACETOOL) \ --format=d \ --backend=$(TRACE_BACKEND) \