diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2011-07-25 18:51:02 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2011-07-25 18:51:02 -0400 |
commit | b3c4b9825075b680817b9460184e7b576dc97597 (patch) | |
tree | 88c6d1a7be1ed020d8447ece46fd44f74515e8df | |
parent | bd9ddc875b6659f9f74dcfd285c472bc58041abd (diff) |
xen/tracing: fix compile errors when tracing is disabled.
When CONFIG_FUNCTION_TRACER is disabled, compilation fails as follows:
CC arch/x86/xen/setup.o
In file included from arch/x86/include/asm/xen/hypercall.h:42,
from arch/x86/xen/setup.c:19:
include/trace/events/xen.h:31: warning: 'struct multicall_entry' declared inside parameter list
include/trace/events/xen.h:31: warning: its scope is only this definition or declaration, which is probably not what you want
include/trace/events/xen.h:31: warning: 'struct multicall_entry' declared inside parameter list
include/trace/events/xen.h:31: warning: 'struct multicall_entry' declared inside parameter list
include/trace/events/xen.h:31: warning: 'struct multicall_entry' declared inside parameter list
[...]
arch/x86/xen/trace.c:5: error: '__HYPERVISOR_set_trap_table' undeclared here (not in a function)
arch/x86/xen/trace.c:5: error: array index in initializer not of integer type
arch/x86/xen/trace.c:5: error: (near initialization for 'xen_hypercall_names')
arch/x86/xen/trace.c:6: error: '__HYPERVISOR_mmu_update' undeclared here (not in a function)
arch/x86/xen/trace.c:6: error: array index in initializer not of integer type
arch/x86/xen/trace.c:6: error: (near initialization for 'xen_hypercall_names')
Fix this by making sure struct multicall_entry has a declaration in
scope at all times, and don't bother compiling xen/trace.c when tracing
is disabled.
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
-rw-r--r-- | arch/x86/xen/Makefile | 4 | ||||
-rw-r--r-- | include/trace/events/xen.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile index 6fdf366ff688..ce692013896d 100644 --- a/arch/x86/xen/Makefile +++ b/arch/x86/xen/Makefile | |||
@@ -13,7 +13,9 @@ CFLAGS_mmu.o := $(nostackp) | |||
13 | obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ | 13 | obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ |
14 | time.o xen-asm.o xen-asm_$(BITS).o \ | 14 | time.o xen-asm.o xen-asm_$(BITS).o \ |
15 | grant-table.o suspend.o platform-pci-unplug.o \ | 15 | grant-table.o suspend.o platform-pci-unplug.o \ |
16 | p2m.o trace.o | 16 | p2m.o |
17 | |||
18 | obj-$(CONFIG_FUNCTION_TRACER) += trace.o | ||
17 | 19 | ||
18 | obj-$(CONFIG_SMP) += smp.o | 20 | obj-$(CONFIG_SMP) += smp.o |
19 | obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o | 21 | obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o |
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index 44d8decee09e..92f1a796829e 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <asm/paravirt_types.h> | 8 | #include <asm/paravirt_types.h> |
9 | #include <asm/xen/trace_types.h> | 9 | #include <asm/xen/trace_types.h> |
10 | 10 | ||
11 | struct multicall_entry; | ||
12 | |||
11 | /* Multicalls */ | 13 | /* Multicalls */ |
12 | DECLARE_EVENT_CLASS(xen_mc__batch, | 14 | DECLARE_EVENT_CLASS(xen_mc__batch, |
13 | TP_PROTO(enum paravirt_lazy_mode mode), | 15 | TP_PROTO(enum paravirt_lazy_mode mode), |