Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE

TRACE_INCLUDE_PATH and TRACE_INCLUDE_FILE are used by
<trace/define_trace.h>, so like that #include, they should
be outside #ifdef protection.

They also need to be #undefed before defining, in case multiple trace
headers are included by the same C file. This became the case on
book3e after commit cf4a6085151a ("powerpc/mm: Add missing tracepoint for
tlbie"), leading to the following build error:

CC arch/powerpc/kvm/powerpc.o
In file included from arch/powerpc/kvm/powerpc.c:51:0:
arch/powerpc/kvm/trace.h:9:0: error: "TRACE_INCLUDE_PATH" redefined
[-Werror]
#define TRACE_INCLUDE_PATH .
^
In file included from arch/powerpc/kvm/../mm/mmu_decl.h:25:0,
from arch/powerpc/kvm/powerpc.c:48:
./arch/powerpc/include/asm/trace.h:224:0: note: this is the location of
the previous definition
#define TRACE_INCLUDE_PATH asm
^
cc1: all warnings being treated as errors

Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Scott Wood <oss@buserror.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Scott Wood and committed by
Michael Ellerman
28c5bcf7 9586d569

+27 -8
+6 -2
arch/powerpc/kvm/trace.h
··· 6 6 7 7 #undef TRACE_SYSTEM 8 8 #define TRACE_SYSTEM kvm 9 - #define TRACE_INCLUDE_PATH . 10 - #define TRACE_INCLUDE_FILE trace 11 9 12 10 /* 13 11 * Tracepoint for guest mode entry. ··· 118 120 #endif /* _TRACE_KVM_H */ 119 121 120 122 /* This part must be outside protection */ 123 + #undef TRACE_INCLUDE_PATH 124 + #undef TRACE_INCLUDE_FILE 125 + 126 + #define TRACE_INCLUDE_PATH . 127 + #define TRACE_INCLUDE_FILE trace 128 + 121 129 #include <trace/define_trace.h>
+7 -2
arch/powerpc/kvm/trace_booke.h
··· 6 6 7 7 #undef TRACE_SYSTEM 8 8 #define TRACE_SYSTEM kvm_booke 9 - #define TRACE_INCLUDE_PATH . 10 - #define TRACE_INCLUDE_FILE trace_booke 11 9 12 10 #define kvm_trace_symbol_exit \ 13 11 {0, "CRITICAL"}, \ ··· 216 218 #endif 217 219 218 220 /* This part must be outside protection */ 221 + 222 + #undef TRACE_INCLUDE_PATH 223 + #undef TRACE_INCLUDE_FILE 224 + 225 + #define TRACE_INCLUDE_PATH . 226 + #define TRACE_INCLUDE_FILE trace_booke 227 + 219 228 #include <trace/define_trace.h>
+7 -2
arch/powerpc/kvm/trace_hv.h
··· 9 9 10 10 #undef TRACE_SYSTEM 11 11 #define TRACE_SYSTEM kvm_hv 12 - #define TRACE_INCLUDE_PATH . 13 - #define TRACE_INCLUDE_FILE trace_hv 14 12 15 13 #define kvm_trace_symbol_hcall \ 16 14 {H_REMOVE, "H_REMOVE"}, \ ··· 495 497 #endif /* _TRACE_KVM_HV_H */ 496 498 497 499 /* This part must be outside protection */ 500 + 501 + #undef TRACE_INCLUDE_PATH 502 + #undef TRACE_INCLUDE_FILE 503 + 504 + #define TRACE_INCLUDE_PATH . 505 + #define TRACE_INCLUDE_FILE trace_hv 506 + 498 507 #include <trace/define_trace.h>
+7 -2
arch/powerpc/kvm/trace_pr.h
··· 8 8 9 9 #undef TRACE_SYSTEM 10 10 #define TRACE_SYSTEM kvm_pr 11 - #define TRACE_INCLUDE_PATH . 12 - #define TRACE_INCLUDE_FILE trace_pr 13 11 14 12 TRACE_EVENT(kvm_book3s_reenter, 15 13 TP_PROTO(int r, struct kvm_vcpu *vcpu), ··· 255 257 #endif /* _TRACE_KVM_H */ 256 258 257 259 /* This part must be outside protection */ 260 + 261 + #undef TRACE_INCLUDE_PATH 262 + #undef TRACE_INCLUDE_FILE 263 + 264 + #define TRACE_INCLUDE_PATH . 265 + #define TRACE_INCLUDE_FILE trace_pr 266 + 258 267 #include <trace/define_trace.h>