Skip to contentSkip to conversation

perf bench: Copy kernel files needed to build mem{cpy,set} x86_64 benchmarks

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jul 13, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  7d7d1bf1d1dabe435ef50efb051724b8664749cb
Gitweb:     http://git.kernel.org/tip/7d7d1bf1d1dabe435ef50efb051724b8664749cb
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 11 Jul 2016 12:36:41 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 12 Jul 2016 15:20:32 -0300

perf bench: Copy kernel files needed to build mem{cpy,set} x86_64 benchmarks

We can't access kernel files directly from tools/, so copy the required bits, and make sure that we detect when the original files, in the kernel, gets modified.

---
 {arch => tools/arch}/x86/include/asm/cpufeatures.h       |  0
 {arch => tools/arch}/x86/include/asm/disabled-features.h |  0
 {arch => tools/arch}/x86/include/asm/required-features.h |  0
 {arch => tools/arch}/x86/lib/memcpy_64.S                 |  0
 {arch => tools/arch}/x86/lib/memset_64.S                 |  0
 tools/{perf/util => }/include/asm/alternative-asm.h      |  4 ++--
 tools/perf/MANIFEST                                      |  9 ++++++---
 tools/perf/Makefile.perf                                 | 15 +++++++++++++++
 tools/perf/bench/mem-memcpy-x86-64-asm.S                 |  2 +-
 tools/perf/bench/mem-memset-x86-64-asm.S                 |  2 +-
 10 files changed, 25 insertions(+), 7 deletions(-)
tools/arch/x86/include/asm/cpufeatures.h renamed from arch/x86/include/asm/cpufeatures.h +0 -0
similarity index 100%
copy from arch/x86/include/asm/cpufeatures.h
copy to tools/arch/x86/include/asm/cpufeatures.h
tools/arch/x86/include/asm/disabled-features.h renamed from arch/x86/include/asm/disabled-features.h +0 -0
similarity index 100%
copy from arch/x86/include/asm/disabled-features.h
copy to tools/arch/x86/include/asm/disabled-features.h
tools/arch/x86/include/asm/required-features.h renamed from arch/x86/include/asm/required-features.h +0 -0
similarity index 100%
copy from arch/x86/include/asm/required-features.h
copy to tools/arch/x86/include/asm/required-features.h
tools/arch/x86/lib/memcpy_64.S renamed from arch/x86/lib/memcpy_64.S +0 -0
similarity index 100%
copy from arch/x86/lib/memcpy_64.S
copy to tools/arch/x86/lib/memcpy_64.S
tools/arch/x86/lib/memset_64.S renamed from arch/x86/lib/memset_64.S +0 -0
similarity index 100%
copy from arch/x86/lib/memset_64.S
copy to tools/arch/x86/lib/memset_64.S
tools/include/asm/alternative-asm.h renamed from tools/perf/util/include/asm/alternative-asm.h +2 -2
similarity index 66%
rename from tools/perf/util/include/asm/alternative-asm.h
rename to tools/include/asm/alternative-asm.h
index 3a3a0f1..2a4d1bf 100644
@@ -1,5 +1,5 @@
-#ifndef _PERF_ASM_ALTERNATIVE_ASM_H
-#define _PERF_ASM_ALTERNATIVE_ASM_H
+#ifndef _TOOLS_ASM_ALTERNATIVE_ASM_H
+#define _TOOLS_ASM_ALTERNATIVE_ASM_H
 
 /* Just disable it so we can build arch/x86/lib/memcpy_64.S for perf bench: */
 
tools/perf/MANIFEST +6 -3
index 0b1ebf3..cf85d1c 100644
@@ -12,6 +12,11 @@ tools/arch/sparc/include/asm/barrier_32.h
 tools/arch/sparc/include/asm/barrier_64.h
 tools/arch/tile/include/asm/barrier.h
 tools/arch/x86/include/asm/barrier.h
+tools/arch/x86/include/asm/cpufeatures.h
+tools/arch/x86/include/asm/disabled-features.h
+tools/arch/x86/include/asm/required-features.h
+tools/arch/x86/lib/memcpy_64.S
+tools/arch/x86/lib/memset_64.S
 tools/arch/xtensa/include/asm/barrier.h
 tools/scripts
 tools/build
