aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2014-05-27 15:02:14 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2014-06-09 15:43:40 +0200
commit5b808275f3bbe8cc95bb9301f4d5a41331d0e0e6 (patch)
treed5611a010851864336448529088cd94a9afcf83a /configure
parent82432638ebeedda8a2e18838b6fbef4b14a94f31 (diff)
trace: Multi-backend tracing
Adds support to compile QEMU with multiple tracing backends at the same time. For example, you can compile QEMU with: $ ./configure --enable-trace-backends=ftrace,dtrace Where 'ftrace' can be handy for having an in-flight record of events, and 'dtrace' can be later used to extract more information from the system. This patch allows having both available without recompiling QEMU. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure47
1 files changed, 23 insertions, 24 deletions
diff --git a/configure b/configure
index 0e516f9e2a..a994f4196f 100755
--- a/configure
+++ b/configure
@@ -182,6 +182,10 @@ path_of() {
return 1
}
+have_backend () {
+ echo "$trace_backends" | grep "$1" >/dev/null
+}
+
# default parameters
source_path=`dirname "$0"`
cpu=""
@@ -293,7 +297,7 @@ pkgversion=""
pie=""
zero_malloc=""
qom_cast_debug="yes"
-trace_backend="nop"
+trace_backends="nop"
trace_file="trace"
spice=""
rbd=""
@@ -753,7 +757,10 @@ for opt do
;;
--target-list=*) target_list="$optarg"
;;
- --enable-trace-backend=*) trace_backend="$optarg"
+ --enable-trace-backends=*) trace_backends="$optarg"
+ ;;
+ # XXX: backwards compatibility
+ --enable-trace-backend=*) trace_backends="$optarg"
;;
--with-trace-file=*) trace_file="$optarg"
;;
@@ -1320,7 +1327,7 @@ Advanced options (experts only):
--disable-docs disable documentation build
--disable-vhost-net disable vhost-net acceleration support
--enable-vhost-net enable vhost-net acceleration support
- --enable-trace-backend=B Set trace backend
+ --enable-trace-backends=B Set trace backend
Available backends: $($python $source_path/scripts/tracetool.py --list-backends)
--with-trace-file=NAME Full PATH,NAME of file to store traces
Default:trace-<pid>
@@ -3666,15 +3673,15 @@ fi
##########################################
# check if trace backend exists
-$python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null
+$python "$source_path/scripts/tracetool.py" "--backends=$trace_backends" --check-backends > /dev/null 2> /dev/null
if test "$?" -ne 0 ; then
- error_exit "invalid trace backend" \
- "Please choose a supported trace backend."
+ error_exit "invalid trace backends" \
+ "Please choose supported trace backends."
fi
##########################################
# For 'ust' backend, test if ust headers are present
-if test "$trace_backend" = "ust"; then
+if have_backend "ust"; then
cat > $TMPC << EOF
#include <lttng/tracepoint.h>
int main(void) { return 0; }
@@ -3700,7 +3707,7 @@ fi
##########################################
# For 'dtrace' backend, test if 'dtrace' command is present
-if test "$trace_backend" = "dtrace"; then
+if have_backend "dtrace"; then
if ! has 'dtrace' ; then
error_exit "dtrace command is not found in PATH $PATH"
fi
@@ -4170,7 +4177,7 @@ echo "uuid support $uuid"
echo "libcap-ng support $cap_ng"
echo "vhost-net support $vhost_net"
echo "vhost-scsi support $vhost_scsi"
-echo "Trace backend $trace_backend"
+echo "Trace backends $trace_backends"
if test "$trace_backend" = "simple"; then
echo "Trace output file $trace_file-<pid>"
fi
@@ -4664,43 +4671,35 @@ if test "$tpm" = "yes"; then
fi
fi
-# use default implementation for tracing backend-specific routines
-trace_default=yes
-echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak
-if test "$trace_backend" = "nop"; then
+echo "TRACE_BACKENDS=$trace_backends" >> $config_host_mak
+if have_backend "nop"; then
echo "CONFIG_TRACE_NOP=y" >> $config_host_mak
fi
-if test "$trace_backend" = "simple"; then
+if have_backend "simple"; then
echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak
- trace_default=no
# Set the appropriate trace file.
trace_file="\"$trace_file-\" FMT_pid"
fi
-if test "$trace_backend" = "stderr"; then
+if have_backend "stderr"; then
echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak
- trace_default=no
fi
-if test "$trace_backend" = "ust"; then
+if have_backend "ust"; then
echo "CONFIG_TRACE_UST=y" >> $config_host_mak
fi
-if test "$trace_backend" = "dtrace"; then
+if have_backend "dtrace"; then
echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak
if test "$trace_backend_stap" = "yes" ; then
echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak
fi
fi
-if test "$trace_backend" = "ftrace"; then
+if have_backend "ftrace"; then
if test "$linux" = "yes" ; then
echo "CONFIG_TRACE_FTRACE=y" >> $config_host_mak
- trace_default=no
else
feature_not_found "ftrace(trace backend)" "ftrace requires Linux"
fi
fi
echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
-if test "$trace_default" = "yes"; then
- echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak
-fi
if test "$rdma" = "yes" ; then
echo "CONFIG_RDMA=y" >> $config_host_mak