diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/arch/x86/util/pmu.c | 1 | ||||
-rw-r--r-- | tools/perf/arch/x86/util/tsc.c | 1 | ||||
-rw-r--r-- | tools/perf/bench/Build | 1 | ||||
-rw-r--r-- | tools/perf/bench/mem-memcpy-x86-64-asm.S | 1 | ||||
-rw-r--r-- | tools/perf/bench/mem-memcpy-x86-64-lib.c | 24 | ||||
-rw-r--r-- | tools/perf/perf.h | 1 | ||||
-rw-r--r-- | tools/perf/util/header.h | 1 | ||||
-rw-r--r-- | tools/perf/util/namespaces.h | 1 |
8 files changed, 31 insertions, 0 deletions
diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c index 63a74c32ddc5..e33ef5bc31c5 100644 --- a/tools/perf/arch/x86/util/pmu.c +++ b/tools/perf/arch/x86/util/pmu.c | |||
@@ -1,6 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <string.h> | 2 | #include <string.h> |
3 | 3 | ||
4 | #include <linux/stddef.h> | ||
4 | #include <linux/perf_event.h> | 5 | #include <linux/perf_event.h> |
5 | 6 | ||
6 | #include "../../util/intel-pt.h" | 7 | #include "../../util/intel-pt.h" |
diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c index 06bae7023a51..950539f9a4f7 100644 --- a/tools/perf/arch/x86/util/tsc.c +++ b/tools/perf/arch/x86/util/tsc.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <stdbool.h> | 2 | #include <stdbool.h> |
3 | #include <errno.h> | 3 | #include <errno.h> |
4 | 4 | ||
5 | #include <linux/stddef.h> | ||
5 | #include <linux/perf_event.h> | 6 | #include <linux/perf_event.h> |
6 | 7 | ||
7 | #include "../../perf.h" | 8 | #include "../../perf.h" |
diff --git a/tools/perf/bench/Build b/tools/perf/bench/Build index 60bf11943047..eafce1a130a1 100644 --- a/tools/perf/bench/Build +++ b/tools/perf/bench/Build | |||
@@ -7,6 +7,7 @@ perf-y += futex-wake-parallel.o | |||
7 | perf-y += futex-requeue.o | 7 | perf-y += futex-requeue.o |
8 | perf-y += futex-lock-pi.o | 8 | perf-y += futex-lock-pi.o |
9 | 9 | ||
10 | perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-lib.o | ||
10 | perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o | 11 | perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o |
11 | perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o | 12 | perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o |
12 | 13 | ||
diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm.S b/tools/perf/bench/mem-memcpy-x86-64-asm.S index b43f8d2a34ec..9ad015a1e202 100644 --- a/tools/perf/bench/mem-memcpy-x86-64-asm.S +++ b/tools/perf/bench/mem-memcpy-x86-64-asm.S | |||
@@ -6,6 +6,7 @@ | |||
6 | #define altinstr_replacement text | 6 | #define altinstr_replacement text |
7 | #define globl p2align 4; .globl | 7 | #define globl p2align 4; .globl |
8 | #define _ASM_EXTABLE_FAULT(x, y) | 8 | #define _ASM_EXTABLE_FAULT(x, y) |
9 | #define _ASM_EXTABLE(x, y) | ||
9 | 10 | ||
10 | #include "../../arch/x86/lib/memcpy_64.S" | 11 | #include "../../arch/x86/lib/memcpy_64.S" |
11 | /* | 12 | /* |
diff --git a/tools/perf/bench/mem-memcpy-x86-64-lib.c b/tools/perf/bench/mem-memcpy-x86-64-lib.c new file mode 100644 index 000000000000..4130734dde84 --- /dev/null +++ b/tools/perf/bench/mem-memcpy-x86-64-lib.c | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * From code in arch/x86/lib/usercopy_64.c, copied to keep tools/ copy | ||
3 | * of the kernel's arch/x86/lib/memcpy_64.s used in 'perf bench mem memcpy' | ||
4 | * happy. | ||
5 | */ | ||
6 | #include <linux/types.h> | ||
7 | |||
8 | unsigned long __memcpy_mcsafe(void *dst, const void *src, size_t cnt); | ||
9 | unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len); | ||
10 | |||
11 | unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len) | ||
12 | { | ||
13 | for (; len; --len, to++, from++) { | ||
14 | /* | ||
15 | * Call the assembly routine back directly since | ||
16 | * memcpy_mcsafe() may silently fallback to memcpy. | ||
17 | */ | ||
18 | unsigned long rem = __memcpy_mcsafe(to, from, 1); | ||
19 | |||
20 | if (rem) | ||
21 | break; | ||
22 | } | ||
23 | return len; | ||
24 | } | ||
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index a1a97956136f..d215714f48df 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <time.h> | 5 | #include <time.h> |
6 | #include <stdbool.h> | 6 | #include <stdbool.h> |
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/stddef.h> | ||
8 | #include <linux/perf_event.h> | 9 | #include <linux/perf_event.h> |
9 | 10 | ||
10 | extern bool test_attr__enabled; | 11 | extern bool test_attr__enabled; |
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index 90d4577a92dc..6d7fe44aadc0 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #ifndef __PERF_HEADER_H | 2 | #ifndef __PERF_HEADER_H |
3 | #define __PERF_HEADER_H | 3 | #define __PERF_HEADER_H |
4 | 4 | ||
5 | #include <linux/stddef.h> | ||
5 | #include <linux/perf_event.h> | 6 | #include <linux/perf_event.h> |
6 | #include <sys/types.h> | 7 | #include <sys/types.h> |
7 | #include <stdbool.h> | 8 | #include <stdbool.h> |
diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h index 760558dcfd18..cae1a9a39722 100644 --- a/tools/perf/util/namespaces.h +++ b/tools/perf/util/namespaces.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define __PERF_NAMESPACES_H | 10 | #define __PERF_NAMESPACES_H |
11 | 11 | ||
12 | #include <sys/types.h> | 12 | #include <sys/types.h> |
13 | #include <linux/stddef.h> | ||
13 | #include <linux/perf_event.h> | 14 | #include <linux/perf_event.h> |
14 | #include <linux/refcount.h> | 15 | #include <linux/refcount.h> |
15 | #include <linux/types.h> | 16 | #include <linux/types.h> |