@@ -31,6 +36,7 @@ tools/lib/find_bit.c
 tools/lib/bitmap.c
 tools/lib/str_error_r.c
 tools/lib/vsprintf.c
+tools/include/asm/alternative-asm.h
 tools/include/asm/atomic.h
 tools/include/asm/barrier.h
 tools/include/asm/bug.h
@@ -74,9 +80,6 @@ include/linux/swab.h
 arch/*/include/asm/unistd*.h
 arch/*/include/uapi/asm/unistd*.h
 arch/*/include/uapi/asm/perf_regs.h
-arch/*/lib/memcpy*.S
-arch/*/lib/memset*.S
-arch/*/include/asm/*features.h
 include/linux/poison.h
 include/linux/hw_breakpoint.h
 include/uapi/linux/bpf.h
tools/perf/Makefile.perf +15 -0
index 5e5f8cb..809735c 100644
@@ -348,6 +348,21 @@ $(PERF_IN): prepare FORCE
 	@(test -f ../../include/uapi/linux/perf_event.h && ( \
         (diff -B ../include/uapi/linux/perf_event.h ../../include/uapi/linux/perf_event.h >/dev/null) \
         || echo "Warning: tools/include/uapi/linux/perf_event.h differs from kernel" >&2 )) || true
+	@(test -f ../../arch/x86/include/asm/disabled-features.h && ( \
+        (diff -B ../arch/x86/include/asm/disabled-features.h ../../arch/x86/include/asm/disabled-features.h >/dev/null) \
+        || echo "Warning: tools/arch/x86/include/asm/disabled-features.h differs from kernel" >&2 )) || true
+	@(test -f ../../arch/x86/include/asm/required-features.h && ( \
+        (diff -B ../arch/x86/include/asm/required-features.h ../../arch/x86/include/asm/required-features.h >/dev/null) \
+        || echo "Warning: tools/arch/x86/include/asm/required-features.h differs from kernel" >&2 )) || true
+	@(test -f ../../arch/x86/include/asm/cpufeatures.h && ( \
+        (diff -B ../arch/x86/include/asm/cpufeatures.h ../../arch/x86/include/asm/cpufeatures.h >/dev/null) \
+        || echo "Warning: tools/arch/x86/include/asm/cpufeatures.h differs from kernel" >&2 )) || true
+	@(test -f ../../arch/x86/lib/memcpy_64.S && ( \
+        (diff -B ../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memcpy_64.S >/dev/null) \
+        || echo "Warning: tools/arch/x86/lib/memcpy_64.S differs from kernel" >&2 )) || true
+	@(test -f ../../arch/x86/lib/memset_64.S && ( \
+        (diff -B ../arch/x86/lib/memset_64.S ../../arch/x86/lib/memset_64.S >/dev/null) \
+        || echo "Warning: tools/arch/x86/lib/memset_64.S differs from kernel" >&2 )) || true
 	$(Q)$(MAKE) $(build)=perf
 
 $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
tools/perf/bench/mem-memcpy-x86-64-asm.S +1 -1
index 5c3cce0..f700369 100644
@@ -6,7 +6,7 @@
 #define globl p2align 4; .globl
 #define _ASM_EXTABLE_FAULT(x, y)
 
-#include "../../../arch/x86/lib/memcpy_64.S"
+#include "../../arch/x86/lib/memcpy_64.S"
 /*
  * We need to provide note.GNU-stack section, saying that we want
  * NOT executable stack. Otherwise the final linking will assume that
tools/perf/bench/mem-memset-x86-64-asm.S +1 -1
index de27878..58407aa 100644
@@ -1,7 +1,7 @@
 #define memset MEMSET /* don't hide glibc's memset() */
 #define altinstr_replacement text
 #define globl p2align 4; .globl
-#include "../../../arch/x86/lib/memset_64.S"
+#include "../../arch/x86/lib/memset_64.S"
 
 /*
  * We need to provide note.GNU-stack section, saying that we want