From: Eduardo Habkost Subject: [PATCH 4/4] Add --with-kvm-trace arg to configure Date: Mon, 22 Sep 2008 14:52:08 -0300 Message-ID: <1222105928-23813-5-git-send-email-ehabkost@redhat.com> References: <1222105928-23813-1-git-send-email-ehabkost@redhat.com> Cc: kvm@vger.kernel.org, Eduardo Habkost To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:38433 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752827AbYIVRw1 (ORCPT ); Mon, 22 Sep 2008 13:52:27 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m8MHqQcE024023 for ; Mon, 22 Sep 2008 13:52:26 -0400 In-Reply-To: <1222105928-23813-1-git-send-email-ehabkost@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: ./configure --with-kvm-trace will set a CONFIG_KVM_TRACE option on a kernel/config.kbuild file. This file can be included from the Kbuild files to get kvm-specific CONFIG_* definitions. Signed-off-by: Eduardo Habkost --- .gitignore | 1 + configure | 11 +++++++++++ kernel/Makefile | 7 ++++++- kernel/x86/Kbuild | 4 ++++ 4 files changed, 22 insertions(+), 1 deletions(-) diff --git a/.gitignore b/.gitignore index bc54832..474faa0 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ vgabios/*.txt extboot/extboot.bin extboot/extboot.img extboot/signrom +kernel/config.kbuild kernel/modules.order kernel/Module.symvers kernel/Modules.symvers diff --git a/configure b/configure index 3bb10ce..78c2f9c 100755 --- a/configure +++ b/configure @@ -8,6 +8,7 @@ objcopy=objcopy want_module=1 qemu_cflags= qemu_ldflags= +kvm_trace= qemu_opts=() cross_prefix= arch=`uname -m` @@ -22,6 +23,7 @@ usage() { --cross-prefix=PREFIX prefix for cross compile --prefix=PREFIX where to install things ($prefix) --with-patched-kernel don't use external module + --with-kvm-trace Enable kvm_trace --kerneldir=DIR kernel build directory ($kerneldir) --qemu-cflags=CFLAGS CFLAGS to add to qemu configuration --qemu-ldflags=LDFLAGS LDFLAGS to add to qemu configuration @@ -56,6 +58,9 @@ while [[ "$1" = -* ]]; do --with-patched-kernel) want_module= ;; + --with-kvm-trace) + kvm_trace=y + ;; --qemu-cflags) qemu_cflags="$arg" ;; @@ -131,3 +136,9 @@ CC=$cross_prefix$cc LD=$cross_prefix$ld OBJCOPY=$cross_prefix$objcopy EOF + +if [ -n "$want_module" ];then +cat < kernel/config.kbuild +CONFIG_KVM_TRACE=$kvm_trace +EOF +fi diff --git a/kernel/Makefile b/kernel/Makefile index 151183a..9842dab 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,4 +1,5 @@ include ../config.mak +include config.kbuild ARCH_DIR = $(if $(filter $(ARCH),x86_64 i386),x86,$(ARCH)) ARCH_CONFIG := $(shell echo $(ARCH_DIR) | tr '[:lower:]' '[:upper:]') @@ -33,12 +34,16 @@ hack-files-ia64 = kvm_main.c kvm_fw.c hack-files = $(hack-files-$(ARCH_DIR)) +ifeq ($(CONFIG_KVM_TRACE),y) +module_defines += -DCONFIG_KVM_TRACE=y +endif + all:: header-link prerequisite # include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat $(MAKE) -C $(KERNELDIR) M=`pwd` \ LINUXINCLUDE="-I`pwd`/include -Iinclude -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \ -include include/linux/autoconf.h \ - -include `pwd`/$(ARCH_DIR)/external-module-compat.h" + -include `pwd`/$(ARCH_DIR)/external-module-compat.h $(module_defines)" "$$@" sync: header-sync source-sync header-link diff --git a/kernel/x86/Kbuild b/kernel/x86/Kbuild index 8dc0483..bc584f9 100644 --- a/kernel/x86/Kbuild +++ b/kernel/x86/Kbuild @@ -1,3 +1,7 @@ +# trick to get the kvm-specific CONFIG_KVM_* definitions, +# because the kernel source tree won't have them +include $(obj)/../config.kbuild + obj-m := kvm.o kvm-intel.o kvm-amd.o kvm-objs := kvm_main.o x86.o mmu.o x86_emulate.o ../anon_inodes.o irq.o i8259.o \ lapic.o ioapic.o preempt.o i8254.o coalesced_mmio.o \ -- 1.5.5.GIT