diff options
Diffstat (limited to 'tools/perf')
411 files changed, 539 insertions, 176 deletions
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index e397453e5a46..63526f4416ea 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt | |||
@@ -8,8 +8,8 @@ perf-record - Run a command and record its profile into perf.data | |||
8 | SYNOPSIS | 8 | SYNOPSIS |
9 | -------- | 9 | -------- |
10 | [verse] | 10 | [verse] |
11 | 'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] <command> | 11 | 'perf record' [-e <EVENT> | --event=EVENT] [-a] <command> |
12 | 'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] -- <command> [<options>] | 12 | 'perf record' [-e <EVENT> | --event=EVENT] [-a] -- <command> [<options>] |
13 | 13 | ||
14 | DESCRIPTION | 14 | DESCRIPTION |
15 | ----------- | 15 | ----------- |
diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST index 62072822dc85..627b7cada144 100644 --- a/tools/perf/MANIFEST +++ b/tools/perf/MANIFEST | |||
@@ -1,34 +1,8 @@ | |||
1 | tools/perf | 1 | tools/perf |
2 | tools/arch/alpha/include/asm/barrier.h | 2 | tools/arch |
3 | tools/arch/arm/include/asm/barrier.h | ||
4 | tools/arch/arm64/include/asm/barrier.h | ||
5 | tools/arch/ia64/include/asm/barrier.h | ||
6 | tools/arch/mips/include/asm/barrier.h | ||
7 | tools/arch/powerpc/include/asm/barrier.h | ||
8 | tools/arch/s390/include/asm/barrier.h | ||
9 | tools/arch/sh/include/asm/barrier.h | ||
10 | tools/arch/sparc/include/asm/barrier.h | ||
11 | tools/arch/sparc/include/asm/barrier_32.h | ||
12 | tools/arch/sparc/include/asm/barrier_64.h | ||
13 | tools/arch/tile/include/asm/barrier.h | ||
14 | tools/arch/x86/include/asm/barrier.h | ||
15 | tools/arch/x86/include/asm/cmpxchg.h | ||
16 | tools/arch/x86/include/asm/cpufeatures.h | ||
17 | tools/arch/x86/include/asm/disabled-features.h | ||
18 | tools/arch/x86/include/asm/required-features.h | ||
19 | tools/arch/x86/include/uapi/asm/svm.h | ||
20 | tools/arch/x86/include/uapi/asm/vmx.h | ||
21 | tools/arch/x86/include/uapi/asm/kvm.h | ||
22 | tools/arch/x86/include/uapi/asm/kvm_perf.h | ||
23 | tools/arch/x86/lib/memcpy_64.S | ||
24 | tools/arch/x86/lib/memset_64.S | ||
25 | tools/arch/s390/include/uapi/asm/kvm_perf.h | ||
26 | tools/arch/s390/include/uapi/asm/sie.h | ||
27 | tools/arch/xtensa/include/asm/barrier.h | ||
28 | tools/scripts | 3 | tools/scripts |
29 | tools/build | 4 | tools/build |
30 | tools/arch/x86/include/asm/atomic.h | 5 | tools/include |
31 | tools/arch/x86/include/asm/rmwcc.h | ||
32 | tools/lib/traceevent | 6 | tools/lib/traceevent |
33 | tools/lib/api | 7 | tools/lib/api |
34 | tools/lib/bpf | 8 | tools/lib/bpf |
@@ -42,60 +16,3 @@ tools/lib/find_bit.c | |||
42 | tools/lib/bitmap.c | 16 | tools/lib/bitmap.c |
43 | tools/lib/str_error_r.c | 17 | tools/lib/str_error_r.c |
44 | tools/lib/vsprintf.c | 18 | tools/lib/vsprintf.c |
45 | tools/include/asm/alternative-asm.h | ||
46 | tools/include/asm/atomic.h | ||
47 | tools/include/asm/barrier.h | ||
48 | tools/include/asm/bug.h | ||
49 | tools/include/asm-generic/atomic-gcc.h | ||
50 | tools/include/asm-generic/barrier.h | ||
51 | tools/include/asm-generic/bitops/arch_hweight.h | ||
52 | tools/include/asm-generic/bitops/atomic.h | ||
53 | tools/include/asm-generic/bitops/const_hweight.h | ||
54 | tools/include/asm-generic/bitops/__ffs.h | ||
55 | tools/include/asm-generic/bitops/__ffz.h | ||
56 | tools/include/asm-generic/bitops/__fls.h | ||
57 | tools/include/asm-generic/bitops/find.h | ||
58 | tools/include/asm-generic/bitops/fls64.h | ||
59 | tools/include/asm-generic/bitops/fls.h | ||
60 | tools/include/asm-generic/bitops/hweight.h | ||
61 | tools/include/asm-generic/bitops.h | ||
62 | tools/include/linux/atomic.h | ||
63 | tools/include/linux/bitops.h | ||
64 | tools/include/linux/compiler.h | ||
65 | tools/include/linux/compiler-gcc.h | ||
66 | tools/include/linux/coresight-pmu.h | ||
67 | tools/include/linux/bug.h | ||
68 | tools/include/linux/filter.h | ||
69 | tools/include/linux/hash.h | ||
70 | tools/include/linux/kernel.h | ||
71 | tools/include/linux/list.h | ||
72 | tools/include/linux/log2.h | ||
73 | tools/include/uapi/asm-generic/fcntl.h | ||
74 | tools/include/uapi/asm-generic/ioctls.h | ||
75 | tools/include/uapi/asm-generic/mman-common.h | ||
76 | tools/include/uapi/asm-generic/mman.h | ||
77 | tools/include/uapi/drm/drm.h | ||
78 | tools/include/uapi/drm/i915_drm.h | ||
79 | tools/include/uapi/linux/bpf.h | ||
80 | tools/include/uapi/linux/bpf_common.h | ||
81 | tools/include/uapi/linux/fcntl.h | ||
82 | tools/include/uapi/linux/hw_breakpoint.h | ||
83 | tools/include/uapi/linux/kvm.h | ||
84 | tools/include/uapi/linux/mman.h | ||
85 | tools/include/uapi/linux/perf_event.h | ||
86 | tools/include/uapi/linux/sched.h | ||
87 | tools/include/uapi/linux/stat.h | ||
88 | tools/include/uapi/linux/vhost.h | ||
89 | tools/include/uapi/sound/asound.h | ||
90 | tools/include/linux/poison.h | ||
91 | tools/include/linux/rbtree.h | ||
92 | tools/include/linux/rbtree_augmented.h | ||
93 | tools/include/linux/refcount.h | ||
94 | tools/include/linux/string.h | ||
95 | tools/include/linux/stringify.h | ||
96 | tools/include/linux/types.h | ||
97 | tools/include/linux/err.h | ||
98 | tools/include/linux/bitmap.h | ||
99 | tools/include/linux/time64.h | ||
100 | tools/arch/*/include/uapi/asm/mman.h | ||
101 | tools/arch/*/include/uapi/asm/perf_regs.h | ||
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 32a64e619028..225454416ed5 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | # | 2 | # |
2 | # This is a simple wrapper Makefile that calls the main Makefile.perf | 3 | # This is a simple wrapper Makefile that calls the main Makefile.perf |
3 | # with a -j option to do parallel builds | 4 | # with a -j option to do parallel builds |
diff --git a/tools/perf/arch/arm/annotate/instructions.c b/tools/perf/arch/arm/annotate/instructions.c index 1ce0872b1726..b39b16395aac 100644 --- a/tools/perf/arch/arm/annotate/instructions.c +++ b/tools/perf/arch/arm/annotate/instructions.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <regex.h> | 3 | #include <regex.h> |
3 | 4 | ||
diff --git a/tools/perf/arch/arm/include/dwarf-regs-table.h b/tools/perf/arch/arm/include/dwarf-regs-table.h index f298d034c37b..5a45046fab72 100644 --- a/tools/perf/arch/arm/include/dwarf-regs-table.h +++ b/tools/perf/arch/arm/include/dwarf-regs-table.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef DEFINE_DWARF_REGSTR_TABLE | 2 | #ifdef DEFINE_DWARF_REGSTR_TABLE |
2 | /* This is included in perf/util/dwarf-regs.c */ | 3 | /* This is included in perf/util/dwarf-regs.c */ |
3 | 4 | ||
diff --git a/tools/perf/arch/arm/include/perf_regs.h b/tools/perf/arch/arm/include/perf_regs.h index f619c9c5a4bf..ed20e0253e25 100644 --- a/tools/perf/arch/arm/include/perf_regs.h +++ b/tools/perf/arch/arm/include/perf_regs.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef ARCH_PERF_REGS_H | 2 | #ifndef ARCH_PERF_REGS_H |
2 | #define ARCH_PERF_REGS_H | 3 | #define ARCH_PERF_REGS_H |
3 | 4 | ||
diff --git a/tools/perf/arch/arm/tests/dwarf-unwind.c b/tools/perf/arch/arm/tests/dwarf-unwind.c index 62eff847f91c..8cb347760233 100644 --- a/tools/perf/arch/arm/tests/dwarf-unwind.c +++ b/tools/perf/arch/arm/tests/dwarf-unwind.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | #include "perf_regs.h" | 3 | #include "perf_regs.h" |
3 | #include "thread.h" | 4 | #include "thread.h" |
diff --git a/tools/perf/arch/arm/tests/regs_load.S b/tools/perf/arch/arm/tests/regs_load.S index e09e983946fe..6e2495cc4517 100644 --- a/tools/perf/arch/arm/tests/regs_load.S +++ b/tools/perf/arch/arm/tests/regs_load.S | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #include <linux/linkage.h> | 2 | #include <linux/linkage.h> |
2 | 3 | ||
3 | #define R0 0x00 | 4 | #define R0 0x00 |
diff --git a/tools/perf/arch/arm/util/unwind-libdw.c b/tools/perf/arch/arm/util/unwind-libdw.c index bacfa00fca39..36ba4c69c3c5 100644 --- a/tools/perf/arch/arm/util/unwind-libdw.c +++ b/tools/perf/arch/arm/util/unwind-libdw.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <elfutils/libdwfl.h> | 2 | #include <elfutils/libdwfl.h> |
2 | #include "../../util/unwind-libdw.h" | 3 | #include "../../util/unwind-libdw.h" |
3 | #include "../../util/perf_regs.h" | 4 | #include "../../util/perf_regs.h" |
diff --git a/tools/perf/arch/arm/util/unwind-libunwind.c b/tools/perf/arch/arm/util/unwind-libunwind.c index 62c397ed3d97..3a550225dfaf 100644 --- a/tools/perf/arch/arm/util/unwind-libunwind.c +++ b/tools/perf/arch/arm/util/unwind-libunwind.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | 2 | ||
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <libunwind.h> | 4 | #include <libunwind.h> |
diff --git a/tools/perf/arch/arm64/Makefile b/tools/perf/arch/arm64/Makefile index eebe1ec9d2ee..91de4860faad 100644 --- a/tools/perf/arch/arm64/Makefile +++ b/tools/perf/arch/arm64/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | ifndef NO_DWARF | 2 | ifndef NO_DWARF |
2 | PERF_HAVE_DWARF_REGS := 1 | 3 | PERF_HAVE_DWARF_REGS := 1 |
3 | endif | 4 | endif |
diff --git a/tools/perf/arch/arm64/annotate/instructions.c b/tools/perf/arch/arm64/annotate/instructions.c index 8f1908756cb6..9a3e0523e2c9 100644 --- a/tools/perf/arch/arm64/annotate/instructions.c +++ b/tools/perf/arch/arm64/annotate/instructions.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <regex.h> | 3 | #include <regex.h> |
3 | 4 | ||
diff --git a/tools/perf/arch/arm64/include/dwarf-regs-table.h b/tools/perf/arch/arm64/include/dwarf-regs-table.h index 36e375f5a211..177b2855f797 100644 --- a/tools/perf/arch/arm64/include/dwarf-regs-table.h +++ b/tools/perf/arch/arm64/include/dwarf-regs-table.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef DEFINE_DWARF_REGSTR_TABLE | 2 | #ifdef DEFINE_DWARF_REGSTR_TABLE |
2 | /* This is included in perf/util/dwarf-regs.c */ | 3 | /* This is included in perf/util/dwarf-regs.c */ |
3 | 4 | ||
diff --git a/tools/perf/arch/arm64/include/perf_regs.h b/tools/perf/arch/arm64/include/perf_regs.h index 4e5af27e3fbf..baaa5e64a3fb 100644 --- a/tools/perf/arch/arm64/include/perf_regs.h +++ b/tools/perf/arch/arm64/include/perf_regs.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef ARCH_PERF_REGS_H | 2 | #ifndef ARCH_PERF_REGS_H |
2 | #define ARCH_PERF_REGS_H | 3 | #define ARCH_PERF_REGS_H |
3 | 4 | ||
diff --git a/tools/perf/arch/arm64/tests/dwarf-unwind.c b/tools/perf/arch/arm64/tests/dwarf-unwind.c index cf04a4c91c59..e907f0f4c20c 100644 --- a/tools/perf/arch/arm64/tests/dwarf-unwind.c +++ b/tools/perf/arch/arm64/tests/dwarf-unwind.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | #include "perf_regs.h" | 3 | #include "perf_regs.h" |
3 | #include "thread.h" | 4 | #include "thread.h" |
diff --git a/tools/perf/arch/arm64/tests/regs_load.S b/tools/perf/arch/arm64/tests/regs_load.S index 025b46e579a6..07042511dca9 100644 --- a/tools/perf/arch/arm64/tests/regs_load.S +++ b/tools/perf/arch/arm64/tests/regs_load.S | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #include <linux/linkage.h> | 2 | #include <linux/linkage.h> |
2 | 3 | ||
3 | .text | 4 | .text |
diff --git a/tools/perf/arch/arm64/util/unwind-libunwind.c b/tools/perf/arch/arm64/util/unwind-libunwind.c index b415dfdbccca..002520d4036b 100644 --- a/tools/perf/arch/arm64/util/unwind-libunwind.c +++ b/tools/perf/arch/arm64/util/unwind-libunwind.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | 3 | ||
3 | #ifndef REMOTE_UNWIND_LIBUNWIND | 4 | #ifndef REMOTE_UNWIND_LIBUNWIND |
diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c index 6b40e9f01740..8c0cfeb55f8e 100644 --- a/tools/perf/arch/common.c +++ b/tools/perf/arch/common.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <sys/utsname.h> | 3 | #include <sys/utsname.h> |
3 | #include "common.h" | 4 | #include "common.h" |
diff --git a/tools/perf/arch/common.h b/tools/perf/arch/common.h index 6b01c736b7d9..a1546509ad24 100644 --- a/tools/perf/arch/common.h +++ b/tools/perf/arch/common.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef ARCH_PERF_COMMON_H | 2 | #ifndef ARCH_PERF_COMMON_H |
2 | #define ARCH_PERF_COMMON_H | 3 | #define ARCH_PERF_COMMON_H |
3 | 4 | ||
diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile index cc3930904d68..42dab7c8f508 100644 --- a/tools/perf/arch/powerpc/Makefile +++ b/tools/perf/arch/powerpc/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | ifndef NO_DWARF | 2 | ifndef NO_DWARF |
2 | PERF_HAVE_DWARF_REGS := 1 | 3 | PERF_HAVE_DWARF_REGS := 1 |
3 | endif | 4 | endif |
diff --git a/tools/perf/arch/powerpc/annotate/instructions.c b/tools/perf/arch/powerpc/annotate/instructions.c index 3c4004db81b9..b7bc04980fe8 100644 --- a/tools/perf/arch/powerpc/annotate/instructions.c +++ b/tools/perf/arch/powerpc/annotate/instructions.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | static struct ins_ops *powerpc__associate_instruction_ops(struct arch *arch, const char *name) | 2 | static struct ins_ops *powerpc__associate_instruction_ops(struct arch *arch, const char *name) |
2 | { | 3 | { |
3 | int i; | 4 | int i; |
diff --git a/tools/perf/arch/powerpc/include/arch-tests.h b/tools/perf/arch/powerpc/include/arch-tests.h index 84d8dedef2ed..1c7be75cbc78 100644 --- a/tools/perf/arch/powerpc/include/arch-tests.h +++ b/tools/perf/arch/powerpc/include/arch-tests.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef ARCH_TESTS_H | 2 | #ifndef ARCH_TESTS_H |
2 | #define ARCH_TESTS_H | 3 | #define ARCH_TESTS_H |
3 | 4 | ||
diff --git a/tools/perf/arch/powerpc/include/dwarf-regs-table.h b/tools/perf/arch/powerpc/include/dwarf-regs-table.h index db4730f5585c..66dc015a733d 100644 --- a/tools/perf/arch/powerpc/include/dwarf-regs-table.h +++ b/tools/perf/arch/powerpc/include/dwarf-regs-table.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef DEFINE_DWARF_REGSTR_TABLE | 2 | #ifdef DEFINE_DWARF_REGSTR_TABLE |
2 | /* This is included in perf/util/dwarf-regs.c */ | 3 | /* This is included in perf/util/dwarf-regs.c */ |
3 | 4 | ||
diff --git a/tools/perf/arch/powerpc/include/perf_regs.h b/tools/perf/arch/powerpc/include/perf_regs.h index c12f4e804f66..00e37b106913 100644 --- a/tools/perf/arch/powerpc/include/perf_regs.h +++ b/tools/perf/arch/powerpc/include/perf_regs.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef ARCH_PERF_REGS_H | 2 | #ifndef ARCH_PERF_REGS_H |
2 | #define ARCH_PERF_REGS_H | 3 | #define ARCH_PERF_REGS_H |
3 | 4 | ||
diff --git a/tools/perf/arch/powerpc/tests/arch-tests.c b/tools/perf/arch/powerpc/tests/arch-tests.c index e24f46241f40..8c3fbd4af817 100644 --- a/tools/perf/arch/powerpc/tests/arch-tests.c +++ b/tools/perf/arch/powerpc/tests/arch-tests.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | #include "tests/tests.h" | 3 | #include "tests/tests.h" |
3 | #include "arch-tests.h" | 4 | #include "arch-tests.h" |
diff --git a/tools/perf/arch/powerpc/tests/dwarf-unwind.c b/tools/perf/arch/powerpc/tests/dwarf-unwind.c index 0bac3137ccbd..30cbbd6d5be0 100644 --- a/tools/perf/arch/powerpc/tests/dwarf-unwind.c +++ b/tools/perf/arch/powerpc/tests/dwarf-unwind.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | #include "perf_regs.h" | 3 | #include "perf_regs.h" |
3 | #include "thread.h" | 4 | #include "thread.h" |
diff --git a/tools/perf/arch/powerpc/tests/regs_load.S b/tools/perf/arch/powerpc/tests/regs_load.S index d76c9a32f327..36a20b0033f9 100644 --- a/tools/perf/arch/powerpc/tests/regs_load.S +++ b/tools/perf/arch/powerpc/tests/regs_load.S | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #include <linux/linkage.h> | 2 | #include <linux/linkage.h> |
2 | 3 | ||
3 | /* Offset is based on macros from arch/powerpc/include/uapi/asm/ptrace.h. */ | 4 | /* Offset is based on macros from arch/powerpc/include/uapi/asm/ptrace.h. */ |
diff --git a/tools/perf/arch/powerpc/util/book3s_hcalls.h b/tools/perf/arch/powerpc/util/book3s_hcalls.h index 0dd6b7f2d44f..54cfa0530e86 100644 --- a/tools/perf/arch/powerpc/util/book3s_hcalls.h +++ b/tools/perf/arch/powerpc/util/book3s_hcalls.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef ARCH_PERF_BOOK3S_HV_HCALLS_H | 2 | #ifndef ARCH_PERF_BOOK3S_HV_HCALLS_H |
2 | #define ARCH_PERF_BOOK3S_HV_HCALLS_H | 3 | #define ARCH_PERF_BOOK3S_HV_HCALLS_H |
3 | 4 | ||
diff --git a/tools/perf/arch/powerpc/util/book3s_hv_exits.h b/tools/perf/arch/powerpc/util/book3s_hv_exits.h index e68ba2da8970..853b95d1e139 100644 --- a/tools/perf/arch/powerpc/util/book3s_hv_exits.h +++ b/tools/perf/arch/powerpc/util/book3s_hv_exits.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef ARCH_PERF_BOOK3S_HV_EXITS_H | 2 | #ifndef ARCH_PERF_BOOK3S_HV_EXITS_H |
2 | #define ARCH_PERF_BOOK3S_HV_EXITS_H | 3 | #define ARCH_PERF_BOOK3S_HV_EXITS_H |
3 | 4 | ||
diff --git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c index 9aaa6f5a9347..7a4cf80c207a 100644 --- a/tools/perf/arch/powerpc/util/header.c +++ b/tools/perf/arch/powerpc/util/header.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <unistd.h> | 3 | #include <unistd.h> |
3 | #include <stdio.h> | 4 | #include <stdio.h> |
diff --git a/tools/perf/arch/powerpc/util/kvm-stat.c b/tools/perf/arch/powerpc/util/kvm-stat.c index 249723f0e6a9..596ad6aedaac 100644 --- a/tools/perf/arch/powerpc/util/kvm-stat.c +++ b/tools/perf/arch/powerpc/util/kvm-stat.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include "util/kvm-stat.h" | 3 | #include "util/kvm-stat.h" |
3 | #include "util/parse-events.h" | 4 | #include "util/parse-events.h" |
diff --git a/tools/perf/arch/powerpc/util/perf_regs.c b/tools/perf/arch/powerpc/util/perf_regs.c index f860dc411f69..ec50939b0418 100644 --- a/tools/perf/arch/powerpc/util/perf_regs.c +++ b/tools/perf/arch/powerpc/util/perf_regs.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <string.h> | 3 | #include <string.h> |
3 | #include <regex.h> | 4 | #include <regex.h> |
diff --git a/tools/perf/arch/powerpc/util/unwind-libdw.c b/tools/perf/arch/powerpc/util/unwind-libdw.c index 3a24b3c43273..7a1f05ef2fc0 100644 --- a/tools/perf/arch/powerpc/util/unwind-libdw.c +++ b/tools/perf/arch/powerpc/util/unwind-libdw.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <elfutils/libdwfl.h> | 2 | #include <elfutils/libdwfl.h> |
2 | #include "../../util/unwind-libdw.h" | 3 | #include "../../util/unwind-libdw.h" |
3 | #include "../../util/perf_regs.h" | 4 | #include "../../util/perf_regs.h" |
diff --git a/tools/perf/arch/s390/annotate/instructions.c b/tools/perf/arch/s390/annotate/instructions.c index 745b4b1b8b21..c9a81673e8aa 100644 --- a/tools/perf/arch/s390/annotate/instructions.c +++ b/tools/perf/arch/s390/annotate/instructions.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | static struct ins_ops *s390__associate_ins_ops(struct arch *arch, const char *name) | 2 | static struct ins_ops *s390__associate_ins_ops(struct arch *arch, const char *name) |
2 | { | 3 | { |
3 | struct ins_ops *ops = NULL; | 4 | struct ins_ops *ops = NULL; |
diff --git a/tools/perf/arch/s390/include/dwarf-regs-table.h b/tools/perf/arch/s390/include/dwarf-regs-table.h index 9da74a933bd6..792d4c277225 100644 --- a/tools/perf/arch/s390/include/dwarf-regs-table.h +++ b/tools/perf/arch/s390/include/dwarf-regs-table.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef DEFINE_DWARF_REGSTR_TABLE | 2 | #ifdef DEFINE_DWARF_REGSTR_TABLE |
2 | /* This is included in perf/util/dwarf-regs.c */ | 3 | /* This is included in perf/util/dwarf-regs.c */ |
3 | 4 | ||
diff --git a/tools/perf/arch/s390/util/Build b/tools/perf/arch/s390/util/Build index bd518b623d7a..5bd7b9260cc0 100644 --- a/tools/perf/arch/s390/util/Build +++ b/tools/perf/arch/s390/util/Build | |||
@@ -1,5 +1,4 @@ | |||
1 | libperf-y += header.o | 1 | libperf-y += header.o |
2 | libperf-y += sym-handling.o | ||
3 | libperf-y += kvm-stat.o | 2 | libperf-y += kvm-stat.o |
4 | 3 | ||
5 | libperf-$(CONFIG_DWARF) += dwarf-regs.o | 4 | libperf-$(CONFIG_DWARF) += dwarf-regs.o |
diff --git a/tools/perf/arch/s390/util/dwarf-regs.c b/tools/perf/arch/s390/util/dwarf-regs.c index 0469df02ee62..0dff5b2ed1e5 100644 --- a/tools/perf/arch/s390/util/dwarf-regs.c +++ b/tools/perf/arch/s390/util/dwarf-regs.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Mapping of DWARF debug register numbers into register names. | 3 | * Mapping of DWARF debug register numbers into register names. |
3 | * | 4 | * |
diff --git a/tools/perf/arch/s390/util/machine.c b/tools/perf/arch/s390/util/machine.c index b9a95a1a8e69..0b2054007314 100644 --- a/tools/perf/arch/s390/util/machine.c +++ b/tools/perf/arch/s390/util/machine.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <unistd.h> | 2 | #include <unistd.h> |
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include <string.h> | 4 | #include <string.h> |
diff --git a/tools/perf/arch/s390/util/sym-handling.c b/tools/perf/arch/s390/util/sym-handling.c deleted file mode 100644 index e103f6e46afe..000000000000 --- a/tools/perf/arch/s390/util/sym-handling.c +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * Architecture specific ELF symbol handling and relocation mapping. | ||
3 | * | ||
4 | * Copyright 2017 IBM Corp. | ||
5 | * Author(s): Thomas Richter <tmricht@linux.vnet.ibm.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License (version 2 only) | ||
9 | * as published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include "symbol.h" | ||
13 | |||
14 | #ifdef HAVE_LIBELF_SUPPORT | ||
15 | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) | ||
16 | { | ||
17 | if (ehdr.e_type == ET_EXEC) | ||
18 | return false; | ||
19 | return ehdr.e_type == ET_REL || ehdr.e_type == ET_DYN; | ||
20 | } | ||
21 | |||
22 | void arch__adjust_sym_map_offset(GElf_Sym *sym, | ||
23 | GElf_Shdr *shdr __maybe_unused, | ||
24 | struct map *map) | ||
25 | { | ||
26 | if (map->type == MAP__FUNCTION) | ||
27 | sym->st_value += map->start; | ||
28 | } | ||
29 | #endif | ||
diff --git a/tools/perf/arch/sh/include/dwarf-regs-table.h b/tools/perf/arch/sh/include/dwarf-regs-table.h index 3a2deaf3dab4..900e69619970 100644 --- a/tools/perf/arch/sh/include/dwarf-regs-table.h +++ b/tools/perf/arch/sh/include/dwarf-regs-table.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef DEFINE_DWARF_REGSTR_TABLE | 2 | #ifdef DEFINE_DWARF_REGSTR_TABLE |
2 | /* This is included in perf/util/dwarf-regs.c */ | 3 | /* This is included in perf/util/dwarf-regs.c */ |
3 | 4 | ||
diff --git a/tools/perf/arch/sparc/include/dwarf-regs-table.h b/tools/perf/arch/sparc/include/dwarf-regs-table.h index 12c07619002c..35ede84a6b0d 100644 --- a/tools/perf/arch/sparc/include/dwarf-regs-table.h +++ b/tools/perf/arch/sparc/include/dwarf-regs-table.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef DEFINE_DWARF_REGSTR_TABLE | 2 | #ifdef DEFINE_DWARF_REGSTR_TABLE |
2 | /* This is included in perf/util/dwarf-regs.c */ | 3 | /* This is included in perf/util/dwarf-regs.c */ |
3 | 4 | ||
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile index 9a628a24c5c9..d74eaa7aa927 100644 --- a/tools/perf/arch/x86/Makefile +++ b/tools/perf/arch/x86/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | ifndef NO_DWARF | 2 | ifndef NO_DWARF |
2 | PERF_HAVE_DWARF_REGS := 1 | 3 | PERF_HAVE_DWARF_REGS := 1 |
3 | endif | 4 | endif |
diff --git a/tools/perf/arch/x86/annotate/instructions.c b/tools/perf/arch/x86/annotate/instructions.c index d84b72063a30..4adfb4ce2864 100644 --- a/tools/perf/arch/x86/annotate/instructions.c +++ b/tools/perf/arch/x86/annotate/instructions.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | static struct ins x86__instructions[] = { | 2 | static struct ins x86__instructions[] = { |
2 | { .name = "add", .ops = &mov_ops, }, | 3 | { .name = "add", .ops = &mov_ops, }, |
3 | { .name = "addl", .ops = &mov_ops, }, | 4 | { .name = "addl", .ops = &mov_ops, }, |
diff --git a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh b/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh index 49a18b9ad9cf..029a72c20b19 100755 --- a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh +++ b/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh | |||
@@ -1,4 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | 3 | ||
3 | in="$1" | 4 | in="$1" |
4 | arch="$2" | 5 | arch="$2" |
diff --git a/tools/perf/arch/x86/include/arch-tests.h b/tools/perf/arch/x86/include/arch-tests.h index 4e0b806a7a0f..9834fdc7c59e 100644 --- a/tools/perf/arch/x86/include/arch-tests.h +++ b/tools/perf/arch/x86/include/arch-tests.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef ARCH_TESTS_H | 2 | #ifndef ARCH_TESTS_H |
2 | #define ARCH_TESTS_H | 3 | #define ARCH_TESTS_H |
3 | 4 | ||
diff --git a/tools/perf/arch/x86/include/dwarf-regs-table.h b/tools/perf/arch/x86/include/dwarf-regs-table.h index 9b5e5cbb4209..b9bd5dc9d4c0 100644 --- a/tools/perf/arch/x86/include/dwarf-regs-table.h +++ b/tools/perf/arch/x86/include/dwarf-regs-table.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef DEFINE_DWARF_REGSTR_TABLE | 2 | #ifdef DEFINE_DWARF_REGSTR_TABLE |
2 | /* This is included in perf/util/dwarf-regs.c */ | 3 | /* This is included in perf/util/dwarf-regs.c */ |
3 | 4 | ||
diff --git a/tools/perf/arch/x86/include/perf_regs.h b/tools/perf/arch/x86/include/perf_regs.h index 7df517acfef8..7f6d538f8a89 100644 --- a/tools/perf/arch/x86/include/perf_regs.h +++ b/tools/perf/arch/x86/include/perf_regs.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef ARCH_PERF_REGS_H | 2 | #ifndef ARCH_PERF_REGS_H |
2 | #define ARCH_PERF_REGS_H | 3 | #define ARCH_PERF_REGS_H |
3 | 4 | ||
diff --git a/tools/perf/arch/x86/tests/arch-tests.c b/tools/perf/arch/x86/tests/arch-tests.c index 99d66191e56c..34a078136a47 100644 --- a/tools/perf/arch/x86/tests/arch-tests.c +++ b/tools/perf/arch/x86/tests/arch-tests.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | #include "tests/tests.h" | 3 | #include "tests/tests.h" |
3 | #include "arch-tests.h" | 4 | #include "arch-tests.h" |
diff --git a/tools/perf/arch/x86/tests/dwarf-unwind.c b/tools/perf/arch/x86/tests/dwarf-unwind.c index 7f209ce827bf..95036c7a59e8 100644 --- a/tools/perf/arch/x86/tests/dwarf-unwind.c +++ b/tools/perf/arch/x86/tests/dwarf-unwind.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | #include "perf_regs.h" | 3 | #include "perf_regs.h" |
3 | #include "thread.h" | 4 | #include "thread.h" |
diff --git a/tools/perf/arch/x86/tests/insn-x86-dat-32.c b/tools/perf/arch/x86/tests/insn-x86-dat-32.c index 3cbf6fad169f..fab3c6de73fa 100644 --- a/tools/perf/arch/x86/tests/insn-x86-dat-32.c +++ b/tools/perf/arch/x86/tests/insn-x86-dat-32.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Generated by gen-insn-x86-dat.sh and gen-insn-x86-dat.awk | 3 | * Generated by gen-insn-x86-dat.sh and gen-insn-x86-dat.awk |
3 | * from insn-x86-dat-src.c for inclusion by insn-x86.c | 4 | * from insn-x86-dat-src.c for inclusion by insn-x86.c |
diff --git a/tools/perf/arch/x86/tests/insn-x86-dat-64.c b/tools/perf/arch/x86/tests/insn-x86-dat-64.c index aa512fa944dd..c57f34603b9b 100644 --- a/tools/perf/arch/x86/tests/insn-x86-dat-64.c +++ b/tools/perf/arch/x86/tests/insn-x86-dat-64.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Generated by gen-insn-x86-dat.sh and gen-insn-x86-dat.awk | 3 | * Generated by gen-insn-x86-dat.sh and gen-insn-x86-dat.awk |
3 | * from insn-x86-dat-src.c for inclusion by insn-x86.c | 4 | * from insn-x86-dat-src.c for inclusion by insn-x86.c |
diff --git a/tools/perf/arch/x86/tests/insn-x86-dat-src.c b/tools/perf/arch/x86/tests/insn-x86-dat-src.c index 6cdb65d25b79..891415b10984 100644 --- a/tools/perf/arch/x86/tests/insn-x86-dat-src.c +++ b/tools/perf/arch/x86/tests/insn-x86-dat-src.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * This file contains instructions for testing by the test titled: | 3 | * This file contains instructions for testing by the test titled: |
3 | * | 4 | * |
diff --git a/tools/perf/arch/x86/tests/insn-x86.c b/tools/perf/arch/x86/tests/insn-x86.c index b3860586a0c2..a5d24ae5810d 100644 --- a/tools/perf/arch/x86/tests/insn-x86.c +++ b/tools/perf/arch/x86/tests/insn-x86.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/types.h> | 2 | #include <linux/types.h> |
2 | 3 | ||
3 | #include "debug.h" | 4 | #include "debug.h" |
diff --git a/tools/perf/arch/x86/tests/intel-cqm.c b/tools/perf/arch/x86/tests/intel-cqm.c index 57f86b6e7d6f..90a4a8c58a62 100644 --- a/tools/perf/arch/x86/tests/intel-cqm.c +++ b/tools/perf/arch/x86/tests/intel-cqm.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "tests/tests.h" | 2 | #include "tests/tests.h" |
2 | #include "perf.h" | 3 | #include "perf.h" |
3 | #include "cloexec.h" | 4 | #include "cloexec.h" |
diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c index 5dd7efb192ce..b59678e8c1e2 100644 --- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c +++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <stdio.h> | 4 | #include <stdio.h> |
diff --git a/tools/perf/arch/x86/tests/rdpmc.c b/tools/perf/arch/x86/tests/rdpmc.c index 17fec30a0b31..7a11f02d6c6c 100644 --- a/tools/perf/arch/x86/tests/rdpmc.c +++ b/tools/perf/arch/x86/tests/rdpmc.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <unistd.h> | 3 | #include <unistd.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
diff --git a/tools/perf/arch/x86/tests/regs_load.S b/tools/perf/arch/x86/tests/regs_load.S index 60875d5c556c..bbe5a0d16e51 100644 --- a/tools/perf/arch/x86/tests/regs_load.S +++ b/tools/perf/arch/x86/tests/regs_load.S | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #include <linux/linkage.h> | 2 | #include <linux/linkage.h> |
2 | 3 | ||
3 | #define AX 0 | 4 | #define AX 0 |
diff --git a/tools/perf/arch/x86/util/group.c b/tools/perf/arch/x86/util/group.c index 37f92aa39a5d..e2f8034b8973 100644 --- a/tools/perf/arch/x86/util/group.c +++ b/tools/perf/arch/x86/util/group.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include "api/fs/fs.h" | 3 | #include "api/fs/fs.h" |
3 | #include "util/group.h" | 4 | #include "util/group.h" |
diff --git a/tools/perf/arch/x86/util/header.c b/tools/perf/arch/x86/util/header.c index a74a48db26f5..33027c5e6f92 100644 --- a/tools/perf/arch/x86/util/header.c +++ b/tools/perf/arch/x86/util/header.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <unistd.h> | 3 | #include <unistd.h> |
3 | #include <stdio.h> | 4 | #include <stdio.h> |
diff --git a/tools/perf/arch/x86/util/kvm-stat.c b/tools/perf/arch/x86/util/kvm-stat.c index bf817beca0a8..b32409a0e546 100644 --- a/tools/perf/arch/x86/util/kvm-stat.c +++ b/tools/perf/arch/x86/util/kvm-stat.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include "../../util/kvm-stat.h" | 3 | #include "../../util/kvm-stat.h" |
3 | #include <asm/svm.h> | 4 | #include <asm/svm.h> |
diff --git a/tools/perf/arch/x86/util/perf_regs.c b/tools/perf/arch/x86/util/perf_regs.c index f95edebfb716..4b2caf6d48e7 100644 --- a/tools/perf/arch/x86/util/perf_regs.c +++ b/tools/perf/arch/x86/util/perf_regs.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <string.h> | 3 | #include <string.h> |
3 | #include <regex.h> | 4 | #include <regex.h> |
diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c index 79fe07158d00..63a74c32ddc5 100644 --- a/tools/perf/arch/x86/util/pmu.c +++ b/tools/perf/arch/x86/util/pmu.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | 3 | ||
3 | #include <linux/perf_event.h> | 4 | #include <linux/perf_event.h> |
diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c index 2e5567c94e09..06bae7023a51 100644 --- a/tools/perf/arch/x86/util/tsc.c +++ b/tools/perf/arch/x86/util/tsc.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdbool.h> | 2 | #include <stdbool.h> |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | 4 | ||
diff --git a/tools/perf/arch/x86/util/unwind-libdw.c b/tools/perf/arch/x86/util/unwind-libdw.c index 38dc9bb2a7c9..fda8f4206ee4 100644 --- a/tools/perf/arch/x86/util/unwind-libdw.c +++ b/tools/perf/arch/x86/util/unwind-libdw.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <elfutils/libdwfl.h> | 2 | #include <elfutils/libdwfl.h> |
2 | #include "../../util/unwind-libdw.h" | 3 | #include "../../util/unwind-libdw.h" |
3 | #include "../../util/perf_regs.h" | 4 | #include "../../util/perf_regs.h" |
diff --git a/tools/perf/arch/x86/util/unwind-libunwind.c b/tools/perf/arch/x86/util/unwind-libunwind.c index 4f16661cbdbb..9c917f80c906 100644 --- a/tools/perf/arch/x86/util/unwind-libunwind.c +++ b/tools/perf/arch/x86/util/unwind-libunwind.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | 2 | ||
2 | #ifndef REMOTE_UNWIND_LIBUNWIND | 3 | #ifndef REMOTE_UNWIND_LIBUNWIND |
3 | #include <errno.h> | 4 | #include <errno.h> |
diff --git a/tools/perf/arch/xtensa/include/dwarf-regs-table.h b/tools/perf/arch/xtensa/include/dwarf-regs-table.h index aa0444a33fe6..d7c9f1fb4444 100644 --- a/tools/perf/arch/xtensa/include/dwarf-regs-table.h +++ b/tools/perf/arch/xtensa/include/dwarf-regs-table.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifdef DEFINE_DWARF_REGSTR_TABLE | 2 | #ifdef DEFINE_DWARF_REGSTR_TABLE |
2 | /* This is included in perf/util/dwarf-regs.c */ | 3 | /* This is included in perf/util/dwarf-regs.c */ |
3 | 4 | ||
diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h index 842ab2781cdc..6c9fcd757f31 100644 --- a/tools/perf/bench/bench.h +++ b/tools/perf/bench/bench.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef BENCH_H | 2 | #ifndef BENCH_H |
2 | #define BENCH_H | 3 | #define BENCH_H |
3 | 4 | ||
diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c index fe16b310097f..58ae6ed8f38b 100644 --- a/tools/perf/bench/futex-hash.c +++ b/tools/perf/bench/futex-hash.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2013 Davidlohr Bueso <davidlohr@hp.com> | 3 | * Copyright (C) 2013 Davidlohr Bueso <davidlohr@hp.com> |
3 | * | 4 | * |
diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c index 73a1c44ea63c..08653ae8a8c4 100644 --- a/tools/perf/bench/futex-lock-pi.c +++ b/tools/perf/bench/futex-lock-pi.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2015 Davidlohr Bueso. | 3 | * Copyright (C) 2015 Davidlohr Bueso. |
3 | */ | 4 | */ |
diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c index 41786cbea24c..1058c194608a 100644 --- a/tools/perf/bench/futex-requeue.c +++ b/tools/perf/bench/futex-requeue.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2013 Davidlohr Bueso <davidlohr@hp.com> | 3 | * Copyright (C) 2013 Davidlohr Bueso <davidlohr@hp.com> |
3 | * | 4 | * |
diff --git a/tools/perf/bench/futex-wake-parallel.c b/tools/perf/bench/futex-wake-parallel.c index 4ab12c8e016a..b4732dad9f89 100644 --- a/tools/perf/bench/futex-wake-parallel.c +++ b/tools/perf/bench/futex-wake-parallel.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2015 Davidlohr Bueso. | 3 | * Copyright (C) 2015 Davidlohr Bueso. |
3 | * | 4 | * |
diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c index 2fa49222ef8d..8c5c0b6b5c97 100644 --- a/tools/perf/bench/futex-wake.c +++ b/tools/perf/bench/futex-wake.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2013 Davidlohr Bueso <davidlohr@hp.com> | 3 | * Copyright (C) 2013 Davidlohr Bueso <davidlohr@hp.com> |
3 | * | 4 | * |
diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h index e44fd3239530..db4853f209c7 100644 --- a/tools/perf/bench/futex.h +++ b/tools/perf/bench/futex.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Glibc independent futex library for testing kernel functionality. | 3 | * Glibc independent futex library for testing kernel functionality. |
3 | * Shamelessly stolen from Darren Hart <dvhltc@us.ibm.com> | 4 | * Shamelessly stolen from Darren Hart <dvhltc@us.ibm.com> |
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c index fbd732b54047..0251dd348124 100644 --- a/tools/perf/bench/mem-functions.c +++ b/tools/perf/bench/mem-functions.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * mem-memcpy.c | 3 | * mem-memcpy.c |
3 | * | 4 | * |
diff --git a/tools/perf/bench/mem-memcpy-arch.h b/tools/perf/bench/mem-memcpy-arch.h index 5aad2a9408b0..5bcaec5601a8 100644 --- a/tools/perf/bench/mem-memcpy-arch.h +++ b/tools/perf/bench/mem-memcpy-arch.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | #ifdef HAVE_ARCH_X86_64_SUPPORT | 3 | #ifdef HAVE_ARCH_X86_64_SUPPORT |
3 | 4 | ||
diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm-def.h b/tools/perf/bench/mem-memcpy-x86-64-asm-def.h index 8c0c1a2770c8..50ae8bd58296 100644 --- a/tools/perf/bench/mem-memcpy-x86-64-asm-def.h +++ b/tools/perf/bench/mem-memcpy-x86-64-asm-def.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | MEMCPY_FN(memcpy_orig, | 3 | MEMCPY_FN(memcpy_orig, |
3 | "x86-64-unrolled", | 4 | "x86-64-unrolled", |
diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm.S b/tools/perf/bench/mem-memcpy-x86-64-asm.S index f700369bb0f6..b43f8d2a34ec 100644 --- a/tools/perf/bench/mem-memcpy-x86-64-asm.S +++ b/tools/perf/bench/mem-memcpy-x86-64-asm.S | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | /* Various wrappers to make the kernel .S file build in user-space: */ | 3 | /* Various wrappers to make the kernel .S file build in user-space: */ |
3 | 4 | ||
diff --git a/tools/perf/bench/mem-memset-arch.h b/tools/perf/bench/mem-memset-arch.h index 0d15786d9ae3..53f45482663f 100644 --- a/tools/perf/bench/mem-memset-arch.h +++ b/tools/perf/bench/mem-memset-arch.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | #ifdef HAVE_ARCH_X86_64_SUPPORT | 3 | #ifdef HAVE_ARCH_X86_64_SUPPORT |
3 | 4 | ||
diff --git a/tools/perf/bench/mem-memset-x86-64-asm-def.h b/tools/perf/bench/mem-memset-x86-64-asm-def.h index f02d028771d9..dac6d2b7c39b 100644 --- a/tools/perf/bench/mem-memset-x86-64-asm-def.h +++ b/tools/perf/bench/mem-memset-x86-64-asm-def.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | MEMSET_FN(memset_orig, | 3 | MEMSET_FN(memset_orig, |
3 | "x86-64-unrolled", | 4 | "x86-64-unrolled", |
diff --git a/tools/perf/bench/mem-memset-x86-64-asm.S b/tools/perf/bench/mem-memset-x86-64-asm.S index 58407aa24c1b..d550bd526162 100644 --- a/tools/perf/bench/mem-memset-x86-64-asm.S +++ b/tools/perf/bench/mem-memset-x86-64-asm.S | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #define memset MEMSET /* don't hide glibc's memset() */ | 2 | #define memset MEMSET /* don't hide glibc's memset() */ |
2 | #define altinstr_replacement text | 3 | #define altinstr_replacement text |
3 | #define globl p2align 4; .globl | 4 | #define globl p2align 4; .globl |
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index 469d65b21122..d95fdcc26f4b 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * numa.c | 3 | * numa.c |
3 | * | 4 | * |
diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c index 4f961e74535b..f9d7641ae833 100644 --- a/tools/perf/bench/sched-messaging.c +++ b/tools/perf/bench/sched-messaging.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * | 3 | * |
3 | * sched-messaging.c | 4 | * sched-messaging.c |
diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c index a152737370c5..0591be008f2a 100644 --- a/tools/perf/bench/sched-pipe.c +++ b/tools/perf/bench/sched-pipe.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * | 3 | * |
3 | * sched-pipe.c | 4 | * sched-pipe.c |
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index c38373195c4a..3d32aa45016d 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-annotate.c | 3 | * builtin-annotate.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c index 445e62881254..17a6bcd01aa6 100644 --- a/tools/perf/builtin-bench.c +++ b/tools/perf/builtin-bench.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-bench.c | 3 | * builtin-bench.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c index e3eb6240ced0..5f53a7ad5ef3 100644 --- a/tools/perf/builtin-buildid-cache.c +++ b/tools/perf/builtin-buildid-cache.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-buildid-cache.c | 3 | * builtin-buildid-cache.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c index fdaca16e0c74..ec2f327cd79d 100644 --- a/tools/perf/builtin-buildid-list.c +++ b/tools/perf/builtin-buildid-list.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-buildid-list.c | 3 | * builtin-buildid-list.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 475999e48f66..fd32ad08c6d4 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * This is rewrite of original c2c tool introduced in here: | 3 | * This is rewrite of original c2c tool introduced in here: |
3 | * http://lwn.net/Articles/588866/ | 4 | * http://lwn.net/Articles/588866/ |
diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c index a1d82e33282c..abfa49eaf7fd 100644 --- a/tools/perf/builtin-config.c +++ b/tools/perf/builtin-config.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-config.c | 3 | * builtin-config.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c index 46cd8490baf4..dde25d4ca56d 100644 --- a/tools/perf/builtin-data.c +++ b/tools/perf/builtin-data.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include "builtin.h" | 3 | #include "builtin.h" |
3 | #include "perf.h" | 4 | #include "perf.h" |
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 0cd4cf6a344b..56223bdfa205 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-diff.c | 3 | * builtin-diff.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c index 6d210e40d611..cdd145613f60 100644 --- a/tools/perf/builtin-evlist.c +++ b/tools/perf/builtin-evlist.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Builtin evlist command: Show the list of event selectors present | 3 | * Builtin evlist command: Show the list of event selectors present |
3 | * in a perf.data file. | 4 | * in a perf.data file. |
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index dbe4e4153bcf..bd1fedef3d1c 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-help.c | 3 | * builtin-help.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 2b8032908fb2..3e0e73b0dc67 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-inject.c | 3 | * builtin-inject.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 24ee68ecdd42..35d4b9c9a9e8 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "builtin.h" | 2 | #include "builtin.h" |
2 | #include "perf.h" | 3 | #include "perf.h" |
3 | 4 | ||
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index f309c3773522..5fb40368d5d1 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "builtin.h" | 2 | #include "builtin.h" |
2 | #include "perf.h" | 3 | #include "perf.h" |
3 | 4 | ||
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c index 4bf2cb4d25aa..eeedbe433776 100644 --- a/tools/perf/builtin-list.c +++ b/tools/perf/builtin-list.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-list.c | 3 | * builtin-list.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index ff98652484a7..fe69cd6b89e1 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include "builtin.h" | 4 | #include "builtin.h" |
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 0f15634ef82c..4db960085273 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <inttypes.h> | 2 | #include <inttypes.h> |
2 | #include <sys/types.h> | 3 | #include <sys/types.h> |
3 | #include <sys/stat.h> | 4 | #include <sys/stat.h> |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 56f8142ff97f..0c95ffefb6cc 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-record.c | 3 | * builtin-record.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index f9dff652dcbd..fae4b0340750 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-report.c | 3 | * builtin-report.c |
3 | * | 4 | * |
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 322b4def8411..f380d91ee609 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "builtin.h" | 2 | #include "builtin.h" |
2 | #include "perf.h" | 3 | #include "perf.h" |
3 | 4 | ||
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 3d4c3b5e1868..0fe02758de7d 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "builtin.h" | 2 | #include "builtin.h" |
2 | 3 | ||
3 | #include "perf.h" | 4 | #include "perf.h" |
@@ -586,7 +587,7 @@ static void print_sample_brstack(struct perf_sample *sample, | |||
586 | thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, to, &alt); | 587 | thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, to, &alt); |
587 | } | 588 | } |
588 | 589 | ||
589 | printf("0x%"PRIx64, from); | 590 | printf(" 0x%"PRIx64, from); |
590 | if (PRINT_FIELD(DSO)) { | 591 | if (PRINT_FIELD(DSO)) { |
591 | printf("("); | 592 | printf("("); |
592 | map__fprintf_dsoname(alf.map, stdout); | 593 | map__fprintf_dsoname(alf.map, stdout); |
@@ -681,7 +682,7 @@ static void print_sample_brstackoff(struct perf_sample *sample, | |||
681 | if (alt.map && !alt.map->dso->adjust_symbols) | 682 | if (alt.map && !alt.map->dso->adjust_symbols) |
682 | to = map__map_ip(alt.map, to); | 683 | to = map__map_ip(alt.map, to); |
683 | 684 | ||
684 | printf("0x%"PRIx64, from); | 685 | printf(" 0x%"PRIx64, from); |
685 | if (PRINT_FIELD(DSO)) { | 686 | if (PRINT_FIELD(DSO)) { |
686 | printf("("); | 687 | printf("("); |
687 | map__fprintf_dsoname(alf.map, stdout); | 688 | map__fprintf_dsoname(alf.map, stdout); |
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c index d25149456a2f..37019c5d675f 100644 --- a/tools/perf/builtin-version.c +++ b/tools/perf/builtin-version.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "builtin.h" | 2 | #include "builtin.h" |
2 | #include "perf.h" | 3 | #include "perf.h" |
3 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h index d4d19fe3d050..05745f3ce912 100644 --- a/tools/perf/builtin.h +++ b/tools/perf/builtin.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef BUILTIN_H | 2 | #ifndef BUILTIN_H |
2 | #define BUILTIN_H | 3 | #define BUILTIN_H |
3 | 4 | ||
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index 932fda54b8a6..50cd6228f506 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh | |||
@@ -1,4 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | 3 | ||
3 | HEADERS=' | 4 | HEADERS=' |
4 | include/uapi/drm/drm.h | 5 | include/uapi/drm/drm.h |
diff --git a/tools/perf/jvmti/jvmti_agent.h b/tools/perf/jvmti/jvmti_agent.h index c53a41f48b63..fe32d8344a82 100644 --- a/tools/perf/jvmti/jvmti_agent.h +++ b/tools/perf/jvmti/jvmti_agent.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __JVMTI_AGENT_H__ | 2 | #ifndef __JVMTI_AGENT_H__ |
2 | #define __JVMTI_AGENT_H__ | 3 | #define __JVMTI_AGENT_H__ |
3 | 4 | ||
diff --git a/tools/perf/jvmti/libjvmti.c b/tools/perf/jvmti/libjvmti.c index 6d710904c837..c62c9fc9a525 100644 --- a/tools/perf/jvmti/libjvmti.c +++ b/tools/perf/jvmti/libjvmti.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include <sys/types.h> | 3 | #include <sys/types.h> |
3 | #include <stdio.h> | 4 | #include <stdio.h> |
diff --git a/tools/perf/perf-archive.sh b/tools/perf/perf-archive.sh index e91930620269..0cfb3e2cefef 100644 --- a/tools/perf/perf-archive.sh +++ b/tools/perf/perf-archive.sh | |||
@@ -1,4 +1,5 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # perf archive | 3 | # perf archive |
3 | # Arnaldo Carvalho de Melo <acme@redhat.com> | 4 | # Arnaldo Carvalho de Melo <acme@redhat.com> |
4 | 5 | ||
diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh index 3ba80b2359cc..345f5d6e9ed5 100644 --- a/tools/perf/perf-completion.sh +++ b/tools/perf/perf-completion.sh | |||
@@ -1,4 +1,5 @@ | |||
1 | # perf bash and zsh completion | 1 | # perf bash and zsh completion |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | 3 | ||
3 | # Taken from git.git's completion script. | 4 | # Taken from git.git's completion script. |
4 | __my_reassemble_comp_words_by_ref() | 5 | __my_reassemble_comp_words_by_ref() |
diff --git a/tools/perf/perf-read-vdso.c b/tools/perf/perf-read-vdso.c index 764e2547c25a..8c0ca0cc428f 100644 --- a/tools/perf/perf-read-vdso.c +++ b/tools/perf/perf-read-vdso.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <string.h> | 3 | #include <string.h> |
3 | 4 | ||
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h index c11f0c76e90c..36673f98d66b 100644 --- a/tools/perf/perf-sys.h +++ b/tools/perf/perf-sys.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_SYS_H | 2 | #ifndef _PERF_SYS_H |
2 | #define _PERF_SYS_H | 3 | #define _PERF_SYS_H |
3 | 4 | ||
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 2f19e03c5c40..62b13518bc6e 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * perf.c | 3 | * perf.c |
3 | * | 4 | * |
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index dc442ba21bf6..f75f3dec7485 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_PERF_H | 2 | #ifndef _PERF_PERF_H |
2 | #define _PERF_PERF_H | 3 | #define _PERF_PERF_H |
3 | 4 | ||
diff --git a/tools/perf/pmu-events/jevents.h b/tools/perf/pmu-events/jevents.h index 611fac01913d..d87efd2685b8 100644 --- a/tools/perf/pmu-events/jevents.h +++ b/tools/perf/pmu-events/jevents.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef JEVENTS_H | 2 | #ifndef JEVENTS_H |
2 | #define JEVENTS_H 1 | 3 | #define JEVENTS_H 1 |
3 | 4 | ||
diff --git a/tools/perf/pmu-events/jsmn.h b/tools/perf/pmu-events/jsmn.h index d666b10cf25b..c7b0f6ea2a31 100644 --- a/tools/perf/pmu-events/jsmn.h +++ b/tools/perf/pmu-events/jsmn.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __JSMN_H_ | 2 | #ifndef __JSMN_H_ |
2 | #define __JSMN_H_ | 3 | #define __JSMN_H_ |
3 | 4 | ||
diff --git a/tools/perf/pmu-events/json.h b/tools/perf/pmu-events/json.h index 278ebd32cfb6..fbcd5a0590ad 100644 --- a/tools/perf/pmu-events/json.h +++ b/tools/perf/pmu-events/json.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef JSON_H | 2 | #ifndef JSON_H |
2 | #define JSON_H 1 | 3 | #define JSON_H 1 |
3 | 4 | ||
diff --git a/tools/perf/pmu-events/pmu-events.h b/tools/perf/pmu-events/pmu-events.h index 569eab3688dd..e08789ddfe6c 100644 --- a/tools/perf/pmu-events/pmu-events.h +++ b/tools/perf/pmu-events/pmu-events.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PMU_EVENTS_H | 2 | #ifndef PMU_EVENTS_H |
2 | #define PMU_EVENTS_H | 3 | #define PMU_EVENTS_H |
3 | 4 | ||
diff --git a/tools/perf/python/tracepoint.py b/tools/perf/python/tracepoint.py index eb4dbed57de7..eb76f6516247 100755 --- a/tools/perf/python/tracepoint.py +++ b/tools/perf/python/tracepoint.py | |||
@@ -1,4 +1,5 @@ | |||
1 | #! /usr/bin/python | 1 | #! /usr/bin/python |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # -*- python -*- | 3 | # -*- python -*- |
3 | # -*- coding: utf-8 -*- | 4 | # -*- coding: utf-8 -*- |
4 | 5 | ||
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL b/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL index decdeb0f6789..e8994332d7dc 100644 --- a/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL +++ b/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | use 5.010000; | 2 | use 5.010000; |
2 | use ExtUtils::MakeMaker; | 3 | use ExtUtils::MakeMaker; |
3 | # See lib/ExtUtils/MakeMaker.pm for details of how to influence | 4 | # See lib/ExtUtils/MakeMaker.pm for details of how to influence |
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py index 9e0985794e20..81a56cd2b3c1 100755 --- a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py +++ b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | |||
@@ -1,4 +1,5 @@ | |||
1 | # EventClass.py | 1 | # EventClass.py |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # | 3 | # |
3 | # This is a library defining some events types classes, which could | 4 | # This is a library defining some events types classes, which could |
4 | # be used by other scripts to analyzing the perf samples. | 5 | # be used by other scripts to analyzing the perf samples. |
diff --git a/tools/perf/scripts/python/event_analyzing_sample.py b/tools/perf/scripts/python/event_analyzing_sample.py index 163c39fa12d9..4e843b9864ec 100644 --- a/tools/perf/scripts/python/event_analyzing_sample.py +++ b/tools/perf/scripts/python/event_analyzing_sample.py | |||
@@ -1,4 +1,5 @@ | |||
1 | # event_analyzing_sample.py: general event handler in python | 1 | # event_analyzing_sample.py: general event handler in python |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # | 3 | # |
3 | # Current perf report is already very powerful with the annotation integrated, | 4 | # Current perf report is already very powerful with the annotation integrated, |
4 | # and this script is not trying to be as powerful as perf report, but | 5 | # and this script is not trying to be as powerful as perf report, but |
diff --git a/tools/perf/scripts/python/net_dropmonitor.py b/tools/perf/scripts/python/net_dropmonitor.py index 0b6ce8c253e8..a150164b44a3 100755 --- a/tools/perf/scripts/python/net_dropmonitor.py +++ b/tools/perf/scripts/python/net_dropmonitor.py | |||
@@ -1,4 +1,5 @@ | |||
1 | # Monitor the system for dropped packets and proudce a report of drop locations and counts | 1 | # Monitor the system for dropped packets and proudce a report of drop locations and counts |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | 3 | ||
3 | import os | 4 | import os |
4 | import sys | 5 | import sys |
diff --git a/tools/perf/scripts/python/netdev-times.py b/tools/perf/scripts/python/netdev-times.py index 4c6f09ac7d12..9b2050f778f1 100644 --- a/tools/perf/scripts/python/netdev-times.py +++ b/tools/perf/scripts/python/netdev-times.py | |||
@@ -1,4 +1,5 @@ | |||
1 | # Display a process of packets and processed time. | 1 | # Display a process of packets and processed time. |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # It helps us to investigate networking or network device. | 3 | # It helps us to investigate networking or network device. |
3 | # | 4 | # |
4 | # options | 5 | # options |
diff --git a/tools/perf/scripts/python/stackcollapse.py b/tools/perf/scripts/python/stackcollapse.py index 5a605f70ef32..1697b5e18c96 100755 --- a/tools/perf/scripts/python/stackcollapse.py +++ b/tools/perf/scripts/python/stackcollapse.py | |||
@@ -1,4 +1,5 @@ | |||
1 | # stackcollapse.py - format perf samples with one line per distinct call stack | 1 | # stackcollapse.py - format perf samples with one line per distinct call stack |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # | 3 | # |
3 | # This script's output has two space-separated fields. The first is a semicolon | 4 | # This script's output has two space-separated fields. The first is a semicolon |
4 | # separated stack including the program name (from the "comm" field) and the | 5 | # separated stack including the program name (from the "comm" field) and the |
diff --git a/tools/perf/scripts/python/stat-cpi.py b/tools/perf/scripts/python/stat-cpi.py index 8b60f343dd07..8410672efb8b 100644 --- a/tools/perf/scripts/python/stat-cpi.py +++ b/tools/perf/scripts/python/stat-cpi.py | |||
@@ -1,4 +1,5 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | 3 | ||
3 | data = {} | 4 | data = {} |
4 | times = [] | 5 | times = [] |
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c index c9aafed7da15..c180bbcdbef6 100644 --- a/tools/perf/tests/attr.c +++ b/tools/perf/tests/attr.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * The struct perf_event_attr test support. | 3 | * The struct perf_event_attr test support. |
3 | * | 4 | * |
diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py index 6bb50e82a3e3..907b1b2f56ad 100644 --- a/tools/perf/tests/attr.py +++ b/tools/perf/tests/attr.py | |||
@@ -1,4 +1,5 @@ | |||
1 | #! /usr/bin/python | 1 | #! /usr/bin/python |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | 3 | ||
3 | import os | 4 | import os |
4 | import sys | 5 | import sys |
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c index d233ad336463..71b9a0b613d2 100644 --- a/tools/perf/tests/backward-ring-buffer.c +++ b/tools/perf/tests/backward-ring-buffer.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Test backward bit in event attribute, read ring buffer from end to | 3 | * Test backward bit in event attribute, read ring buffer from end to |
3 | * beginning | 4 | * beginning |
diff --git a/tools/perf/tests/bitmap.c b/tools/perf/tests/bitmap.c index 0d7c06584905..47bedf25ba69 100644 --- a/tools/perf/tests/bitmap.c +++ b/tools/perf/tests/bitmap.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include <linux/bitmap.h> | 3 | #include <linux/bitmap.h> |
3 | #include "tests.h" | 4 | #include "tests.h" |
diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c index 97937e1bc53a..335b695f4970 100644 --- a/tools/perf/tests/bp_signal.c +++ b/tools/perf/tests/bp_signal.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Inspired by breakpoint overflow test done by | 3 | * Inspired by breakpoint overflow test done by |
3 | * Vince Weaver <vincent.weaver@maine.edu> for perf_event_tests | 4 | * Vince Weaver <vincent.weaver@maine.edu> for perf_event_tests |
diff --git a/tools/perf/tests/bp_signal_overflow.c b/tools/perf/tests/bp_signal_overflow.c index 61ecd8021f49..ca962559e845 100644 --- a/tools/perf/tests/bp_signal_overflow.c +++ b/tools/perf/tests/bp_signal_overflow.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Originally done by Vince Weaver <vincent.weaver@maine.edu> for | 3 | * Originally done by Vince Weaver <vincent.weaver@maine.edu> for |
3 | * perf_event_tests (git://github.com/deater/perf_event_tests) | 4 | * perf_event_tests (git://github.com/deater/perf_event_tests) |
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 377bea009163..53d06f37406a 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * builtin-test.c | 3 | * builtin-test.c |
3 | * | 4 | * |
diff --git a/tools/perf/tests/clang.c b/tools/perf/tests/clang.c index c60ec916f0f2..f45fe11dcf50 100644 --- a/tools/perf/tests/clang.c +++ b/tools/perf/tests/clang.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "tests.h" | 2 | #include "tests.h" |
2 | #include "debug.h" | 3 | #include "debug.h" |
3 | #include "util.h" | 4 | #include "util.h" |
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index 466a462b26d1..fcc8984bc329 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
3 | #include <linux/types.h> | 4 | #include <linux/types.h> |
diff --git a/tools/perf/tests/cpumap.c b/tools/perf/tests/cpumap.c index 199702252270..e78b897677bd 100644 --- a/tools/perf/tests/cpumap.c +++ b/tools/perf/tests/cpumap.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "tests.h" | 2 | #include "tests.h" |
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include "cpumap.h" | 4 | #include "cpumap.h" |
diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c index 30aead42d136..7f6c52021e41 100644 --- a/tools/perf/tests/dso-data.c +++ b/tools/perf/tests/dso-data.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <dirent.h> | 2 | #include <dirent.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c index 9ba1d216a89f..ac40e05bcab4 100644 --- a/tools/perf/tests/dwarf-unwind.c +++ b/tools/perf/tests/dwarf-unwind.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include <linux/types.h> | 3 | #include <linux/types.h> |
3 | #include <inttypes.h> | 4 | #include <inttypes.h> |
diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c index b82b981c3259..1a2686f1fcf0 100644 --- a/tools/perf/tests/event-times.c +++ b/tools/perf/tests/event-times.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <inttypes.h> | 4 | #include <inttypes.h> |
diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c index 9484da2ec6b4..f14dcd613438 100644 --- a/tools/perf/tests/event_update.c +++ b/tools/perf/tests/event_update.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include "evlist.h" | 3 | #include "evlist.h" |
3 | #include "evsel.h" | 4 | #include "evsel.h" |
diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c index d32759b6e38a..a104728ebf25 100644 --- a/tools/perf/tests/evsel-roundtrip-name.c +++ b/tools/perf/tests/evsel-roundtrip-name.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "evlist.h" | 2 | #include "evlist.h" |
2 | #include "evsel.h" | 3 | #include "evsel.h" |
3 | #include "parse-events.h" | 4 | #include "parse-events.h" |
diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c index 5fc906d26c5c..699561fa512c 100644 --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/err.h> | 2 | #include <linux/err.h> |
2 | #include <traceevent/event-parse.h> | 3 | #include <traceevent/event-parse.h> |
3 | #include "evsel.h" | 4 | #include "evsel.h" |
diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c index cb251bf523e7..01f0706995a9 100644 --- a/tools/perf/tests/expr.c +++ b/tools/perf/tests/expr.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "util/debug.h" | 2 | #include "util/debug.h" |
2 | #include "util/expr.h" | 3 | #include "util/expr.h" |
3 | #include "tests.h" | 4 | #include "tests.h" |
diff --git a/tools/perf/tests/fdarray.c b/tools/perf/tests/fdarray.c index 7d3a9e2ff897..c7c81c4a5b2b 100644 --- a/tools/perf/tests/fdarray.c +++ b/tools/perf/tests/fdarray.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <api/fd/array.h> | 2 | #include <api/fd/array.h> |
2 | #include <poll.h> | 3 | #include <poll.h> |
3 | #include "util/debug.h" | 4 | #include "util/debug.h" |
diff --git a/tools/perf/tests/hists_common.c b/tools/perf/tests/hists_common.c index 00b8dc50f3db..f7c5b613d667 100644 --- a/tools/perf/tests/hists_common.c +++ b/tools/perf/tests/hists_common.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <inttypes.h> | 2 | #include <inttypes.h> |
2 | #include "perf.h" | 3 | #include "perf.h" |
3 | #include "util/debug.h" | 4 | #include "util/debug.h" |
diff --git a/tools/perf/tests/hists_common.h b/tools/perf/tests/hists_common.h index 888254e8665c..a2de0ff0ce3a 100644 --- a/tools/perf/tests/hists_common.h +++ b/tools/perf/tests/hists_common.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_TESTS__HISTS_COMMON_H__ | 2 | #ifndef __PERF_TESTS__HISTS_COMMON_H__ |
2 | #define __PERF_TESTS__HISTS_COMMON_H__ | 3 | #define __PERF_TESTS__HISTS_COMMON_H__ |
3 | 4 | ||
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c index 8d19c0200cb7..65fe02bebbee 100644 --- a/tools/perf/tests/hists_cumulate.c +++ b/tools/perf/tests/hists_cumulate.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "perf.h" | 2 | #include "perf.h" |
2 | #include "util/debug.h" | 3 | #include "util/debug.h" |
3 | #include "util/event.h" | 4 | #include "util/event.h" |
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c index 755ca551b810..1c5bedab3c2c 100644 --- a/tools/perf/tests/hists_filter.c +++ b/tools/perf/tests/hists_filter.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "perf.h" | 2 | #include "perf.h" |
2 | #include "util/debug.h" | 3 | #include "util/debug.h" |
3 | #include "util/symbol.h" | 4 | #include "util/symbol.h" |
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c index 073c9c2856bc..9a9d06cb0222 100644 --- a/tools/perf/tests/hists_link.c +++ b/tools/perf/tests/hists_link.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "perf.h" | 2 | #include "perf.h" |
2 | #include "tests.h" | 3 | #include "tests.h" |
3 | #include "debug.h" | 4 | #include "debug.h" |
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c index 282d62eaebe2..faacb4f41460 100644 --- a/tools/perf/tests/hists_output.c +++ b/tools/perf/tests/hists_output.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "perf.h" | 2 | #include "perf.h" |
2 | #include "util/debug.h" | 3 | #include "util/debug.h" |
3 | #include "util/event.h" | 4 | #include "util/event.h" |
diff --git a/tools/perf/tests/is_printable_array.c b/tools/perf/tests/is_printable_array.c index 38f765767587..9c7b3baca4fe 100644 --- a/tools/perf/tests/is_printable_array.c +++ b/tools/perf/tests/is_printable_array.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
3 | #include "tests.h" | 4 | #include "tests.h" |
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c index 739428603b71..842d33637a18 100644 --- a/tools/perf/tests/keep-tracking.c +++ b/tools/perf/tests/keep-tracking.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/types.h> | 2 | #include <linux/types.h> |
2 | #include <unistd.h> | 3 | #include <unistd.h> |
3 | #include <sys/prctl.h> | 4 | #include <sys/prctl.h> |
diff --git a/tools/perf/tests/kmod-path.c b/tools/perf/tests/kmod-path.c index 8b9d4ba06c0e..8e57d46109de 100644 --- a/tools/perf/tests/kmod-path.c +++ b/tools/perf/tests/kmod-path.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdbool.h> | 2 | #include <stdbool.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include "tests.h" | 4 | #include "tests.h" |
diff --git a/tools/perf/tests/llvm.c b/tools/perf/tests/llvm.c index 5187b50dbafe..a039f93199e5 100644 --- a/tools/perf/tests/llvm.c +++ b/tools/perf/tests/llvm.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <bpf/libbpf.h> | 3 | #include <bpf/libbpf.h> |
3 | #include <util/llvm-utils.h> | 4 | #include <util/llvm-utils.h> |
diff --git a/tools/perf/tests/llvm.h b/tools/perf/tests/llvm.h index b83571758d83..f68b0d9b8ae2 100644 --- a/tools/perf/tests/llvm.h +++ b/tools/perf/tests/llvm.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_TEST_LLVM_H | 2 | #ifndef PERF_TEST_LLVM_H |
2 | #define PERF_TEST_LLVM_H | 3 | #define PERF_TEST_LLVM_H |
3 | 4 | ||
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index bc8a70ee46d8..5a8bf318f8a7 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | /* For the CLR_() macros */ | 4 | /* For the CLR_() macros */ |
diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c index f94a4196e7c9..3c3f3e029e33 100644 --- a/tools/perf/tests/mmap-thread-lookup.c +++ b/tools/perf/tests/mmap-thread-lookup.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <inttypes.h> | 2 | #include <inttypes.h> |
2 | #include <unistd.h> | 3 | #include <unistd.h> |
3 | #include <sys/syscall.h> | 4 | #include <sys/syscall.h> |
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c index 9cf1c35f2ad0..c531e6deb104 100644 --- a/tools/perf/tests/openat-syscall-all-cpus.c +++ b/tools/perf/tests/openat-syscall-all-cpus.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | /* For the CPU_* macros */ | 4 | /* For the CPU_* macros */ |
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c index b6ee1c41f45d..d9619d265314 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/err.h> | 2 | #include <linux/err.h> |
2 | #include "perf.h" | 3 | #include "perf.h" |
3 | #include "evlist.h" | 4 | #include "evlist.h" |
diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c index 9dc5c5d37553..00cd63f90b92 100644 --- a/tools/perf/tests/openat-syscall.c +++ b/tools/perf/tests/openat-syscall.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <api/fs/tracing_path.h> | 4 | #include <api/fs/tracing_path.h> |
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 0f0b025faa4b..f0679613bd18 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "parse-events.h" | 2 | #include "parse-events.h" |
2 | #include "evsel.h" | 3 | #include "evsel.h" |
3 | #include "evlist.h" | 4 | #include "evlist.h" |
diff --git a/tools/perf/tests/parse-no-sample-id-all.c b/tools/perf/tests/parse-no-sample-id-all.c index 91867dcc39f0..2196d1497c0c 100644 --- a/tools/perf/tests/parse-no-sample-id-all.c +++ b/tools/perf/tests/parse-no-sample-id-all.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
2 | #include <linux/types.h> | 3 | #include <linux/types.h> |
3 | #include <stddef.h> | 4 | #include <stddef.h> |
diff --git a/tools/perf/tests/perf-hooks.c b/tools/perf/tests/perf-hooks.c index bf2517d6de70..a693bcf017ea 100644 --- a/tools/perf/tests/perf-hooks.c +++ b/tools/perf/tests/perf-hooks.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <signal.h> | 2 | #include <signal.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | 4 | ||
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c index 19b650064b70..c34904d37705 100644 --- a/tools/perf/tests/perf-record.c +++ b/tools/perf/tests/perf-record.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | /* For the CLR_() macros */ | 4 | /* For the CLR_() macros */ |
diff --git a/tools/perf/tests/perf-targz-src-pkg b/tools/perf/tests/perf-targz-src-pkg index f2d9c5fe58e0..fae26b1cf08f 100755 --- a/tools/perf/tests/perf-targz-src-pkg +++ b/tools/perf/tests/perf-targz-src-pkg | |||
@@ -1,4 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # Test one of the main kernel Makefile targets to generate a perf sources tarball | 3 | # Test one of the main kernel Makefile targets to generate a perf sources tarball |
3 | # suitable for build outside the full kernel sources. | 4 | # suitable for build outside the full kernel sources. |
4 | # | 5 | # |
diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c index 9f7f589f9c54..9abca267afa9 100644 --- a/tools/perf/tests/pmu.c +++ b/tools/perf/tests/pmu.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "parse-events.h" | 2 | #include "parse-events.h" |
2 | #include "pmu.h" | 3 | #include "pmu.h" |
3 | #include "util.h" | 4 | #include "util.h" |
diff --git a/tools/perf/tests/python-use.c b/tools/perf/tests/python-use.c index 598a7e058ad4..5d2df65ada6a 100644 --- a/tools/perf/tests/python-use.c +++ b/tools/perf/tests/python-use.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Just test if we can load the python binding. | 3 | * Just test if we can load the python binding. |
3 | */ | 4 | */ |
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c index c3858487159d..3ec6302b6498 100644 --- a/tools/perf/tests/sample-parsing.c +++ b/tools/perf/tests/sample-parsing.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdbool.h> | 2 | #include <stdbool.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
diff --git a/tools/perf/tests/sdt.c b/tools/perf/tests/sdt.c index a9903d9b8bc2..5059452d27dd 100644 --- a/tools/perf/tests/sdt.c +++ b/tools/perf/tests/sdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include <sys/epoll.h> | 4 | #include <sys/epoll.h> |
diff --git a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh index 462fc755092e..7a84d73324e3 100755 --- a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh +++ b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh | |||
@@ -10,6 +10,9 @@ | |||
10 | 10 | ||
11 | . $(dirname $0)/lib/probe.sh | 11 | . $(dirname $0)/lib/probe.sh |
12 | 12 | ||
13 | ld=$(realpath /lib64/ld*.so.* | uniq) | ||
14 | libc=$(echo $ld | sed 's/ld/libc/g') | ||
15 | |||
13 | trace_libc_inet_pton_backtrace() { | 16 | trace_libc_inet_pton_backtrace() { |
14 | idx=0 | 17 | idx=0 |
15 | expected[0]="PING.*bytes" | 18 | expected[0]="PING.*bytes" |
@@ -18,8 +21,8 @@ trace_libc_inet_pton_backtrace() { | |||
18 | expected[3]=".*packets transmitted.*" | 21 | expected[3]=".*packets transmitted.*" |
19 | expected[4]="rtt min.*" | 22 | expected[4]="rtt min.*" |
20 | expected[5]="[0-9]+\.[0-9]+[[:space:]]+probe_libc:inet_pton:\([[:xdigit:]]+\)" | 23 | expected[5]="[0-9]+\.[0-9]+[[:space:]]+probe_libc:inet_pton:\([[:xdigit:]]+\)" |
21 | expected[6]=".*inet_pton[[:space:]]\(/usr/lib.*/libc-[0-9]+\.[0-9]+\.so\)$" | 24 | expected[6]=".*inet_pton[[:space:]]\($libc\)$" |
22 | expected[7]="getaddrinfo[[:space:]]\(/usr/lib.*/libc-[0-9]+\.[0-9]+\.so\)$" | 25 | expected[7]="getaddrinfo[[:space:]]\($libc\)$" |
23 | expected[8]=".*\(.*/bin/ping.*\)$" | 26 | expected[8]=".*\(.*/bin/ping.*\)$" |
24 | 27 | ||
25 | perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1 2>&1 | grep -v ^$ | while read line ; do | 28 | perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1 2>&1 | grep -v ^$ | while read line ; do |
@@ -35,7 +38,7 @@ trace_libc_inet_pton_backtrace() { | |||
35 | } | 38 | } |
36 | 39 | ||
37 | skip_if_no_perf_probe && \ | 40 | skip_if_no_perf_probe && \ |
38 | perf probe -q /lib64/libc-*.so inet_pton && \ | 41 | perf probe -q $libc inet_pton && \ |
39 | trace_libc_inet_pton_backtrace | 42 | trace_libc_inet_pton_backtrace |
40 | err=$? | 43 | err=$? |
41 | rm -f ${file} | 44 | rm -f ${file} |
diff --git a/tools/perf/tests/stat.c b/tools/perf/tests/stat.c index 7f988a939036..94250024684a 100644 --- a/tools/perf/tests/stat.c +++ b/tools/perf/tests/stat.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include "event.h" | 3 | #include "event.h" |
3 | #include "tests.h" | 4 | #include "tests.h" |
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c index d88511f6072c..725a196991a8 100644 --- a/tools/perf/tests/sw-clock.c +++ b/tools/perf/tests/sw-clock.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <unistd.h> | 4 | #include <unistd.h> |
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 2acd78555192..7d3f4bf9534f 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/time.h> | 2 | #include <sys/time.h> |
2 | #include <sys/prctl.h> | 3 | #include <sys/prctl.h> |
3 | #include <errno.h> | 4 | #include <errno.h> |
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index f0881d0dd9c9..bc4a7344e274 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "evlist.h" | 2 | #include "evlist.h" |
2 | #include "evsel.h" | 3 | #include "evsel.h" |
3 | #include "thread_map.h" | 4 | #include "thread_map.h" |
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index 921412a6a880..2862b80bc288 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef TESTS_H | 2 | #ifndef TESTS_H |
2 | #define TESTS_H | 3 | #define TESTS_H |
3 | 4 | ||
diff --git a/tools/perf/tests/thread-map.c b/tools/perf/tests/thread-map.c index b3423c744f46..dbcb6a19b375 100644 --- a/tools/perf/tests/thread-map.c +++ b/tools/perf/tests/thread-map.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdlib.h> | 2 | #include <stdlib.h> |
2 | #include <sys/types.h> | 3 | #include <sys/types.h> |
3 | #include <unistd.h> | 4 | #include <unistd.h> |
diff --git a/tools/perf/tests/thread-mg-share.c b/tools/perf/tests/thread-mg-share.c index b9c7f58db6c4..b1d1bbafe7ae 100644 --- a/tools/perf/tests/thread-mg-share.c +++ b/tools/perf/tests/thread-mg-share.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "tests.h" | 2 | #include "tests.h" |
2 | #include "machine.h" | 3 | #include "machine.h" |
3 | #include "thread.h" | 4 | #include "thread.h" |
diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 19b0561fd6f6..a59db7c45a65 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include <stdio.h> | 4 | #include <stdio.h> |
diff --git a/tools/perf/tests/unit_number__scnprintf.c b/tools/perf/tests/unit_number__scnprintf.c index 15cd1cf8c129..2bb8cb0039c1 100644 --- a/tools/perf/tests/unit_number__scnprintf.c +++ b/tools/perf/tests/unit_number__scnprintf.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <inttypes.h> | 2 | #include <inttypes.h> |
2 | #include <linux/compiler.h> | 3 | #include <linux/compiler.h> |
3 | #include <linux/types.h> | 4 | #include <linux/types.h> |
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c index 86cb8868f67f..f6789fb029d6 100644 --- a/tools/perf/tests/vmlinux-kallsyms.c +++ b/tools/perf/tests/vmlinux-kallsyms.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include <linux/rbtree.h> | 3 | #include <linux/rbtree.h> |
3 | #include <inttypes.h> | 4 | #include <inttypes.h> |
diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h index 4b58581a6053..d80655cd1881 100644 --- a/tools/perf/trace/beauty/beauty.h +++ b/tools/perf/trace/beauty/beauty.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_TRACE_BEAUTY_H | 2 | #ifndef _PERF_TRACE_BEAUTY_H |
2 | #define _PERF_TRACE_BEAUTY_H | 3 | #define _PERF_TRACE_BEAUTY_H |
3 | 4 | ||
diff --git a/tools/perf/trace/beauty/eventfd.c b/tools/perf/trace/beauty/eventfd.c index b08f21eb6f4d..5d6a477a6400 100644 --- a/tools/perf/trace/beauty/eventfd.c +++ b/tools/perf/trace/beauty/eventfd.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #ifndef EFD_SEMAPHORE | 2 | #ifndef EFD_SEMAPHORE |
2 | #define EFD_SEMAPHORE 1 | 3 | #define EFD_SEMAPHORE 1 |
3 | #endif | 4 | #endif |
diff --git a/tools/perf/trace/beauty/flock.c b/tools/perf/trace/beauty/flock.c index 74613703a14e..f9707f57566c 100644 --- a/tools/perf/trace/beauty/flock.c +++ b/tools/perf/trace/beauty/flock.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <fcntl.h> | 2 | #include <fcntl.h> |
2 | 3 | ||
3 | #ifndef LOCK_MAND | 4 | #ifndef LOCK_MAND |
diff --git a/tools/perf/trace/beauty/futex_op.c b/tools/perf/trace/beauty/futex_op.c index bfd3359b09b6..61850fbc85ff 100644 --- a/tools/perf/trace/beauty/futex_op.c +++ b/tools/perf/trace/beauty/futex_op.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/futex.h> | 2 | #include <linux/futex.h> |
2 | 3 | ||
3 | #ifndef FUTEX_WAIT_BITSET | 4 | #ifndef FUTEX_WAIT_BITSET |
diff --git a/tools/perf/trace/beauty/mmap.c b/tools/perf/trace/beauty/mmap.c index 754558f9009d..51f1cea406f5 100644 --- a/tools/perf/trace/beauty/mmap.c +++ b/tools/perf/trace/beauty/mmap.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <uapi/linux/mman.h> | 2 | #include <uapi/linux/mman.h> |
2 | 3 | ||
3 | static size_t syscall_arg__scnprintf_mmap_prot(char *bf, size_t size, | 4 | static size_t syscall_arg__scnprintf_mmap_prot(char *bf, size_t size, |
diff --git a/tools/perf/trace/beauty/mode_t.c b/tools/perf/trace/beauty/mode_t.c index 930d8fef2400..d929ad7dd97b 100644 --- a/tools/perf/trace/beauty/mode_t.c +++ b/tools/perf/trace/beauty/mode_t.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <sys/stat.h> | 3 | #include <sys/stat.h> |
3 | #include <unistd.h> | 4 | #include <unistd.h> |
diff --git a/tools/perf/trace/beauty/msg_flags.c b/tools/perf/trace/beauty/msg_flags.c index 1106c8960cc4..c064d6aae659 100644 --- a/tools/perf/trace/beauty/msg_flags.c +++ b/tools/perf/trace/beauty/msg_flags.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <sys/socket.h> | 3 | #include <sys/socket.h> |
3 | 4 | ||
diff --git a/tools/perf/trace/beauty/open_flags.c b/tools/perf/trace/beauty/open_flags.c index e359e041dc0e..6aec6178a99d 100644 --- a/tools/perf/trace/beauty/open_flags.c +++ b/tools/perf/trace/beauty/open_flags.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <sys/stat.h> | 3 | #include <sys/stat.h> |
3 | #include <fcntl.h> | 4 | #include <fcntl.h> |
diff --git a/tools/perf/trace/beauty/perf_event_open.c b/tools/perf/trace/beauty/perf_event_open.c index 311f09dd718d..2bafd7c995ff 100644 --- a/tools/perf/trace/beauty/perf_event_open.c +++ b/tools/perf/trace/beauty/perf_event_open.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #ifndef PERF_FLAG_FD_NO_GROUP | 2 | #ifndef PERF_FLAG_FD_NO_GROUP |
2 | # define PERF_FLAG_FD_NO_GROUP (1UL << 0) | 3 | # define PERF_FLAG_FD_NO_GROUP (1UL << 0) |
3 | #endif | 4 | #endif |
diff --git a/tools/perf/trace/beauty/pid.c b/tools/perf/trace/beauty/pid.c index b6d419e16dcf..0313df342830 100644 --- a/tools/perf/trace/beauty/pid.c +++ b/tools/perf/trace/beauty/pid.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | size_t syscall_arg__scnprintf_pid(char *bf, size_t size, struct syscall_arg *arg) | 2 | size_t syscall_arg__scnprintf_pid(char *bf, size_t size, struct syscall_arg *arg) |
2 | { | 3 | { |
3 | int pid = arg->val; | 4 | int pid = arg->val; |
diff --git a/tools/perf/trace/beauty/sched_policy.c b/tools/perf/trace/beauty/sched_policy.c index 34775295b9b3..ba5096ae76b6 100644 --- a/tools/perf/trace/beauty/sched_policy.c +++ b/tools/perf/trace/beauty/sched_policy.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sched.h> | 2 | #include <sched.h> |
2 | 3 | ||
3 | /* | 4 | /* |
diff --git a/tools/perf/trace/beauty/seccomp.c b/tools/perf/trace/beauty/seccomp.c index 356441bce27d..b7097fd5fed9 100644 --- a/tools/perf/trace/beauty/seccomp.c +++ b/tools/perf/trace/beauty/seccomp.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #ifndef SECCOMP_SET_MODE_STRICT | 2 | #ifndef SECCOMP_SET_MODE_STRICT |
2 | #define SECCOMP_SET_MODE_STRICT 0 | 3 | #define SECCOMP_SET_MODE_STRICT 0 |
3 | #endif | 4 | #endif |
diff --git a/tools/perf/trace/beauty/signum.c b/tools/perf/trace/beauty/signum.c index fde8f2fc6558..bde18a53f090 100644 --- a/tools/perf/trace/beauty/signum.c +++ b/tools/perf/trace/beauty/signum.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <signal.h> | 2 | #include <signal.h> |
2 | 3 | ||
3 | static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscall_arg *arg) | 4 | static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscall_arg *arg) |
diff --git a/tools/perf/trace/beauty/socket_type.c b/tools/perf/trace/beauty/socket_type.c index 0a5ce818131c..bca26aef4a77 100644 --- a/tools/perf/trace/beauty/socket_type.c +++ b/tools/perf/trace/beauty/socket_type.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <sys/socket.h> | 3 | #include <sys/socket.h> |
3 | 4 | ||
diff --git a/tools/perf/trace/beauty/waitid_options.c b/tools/perf/trace/beauty/waitid_options.c index 7942724adec8..8465281a093d 100644 --- a/tools/perf/trace/beauty/waitid_options.c +++ b/tools/perf/trace/beauty/waitid_options.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <sys/wait.h> | 3 | #include <sys/wait.h> |
3 | 4 | ||
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index d0c2007c307b..63399af3049f 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "../util.h" | 2 | #include "../util.h" |
2 | #include "../string2.h" | 3 | #include "../string2.h" |
3 | #include "../config.h" | 4 | #include "../config.h" |
diff --git a/tools/perf/ui/browser.h b/tools/perf/ui/browser.h index a12eff75638b..03e1734412b9 100644 --- a/tools/perf/ui/browser.h +++ b/tools/perf/ui/browser.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_UI_BROWSER_H_ | 2 | #ifndef _PERF_UI_BROWSER_H_ |
2 | #define _PERF_UI_BROWSER_H_ 1 | 3 | #define _PERF_UI_BROWSER_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 786fecaf578e..8f7f59d1a2b5 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "../../util/util.h" | 2 | #include "../../util/util.h" |
2 | #include "../browser.h" | 3 | #include "../browser.h" |
3 | #include "../helpline.h" | 4 | #include "../helpline.h" |
diff --git a/tools/perf/ui/browsers/header.c b/tools/perf/ui/browsers/header.c index e2c9390ff4c5..d75492189acb 100644 --- a/tools/perf/ui/browsers/header.c +++ b/tools/perf/ui/browsers/header.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "util/cache.h" | 2 | #include "util/cache.h" |
2 | #include "util/debug.h" | 3 | #include "util/debug.h" |
3 | #include "ui/browser.h" | 4 | #include "ui/browser.h" |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 13dfb0a0bdeb..628ad5f7eddb 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <dirent.h> | 2 | #include <dirent.h> |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <inttypes.h> | 4 | #include <inttypes.h> |
diff --git a/tools/perf/ui/browsers/hists.h b/tools/perf/ui/browsers/hists.h index 23d6acb84800..ba431777f559 100644 --- a/tools/perf/ui/browsers/hists.h +++ b/tools/perf/ui/browsers/hists.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_UI_BROWSER_HISTS_H_ | 2 | #ifndef _PERF_UI_BROWSER_HISTS_H_ |
2 | #define _PERF_UI_BROWSER_HISTS_H_ 1 | 3 | #define _PERF_UI_BROWSER_HISTS_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/ui/browsers/map.c b/tools/perf/ui/browsers/map.c index ffa5addf631d..e03fa75f108a 100644 --- a/tools/perf/ui/browsers/map.c +++ b/tools/perf/ui/browsers/map.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <elf.h> | 2 | #include <elf.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <sys/ttydefaults.h> | 4 | #include <sys/ttydefaults.h> |
diff --git a/tools/perf/ui/browsers/map.h b/tools/perf/ui/browsers/map.h index 2d58e4b3eb6f..0ed7dbb3a373 100644 --- a/tools/perf/ui/browsers/map.h +++ b/tools/perf/ui/browsers/map.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_UI_MAP_BROWSER_H_ | 2 | #ifndef _PERF_UI_MAP_BROWSER_H_ |
2 | #define _PERF_UI_MAP_BROWSER_H_ 1 | 3 | #define _PERF_UI_MAP_BROWSER_H_ 1 |
3 | struct map; | 4 | struct map; |
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c index ad6b6ee3770e..90a32ac69e76 100644 --- a/tools/perf/ui/browsers/scripts.c +++ b/tools/perf/ui/browsers/scripts.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <elf.h> | 2 | #include <elf.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <sys/ttydefaults.h> | 4 | #include <sys/ttydefaults.h> |
diff --git a/tools/perf/ui/gtk/annotate.c b/tools/perf/ui/gtk/annotate.c index 02176193f427..fc7a2e105bfd 100644 --- a/tools/perf/ui/gtk/annotate.c +++ b/tools/perf/ui/gtk/annotate.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "gtk.h" | 2 | #include "gtk.h" |
2 | #include "util/debug.h" | 3 | #include "util/debug.h" |
3 | #include "util/annotate.h" | 4 | #include "util/annotate.h" |
diff --git a/tools/perf/ui/gtk/browser.c b/tools/perf/ui/gtk/browser.c index c24d91221290..4820e25ac68d 100644 --- a/tools/perf/ui/gtk/browser.c +++ b/tools/perf/ui/gtk/browser.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "../evlist.h" | 2 | #include "../evlist.h" |
2 | #include "../cache.h" | 3 | #include "../cache.h" |
3 | #include "../evsel.h" | 4 | #include "../evsel.h" |
diff --git a/tools/perf/ui/gtk/gtk.h b/tools/perf/ui/gtk/gtk.h index 0a9173ff9a61..9846ea5c831b 100644 --- a/tools/perf/ui/gtk/gtk.h +++ b/tools/perf/ui/gtk/gtk.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_GTK_H_ | 2 | #ifndef _PERF_GTK_H_ |
2 | #define _PERF_GTK_H_ 1 | 3 | #define _PERF_GTK_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/ui/gtk/helpline.c b/tools/perf/ui/gtk/helpline.c index 3388cbd12186..fbf1ea9ce9a2 100644 --- a/tools/perf/ui/gtk/helpline.c +++ b/tools/perf/ui/gtk/helpline.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <string.h> | 3 | #include <string.h> |
3 | 4 | ||
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index e24f83957705..24e1ec201ffd 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "../evlist.h" | 2 | #include "../evlist.h" |
2 | #include "../cache.h" | 3 | #include "../cache.h" |
3 | #include "../evsel.h" | 4 | #include "../evsel.h" |
diff --git a/tools/perf/ui/gtk/progress.c b/tools/perf/ui/gtk/progress.c index b656655fbc39..b6ad8857da78 100644 --- a/tools/perf/ui/gtk/progress.c +++ b/tools/perf/ui/gtk/progress.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <inttypes.h> | 2 | #include <inttypes.h> |
2 | 3 | ||
3 | #include "gtk.h" | 4 | #include "gtk.h" |
diff --git a/tools/perf/ui/gtk/setup.c b/tools/perf/ui/gtk/setup.c index 1d57676f8212..506e73b3834c 100644 --- a/tools/perf/ui/gtk/setup.c +++ b/tools/perf/ui/gtk/setup.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "gtk.h" | 2 | #include "gtk.h" |
2 | #include "../../util/cache.h" | 3 | #include "../../util/cache.h" |
3 | #include "../../util/debug.h" | 4 | #include "../../util/debug.h" |
diff --git a/tools/perf/ui/gtk/util.c b/tools/perf/ui/gtk/util.c index 00b91921edb1..7250d8101c8f 100644 --- a/tools/perf/ui/gtk/util.c +++ b/tools/perf/ui/gtk/util.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "../util.h" | 2 | #include "../util.h" |
2 | #include "../../util/util.h" | 3 | #include "../../util/util.h" |
3 | #include "../../util/debug.h" | 4 | #include "../../util/debug.h" |
diff --git a/tools/perf/ui/helpline.c b/tools/perf/ui/helpline.c index 379039ab00d8..b3c421429ed4 100644 --- a/tools/perf/ui/helpline.c +++ b/tools/perf/ui/helpline.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include <string.h> | 4 | #include <string.h> |
diff --git a/tools/perf/ui/helpline.h b/tools/perf/ui/helpline.h index d52d0a1a881b..8f775a053ca3 100644 --- a/tools/perf/ui/helpline.h +++ b/tools/perf/ui/helpline.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_UI_HELPLINE_H_ | 2 | #ifndef _PERF_UI_HELPLINE_H_ |
2 | #define _PERF_UI_HELPLINE_H_ 1 | 3 | #define _PERF_UI_HELPLINE_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index ddb2c6fbdf91..706f6f1e9c7d 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <inttypes.h> | 2 | #include <inttypes.h> |
2 | #include <math.h> | 3 | #include <math.h> |
3 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
@@ -532,7 +533,7 @@ void perf_hpp_list__prepend_sort_field(struct perf_hpp_list *list, | |||
532 | 533 | ||
533 | void perf_hpp__column_unregister(struct perf_hpp_fmt *format) | 534 | void perf_hpp__column_unregister(struct perf_hpp_fmt *format) |
534 | { | 535 | { |
535 | list_del(&format->list); | 536 | list_del_init(&format->list); |
536 | } | 537 | } |
537 | 538 | ||
538 | void perf_hpp__cancel_cumulate(void) | 539 | void perf_hpp__cancel_cumulate(void) |
@@ -606,6 +607,13 @@ next: | |||
606 | 607 | ||
607 | static void fmt_free(struct perf_hpp_fmt *fmt) | 608 | static void fmt_free(struct perf_hpp_fmt *fmt) |
608 | { | 609 | { |
610 | /* | ||
611 | * At this point fmt should be completely | ||
612 | * unhooked, if not it's a bug. | ||
613 | */ | ||
614 | BUG_ON(!list_empty(&fmt->list)); | ||
615 | BUG_ON(!list_empty(&fmt->sort_list)); | ||
616 | |||
609 | if (fmt->free) | 617 | if (fmt->free) |
610 | fmt->free(fmt); | 618 | fmt->free(fmt); |
611 | } | 619 | } |
diff --git a/tools/perf/ui/keysyms.h b/tools/perf/ui/keysyms.h index 65092d576b4e..fbfac29077f2 100644 --- a/tools/perf/ui/keysyms.h +++ b/tools/perf/ui/keysyms.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_KEYSYMS_H_ | 2 | #ifndef _PERF_KEYSYMS_H_ |
2 | #define _PERF_KEYSYMS_H_ 1 | 3 | #define _PERF_KEYSYMS_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/ui/libslang.h b/tools/perf/ui/libslang.h index db816695ad97..c0686cda39a5 100644 --- a/tools/perf/ui/libslang.h +++ b/tools/perf/ui/libslang.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_UI_SLANG_H_ | 2 | #ifndef _PERF_UI_SLANG_H_ |
2 | #define _PERF_UI_SLANG_H_ 1 | 3 | #define _PERF_UI_SLANG_H_ 1 |
3 | /* | 4 | /* |
diff --git a/tools/perf/ui/progress.c b/tools/perf/ui/progress.c index ae91c8148edf..b5a5df14d702 100644 --- a/tools/perf/ui/progress.c +++ b/tools/perf/ui/progress.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
2 | #include "../cache.h" | 3 | #include "../cache.h" |
3 | #include "progress.h" | 4 | #include "progress.h" |
diff --git a/tools/perf/ui/progress.h b/tools/perf/ui/progress.h index 717d39d3052b..594bbe6935dd 100644 --- a/tools/perf/ui/progress.h +++ b/tools/perf/ui/progress.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_UI_PROGRESS_H_ | 2 | #ifndef _PERF_UI_PROGRESS_H_ |
2 | #define _PERF_UI_PROGRESS_H_ 1 | 3 | #define _PERF_UI_PROGRESS_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c index caf1ce6f5152..44fe824e96cd 100644 --- a/tools/perf/ui/setup.c +++ b/tools/perf/ui/setup.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <pthread.h> | 2 | #include <pthread.h> |
2 | #include <dlfcn.h> | 3 | #include <dlfcn.h> |
3 | 4 | ||
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 8bdb7a500181..de2810ae16be 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <linux/string.h> | 3 | #include <linux/string.h> |
3 | 4 | ||
diff --git a/tools/perf/ui/tui/helpline.c b/tools/perf/ui/tui/helpline.c index 88f5143a5981..4ca799aadb4e 100644 --- a/tools/perf/ui/tui/helpline.c +++ b/tools/perf/ui/tui/helpline.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include <string.h> | 4 | #include <string.h> |
diff --git a/tools/perf/ui/tui/progress.c b/tools/perf/ui/tui/progress.c index c4b99008e2c9..236bcb620ae4 100644 --- a/tools/perf/ui/tui/progress.c +++ b/tools/perf/ui/tui/progress.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "../cache.h" | 2 | #include "../cache.h" |
2 | #include "../progress.h" | 3 | #include "../progress.h" |
3 | #include "../libslang.h" | 4 | #include "../libslang.h" |
diff --git a/tools/perf/ui/tui/setup.c b/tools/perf/ui/tui/setup.c index d9350a1da48b..d4ac41679721 100644 --- a/tools/perf/ui/tui/setup.c +++ b/tools/perf/ui/tui/setup.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <signal.h> | 3 | #include <signal.h> |
3 | #include <stdbool.h> | 4 | #include <stdbool.h> |
diff --git a/tools/perf/ui/tui/tui.h b/tools/perf/ui/tui/tui.h index 18961c7b6ec5..8de06f634c56 100644 --- a/tools/perf/ui/tui/tui.h +++ b/tools/perf/ui/tui/tui.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_TUI_H_ | 2 | #ifndef _PERF_TUI_H_ |
2 | #define _PERF_TUI_H_ 1 | 3 | #define _PERF_TUI_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/ui/tui/util.c b/tools/perf/ui/tui/util.c index d96ad7c8325d..b9794d6185af 100644 --- a/tools/perf/ui/tui/util.c +++ b/tools/perf/ui/tui/util.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "../../util/util.h" | 2 | #include "../../util/util.h" |
2 | #include <signal.h> | 3 | #include <signal.h> |
3 | #include <stdbool.h> | 4 | #include <stdbool.h> |
diff --git a/tools/perf/ui/ui.h b/tools/perf/ui/ui.h index 4b6fb6c7a542..9b6fdf06e1d2 100644 --- a/tools/perf/ui/ui.h +++ b/tools/perf/ui/ui.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_UI_H_ | 2 | #ifndef _PERF_UI_H_ |
2 | #define _PERF_UI_H_ 1 | 3 | #define _PERF_UI_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/ui/util.c b/tools/perf/ui/util.c index e3e0a963d03a..63bf06e80ab9 100644 --- a/tools/perf/ui/util.c +++ b/tools/perf/ui/util.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "util.h" | 2 | #include "util.h" |
2 | #include "../debug.h" | 3 | #include "../debug.h" |
3 | 4 | ||
diff --git a/tools/perf/ui/util.h b/tools/perf/ui/util.h index 361f08c52d37..5e44223b56fa 100644 --- a/tools/perf/ui/util.h +++ b/tools/perf/ui/util.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_UI_UTIL_H_ | 2 | #ifndef _PERF_UI_UTIL_H_ |
2 | #define _PERF_UI_UTIL_H_ 1 | 3 | #define _PERF_UI_UTIL_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN index 39f17507578d..3802cee5e188 100755 --- a/tools/perf/util/PERF-VERSION-GEN +++ b/tools/perf/util/PERF-VERSION-GEN | |||
@@ -1,4 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | 3 | ||
3 | if [ $# -eq 1 ] ; then | 4 | if [ $# -eq 1 ] ; then |
4 | OUTPUT=$1 | 5 | OUTPUT=$1 |
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 4397a8b6e6cd..aa66791b1bfc 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -606,9 +606,19 @@ static struct arch *arch__find(const char *name) | |||
606 | int symbol__alloc_hist(struct symbol *sym) | 606 | int symbol__alloc_hist(struct symbol *sym) |
607 | { | 607 | { |
608 | struct annotation *notes = symbol__annotation(sym); | 608 | struct annotation *notes = symbol__annotation(sym); |
609 | const size_t size = symbol__size(sym); | 609 | size_t size = symbol__size(sym); |
610 | size_t sizeof_sym_hist; | 610 | size_t sizeof_sym_hist; |
611 | 611 | ||
612 | /* | ||
613 | * Add buffer of one element for zero length symbol. | ||
614 | * When sample is taken from first instruction of | ||
615 | * zero length symbol, perf still resolves it and | ||
616 | * shows symbol name in perf report and allows to | ||
617 | * annotate it. | ||
618 | */ | ||
619 | if (size == 0) | ||
620 | size = 1; | ||
621 | |||
612 | /* Check for overflow when calculating sizeof_sym_hist */ | 622 | /* Check for overflow when calculating sizeof_sym_hist */ |
613 | if (size > (SIZE_MAX - sizeof(struct sym_hist)) / sizeof(struct sym_hist_entry)) | 623 | if (size > (SIZE_MAX - sizeof(struct sym_hist)) / sizeof(struct sym_hist_entry)) |
614 | return -1; | 624 | return -1; |
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 9ce575c25fd9..f6ba3560de5e 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_ANNOTATE_H | 2 | #ifndef __PERF_ANNOTATE_H |
2 | #define __PERF_ANNOTATE_H | 3 | #define __PERF_ANNOTATE_H |
3 | 4 | ||
diff --git a/tools/perf/util/block-range.c b/tools/perf/util/block-range.c index 7b3e1d75d803..f1451c987eec 100644 --- a/tools/perf/util/block-range.c +++ b/tools/perf/util/block-range.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "block-range.h" | 2 | #include "block-range.h" |
2 | #include "annotate.h" | 3 | #include "annotate.h" |
3 | 4 | ||
diff --git a/tools/perf/util/block-range.h b/tools/perf/util/block-range.h index a8c841381131..a5ba719d69fb 100644 --- a/tools/perf/util/block-range.h +++ b/tools/perf/util/block-range.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_BLOCK_RANGE_H | 2 | #ifndef __PERF_BLOCK_RANGE_H |
2 | #define __PERF_BLOCK_RANGE_H | 3 | #define __PERF_BLOCK_RANGE_H |
3 | 4 | ||
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index 4a1264c66101..72c107fcbc5a 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * bpf-loader.c | 3 | * bpf-loader.c |
3 | * | 4 | * |
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h index 48863867878b..5d3aefd6fae7 100644 --- a/tools/perf/util/bpf-loader.h +++ b/tools/perf/util/bpf-loader.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2015, Wang Nan <wangnan0@huawei.com> | 3 | * Copyright (C) 2015, Wang Nan <wangnan0@huawei.com> |
3 | * Copyright (C) 2015, Huawei Inc. | 4 | * Copyright (C) 2015, Huawei Inc. |
diff --git a/tools/perf/util/bpf-prologue.c b/tools/perf/util/bpf-prologue.c index 827f9140f3b8..29347756b0af 100644 --- a/tools/perf/util/bpf-prologue.c +++ b/tools/perf/util/bpf-prologue.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * bpf-prologue.c | 3 | * bpf-prologue.c |
3 | * | 4 | * |
diff --git a/tools/perf/util/bpf-prologue.h b/tools/perf/util/bpf-prologue.h index ba564838375f..c50c7358009f 100644 --- a/tools/perf/util/bpf-prologue.h +++ b/tools/perf/util/bpf-prologue.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2015, He Kuang <hekuang@huawei.com> | 3 | * Copyright (C) 2015, He Kuang <hekuang@huawei.com> |
3 | * Copyright (C) 2015, Huawei Inc. | 4 | * Copyright (C) 2015, Huawei Inc. |
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index c1a06fcd7e70..7f8553630c4d 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * build-id.c | 3 | * build-id.c |
3 | * | 4 | * |
diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h index c94b0dcbfd74..f0c565164a97 100644 --- a/tools/perf/util/build-id.h +++ b/tools/perf/util/build-id.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_BUILD_ID_H_ | 2 | #ifndef PERF_BUILD_ID_H_ |
2 | #define PERF_BUILD_ID_H_ 1 | 3 | #define PERF_BUILD_ID_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/util/c++/clang-c.h b/tools/perf/util/c++/clang-c.h index ccafcf72b37a..e513366f2ee0 100644 --- a/tools/perf/util/c++/clang-c.h +++ b/tools/perf/util/c++/clang-c.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_UTIL_CLANG_C_H | 2 | #ifndef PERF_UTIL_CLANG_C_H |
2 | #define PERF_UTIL_CLANG_C_H | 3 | #define PERF_UTIL_CLANG_C_H |
3 | 4 | ||
diff --git a/tools/perf/util/c++/clang-test.cpp b/tools/perf/util/c++/clang-test.cpp index 9b11e8c82798..a4014d786676 100644 --- a/tools/perf/util/c++/clang-test.cpp +++ b/tools/perf/util/c++/clang-test.cpp | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "clang.h" | 2 | #include "clang.h" |
2 | #include "clang-c.h" | 3 | #include "clang-c.h" |
3 | #include "llvm/IR/Function.h" | 4 | #include "llvm/IR/Function.h" |
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp index 1e974152cac2..1bfc946e37dc 100644 --- a/tools/perf/util/c++/clang.cpp +++ b/tools/perf/util/c++/clang.cpp | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * llvm C frontend for perf. Support dynamically compile C file | 3 | * llvm C frontend for perf. Support dynamically compile C file |
3 | * | 4 | * |
diff --git a/tools/perf/util/c++/clang.h b/tools/perf/util/c++/clang.h index dd8b0427550d..6ce33e22f23c 100644 --- a/tools/perf/util/c++/clang.h +++ b/tools/perf/util/c++/clang.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_UTIL_CLANG_H | 2 | #ifndef PERF_UTIL_CLANG_H |
2 | #define PERF_UTIL_CLANG_H | 3 | #define PERF_UTIL_CLANG_H |
3 | 4 | ||
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h index 0175765c05b9..9f2e36ef5072 100644 --- a/tools/perf/util/cache.h +++ b/tools/perf/util/cache.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_CACHE_H | 2 | #ifndef __PERF_CACHE_H |
2 | #define __PERF_CACHE_H | 3 | #define __PERF_CACHE_H |
3 | 4 | ||
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 510b513e0f01..6031933d811c 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2009-2011, Frederic Weisbecker <fweisbec@gmail.com> | 3 | * Copyright (C) 2009-2011, Frederic Weisbecker <fweisbec@gmail.com> |
3 | * | 4 | * |
@@ -65,8 +66,6 @@ static int parse_callchain_mode(const char *value) | |||
65 | callchain_param.mode = CHAIN_FOLDED; | 66 | callchain_param.mode = CHAIN_FOLDED; |
66 | return 0; | 67 | return 0; |
67 | } | 68 | } |
68 | |||
69 | pr_err("Invalid callchain mode: %s\n", value); | ||
70 | return -1; | 69 | return -1; |
71 | } | 70 | } |
72 | 71 | ||
@@ -82,8 +81,6 @@ static int parse_callchain_order(const char *value) | |||
82 | callchain_param.order_set = true; | 81 | callchain_param.order_set = true; |
83 | return 0; | 82 | return 0; |
84 | } | 83 | } |
85 | |||
86 | pr_err("Invalid callchain order: %s\n", value); | ||
87 | return -1; | 84 | return -1; |
88 | } | 85 | } |
89 | 86 | ||
@@ -105,8 +102,6 @@ static int parse_callchain_sort_key(const char *value) | |||
105 | callchain_param.branch_callstack = 1; | 102 | callchain_param.branch_callstack = 1; |
106 | return 0; | 103 | return 0; |
107 | } | 104 | } |
108 | |||
109 | pr_err("Invalid callchain sort key: %s\n", value); | ||
110 | return -1; | 105 | return -1; |
111 | } | 106 | } |
112 | 107 | ||
@@ -124,8 +119,6 @@ static int parse_callchain_value(const char *value) | |||
124 | callchain_param.value = CCVAL_COUNT; | 119 | callchain_param.value = CCVAL_COUNT; |
125 | return 0; | 120 | return 0; |
126 | } | 121 | } |
127 | |||
128 | pr_err("Invalid callchain config key: %s\n", value); | ||
129 | return -1; | 122 | return -1; |
130 | } | 123 | } |
131 | 124 | ||
@@ -319,12 +312,27 @@ int perf_callchain_config(const char *var, const char *value) | |||
319 | 312 | ||
320 | return ret; | 313 | return ret; |
321 | } | 314 | } |
322 | if (!strcmp(var, "print-type")) | 315 | if (!strcmp(var, "print-type")){ |
323 | return parse_callchain_mode(value); | 316 | int ret; |
324 | if (!strcmp(var, "order")) | 317 | ret = parse_callchain_mode(value); |
325 | return parse_callchain_order(value); | 318 | if (ret == -1) |
326 | if (!strcmp(var, "sort-key")) | 319 | pr_err("Invalid callchain mode: %s\n", value); |
327 | return parse_callchain_sort_key(value); | 320 | return ret; |
321 | } | ||
322 | if (!strcmp(var, "order")){ | ||
323 | int ret; | ||
324 | ret = parse_callchain_order(value); | ||
325 | if (ret == -1) | ||
326 | pr_err("Invalid callchain order: %s\n", value); | ||
327 | return ret; | ||
328 | } | ||
329 | if (!strcmp(var, "sort-key")){ | ||
330 | int ret; | ||
331 | ret = parse_callchain_sort_key(value); | ||
332 | if (ret == -1) | ||
333 | pr_err("Invalid callchain sort key: %s\n", value); | ||
334 | return ret; | ||
335 | } | ||
328 | if (!strcmp(var, "threshold")) { | 336 | if (!strcmp(var, "threshold")) { |
329 | callchain_param.min_percent = strtod(value, &endptr); | 337 | callchain_param.min_percent = strtod(value, &endptr); |
330 | if (value == endptr) { | 338 | if (value == endptr) { |
@@ -678,6 +686,8 @@ static enum match_result match_chain(struct callchain_cursor_node *node, | |||
678 | { | 686 | { |
679 | struct symbol *sym = node->sym; | 687 | struct symbol *sym = node->sym; |
680 | u64 left, right; | 688 | u64 left, right; |
689 | struct dso *left_dso = NULL; | ||
690 | struct dso *right_dso = NULL; | ||
681 | 691 | ||
682 | if (callchain_param.key == CCKEY_SRCLINE) { | 692 | if (callchain_param.key == CCKEY_SRCLINE) { |
683 | enum match_result match = match_chain_srcline(node, cnode); | 693 | enum match_result match = match_chain_srcline(node, cnode); |
@@ -689,12 +699,14 @@ static enum match_result match_chain(struct callchain_cursor_node *node, | |||
689 | if (cnode->ms.sym && sym && callchain_param.key == CCKEY_FUNCTION) { | 699 | if (cnode->ms.sym && sym && callchain_param.key == CCKEY_FUNCTION) { |
690 | left = cnode->ms.sym->start; | 700 | left = cnode->ms.sym->start; |
691 | right = sym->start; | 701 | right = sym->start; |
702 | left_dso = cnode->ms.map->dso; | ||
703 | right_dso = node->map->dso; | ||
692 | } else { | 704 | } else { |
693 | left = cnode->ip; | 705 | left = cnode->ip; |
694 | right = node->ip; | 706 | right = node->ip; |
695 | } | 707 | } |
696 | 708 | ||
697 | if (left == right) { | 709 | if (left == right && left_dso == right_dso) { |
698 | if (node->branch) { | 710 | if (node->branch) { |
699 | cnode->branch_count++; | 711 | cnode->branch_count++; |
700 | 712 | ||
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h index 1ed6fc61d0a5..f967aa47d0a1 100644 --- a/tools/perf/util/callchain.h +++ b/tools/perf/util/callchain.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_CALLCHAIN_H | 2 | #ifndef __PERF_CALLCHAIN_H |
2 | #define __PERF_CALLCHAIN_H | 3 | #define __PERF_CALLCHAIN_H |
3 | 4 | ||
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c index 0e77bc9e5f3c..d9ffc1e6eb39 100644 --- a/tools/perf/util/cgroup.c +++ b/tools/perf/util/cgroup.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "util.h" | 2 | #include "util.h" |
2 | #include "../perf.h" | 3 | #include "../perf.h" |
3 | #include <subcmd/parse-options.h> | 4 | #include <subcmd/parse-options.h> |
diff --git a/tools/perf/util/cgroup.h b/tools/perf/util/cgroup.h index d91966b97cbd..afafc87e9201 100644 --- a/tools/perf/util/cgroup.h +++ b/tools/perf/util/cgroup.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __CGROUP_H__ | 2 | #ifndef __CGROUP_H__ |
2 | #define __CGROUP_H__ | 3 | #define __CGROUP_H__ |
3 | 4 | ||
diff --git a/tools/perf/util/cloexec.c b/tools/perf/util/cloexec.c index 4b4f00df58a8..ca0fff6272be 100644 --- a/tools/perf/util/cloexec.c +++ b/tools/perf/util/cloexec.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <sched.h> | 3 | #include <sched.h> |
3 | #include "util.h" | 4 | #include "util.h" |
diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h index 94a5a7d829d5..78216b1015c4 100644 --- a/tools/perf/util/cloexec.h +++ b/tools/perf/util/cloexec.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_CLOEXEC_H | 2 | #ifndef __PERF_CLOEXEC_H |
2 | #define __PERF_CLOEXEC_H | 3 | #define __PERF_CLOEXEC_H |
3 | 4 | ||
diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c index dbbf89b050a5..39e628b8938e 100644 --- a/tools/perf/util/color.c +++ b/tools/perf/util/color.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
2 | #include "cache.h" | 3 | #include "cache.h" |
3 | #include "config.h" | 4 | #include "config.h" |
diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h index 52122bcc3170..22777b1812ee 100644 --- a/tools/perf/util/color.h +++ b/tools/perf/util/color.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_COLOR_H | 2 | #ifndef __PERF_COLOR_H |
2 | #define __PERF_COLOR_H | 3 | #define __PERF_COLOR_H |
3 | 4 | ||
diff --git a/tools/perf/util/comm.c b/tools/perf/util/comm.c index 7bc981b6bf29..8808570f8e9c 100644 --- a/tools/perf/util/comm.c +++ b/tools/perf/util/comm.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "comm.h" | 2 | #include "comm.h" |
2 | #include "util.h" | 3 | #include "util.h" |
3 | #include <errno.h> | 4 | #include <errno.h> |
diff --git a/tools/perf/util/comm.h b/tools/perf/util/comm.h index 71c9c39340d4..3e5c438fe85e 100644 --- a/tools/perf/util/comm.h +++ b/tools/perf/util/comm.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_COMM_H | 2 | #ifndef __PERF_COMM_H |
2 | #define __PERF_COMM_H | 3 | #define __PERF_COMM_H |
3 | 4 | ||
diff --git a/tools/perf/util/compress.h b/tools/perf/util/compress.h index 67fd1bb7c2b7..ecca688a25fb 100644 --- a/tools/perf/util/compress.h +++ b/tools/perf/util/compress.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_COMPRESS_H | 2 | #ifndef PERF_COMPRESS_H |
2 | #define PERF_COMPRESS_H | 3 | #define PERF_COMPRESS_H |
3 | 4 | ||
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c index bc75596f9e79..4b893c622236 100644 --- a/tools/perf/util/config.c +++ b/tools/perf/util/config.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * config.c | 3 | * config.c |
3 | * | 4 | * |
diff --git a/tools/perf/util/config.h b/tools/perf/util/config.h index b6bb11f3f165..baf82bf227ac 100644 --- a/tools/perf/util/config.h +++ b/tools/perf/util/config.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_CONFIG_H | 2 | #ifndef __PERF_CONFIG_H |
2 | #define __PERF_CONFIG_H | 3 | #define __PERF_CONFIG_H |
3 | 4 | ||
diff --git a/tools/perf/util/counts.c b/tools/perf/util/counts.c index c4af82ab7808..03032b410c29 100644 --- a/tools/perf/util/counts.c +++ b/tools/perf/util/counts.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include "evsel.h" | 4 | #include "evsel.h" |
diff --git a/tools/perf/util/counts.h b/tools/perf/util/counts.h index cb45a6aecf9d..0d1050ccc586 100644 --- a/tools/perf/util/counts.h +++ b/tools/perf/util/counts.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_COUNTS_H | 2 | #ifndef __PERF_COUNTS_H |
2 | #define __PERF_COUNTS_H | 3 | #define __PERF_COUNTS_H |
3 | 4 | ||
diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index 37b3bb79ee08..1ccbd3342069 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "util.h" | 2 | #include "util.h" |
2 | #include <api/fs/fs.h> | 3 | #include <api/fs/fs.h> |
3 | #include "../perf.h" | 4 | #include "../perf.h" |
diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index 6b8bff87481d..ed8999d1a640 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_CPUMAP_H | 2 | #ifndef __PERF_CPUMAP_H |
2 | #define __PERF_CPUMAP_H | 3 | #define __PERF_CPUMAP_H |
3 | 4 | ||
diff --git a/tools/perf/util/ctype.c b/tools/perf/util/ctype.c index 4b261c2ec0f1..ee4c1e8ed54b 100644 --- a/tools/perf/util/ctype.c +++ b/tools/perf/util/ctype.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Sane locale-independent, ASCII ctype. | 3 | * Sane locale-independent, ASCII ctype. |
3 | * | 4 | * |
diff --git a/tools/perf/util/data-convert-bt.h b/tools/perf/util/data-convert-bt.h index 9a3b587f76c1..821674d63c4e 100644 --- a/tools/perf/util/data-convert-bt.h +++ b/tools/perf/util/data-convert-bt.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __DATA_CONVERT_BT_H | 2 | #ifndef __DATA_CONVERT_BT_H |
2 | #define __DATA_CONVERT_BT_H | 3 | #define __DATA_CONVERT_BT_H |
3 | #include "data-convert.h" | 4 | #include "data-convert.h" |
diff --git a/tools/perf/util/data-convert.h b/tools/perf/util/data-convert.h index 5314962fe95b..af90b6076c06 100644 --- a/tools/perf/util/data-convert.h +++ b/tools/perf/util/data-convert.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __DATA_CONVERT_H | 2 | #ifndef __DATA_CONVERT_H |
2 | #define __DATA_CONVERT_H | 3 | #define __DATA_CONVERT_H |
3 | 4 | ||
diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index 263f5a906ba5..79192758bdb3 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
3 | #include <sys/types.h> | 4 | #include <sys/types.h> |
diff --git a/tools/perf/util/data.h b/tools/perf/util/data.h index ae510ce16cb1..80241ba78101 100644 --- a/tools/perf/util/data.h +++ b/tools/perf/util/data.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_DATA_H | 2 | #ifndef __PERF_DATA_H |
2 | #define __PERF_DATA_H | 3 | #define __PERF_DATA_H |
3 | 4 | ||
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c index a5b3777ffee6..dc8b53b6950e 100644 --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* For general debugging purposes */ | 2 | /* For general debugging purposes */ |
2 | 3 | ||
3 | #include "../perf.h" | 4 | #include "../perf.h" |
diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h index c818bdb1c1ab..77445dfc5c7d 100644 --- a/tools/perf/util/debug.h +++ b/tools/perf/util/debug.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* For debugging general purposes */ | 2 | /* For debugging general purposes */ |
2 | #ifndef __PERF_DEBUG_H | 3 | #ifndef __PERF_DEBUG_H |
3 | #define __PERF_DEBUG_H | 4 | #define __PERF_DEBUG_H |
diff --git a/tools/perf/util/demangle-java.c b/tools/perf/util/demangle-java.c index cb66d334f532..e4c486756053 100644 --- a/tools/perf/util/demangle-java.c +++ b/tools/perf/util/demangle-java.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/types.h> | 2 | #include <sys/types.h> |
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include <string.h> | 4 | #include <string.h> |
diff --git a/tools/perf/util/demangle-java.h b/tools/perf/util/demangle-java.h index a981c1f968fe..f936c8eabe5d 100644 --- a/tools/perf/util/demangle-java.h +++ b/tools/perf/util/demangle-java.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_DEMANGLE_JAVA | 2 | #ifndef __PERF_DEMANGLE_JAVA |
2 | #define __PERF_DEMANGLE_JAVA 1 | 3 | #define __PERF_DEMANGLE_JAVA 1 |
3 | /* | 4 | /* |
diff --git a/tools/perf/util/demangle-rust.c b/tools/perf/util/demangle-rust.c index f9dafa888c06..423afbbd386b 100644 --- a/tools/perf/util/demangle-rust.c +++ b/tools/perf/util/demangle-rust.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | #include "util.h" | 3 | #include "util.h" |
3 | #include "debug.h" | 4 | #include "debug.h" |
diff --git a/tools/perf/util/demangle-rust.h b/tools/perf/util/demangle-rust.h index 7b41ead7e0dd..2fca618b1aa5 100644 --- a/tools/perf/util/demangle-rust.h +++ b/tools/perf/util/demangle-rust.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_DEMANGLE_RUST | 2 | #ifndef __PERF_DEMANGLE_RUST |
2 | #define __PERF_DEMANGLE_RUST 1 | 3 | #define __PERF_DEMANGLE_RUST 1 |
3 | 4 | ||
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index b9e087fb8247..00c98c968cb1 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <asm/bug.h> | 2 | #include <asm/bug.h> |
2 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
3 | #include <sys/time.h> | 4 | #include <sys/time.h> |
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index f886141678eb..926ff2e7f668 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_DSO | 2 | #ifndef __PERF_DSO |
2 | #define __PERF_DSO | 3 | #define __PERF_DSO |
3 | 4 | ||
diff --git a/tools/perf/util/dump-insn.c b/tools/perf/util/dump-insn.c index ffbdb19f05d0..10988d3de7ce 100644 --- a/tools/perf/util/dump-insn.c +++ b/tools/perf/util/dump-insn.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include "dump-insn.h" | 3 | #include "dump-insn.h" |
3 | 4 | ||
diff --git a/tools/perf/util/dump-insn.h b/tools/perf/util/dump-insn.h index 90fb115981cf..0e06280a8860 100644 --- a/tools/perf/util/dump-insn.h +++ b/tools/perf/util/dump-insn.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_DUMP_INSN_H | 2 | #ifndef __PERF_DUMP_INSN_H |
2 | #define __PERF_DUMP_INSN_H 1 | 3 | #define __PERF_DUMP_INSN_H 1 |
3 | 4 | ||
diff --git a/tools/perf/util/dwarf-regs.c b/tools/perf/util/dwarf-regs.c index c708395b3cb6..db55eddce8cd 100644 --- a/tools/perf/util/dwarf-regs.c +++ b/tools/perf/util/dwarf-regs.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * dwarf-regs.c : Mapping of DWARF debug register numbers into register names. | 3 | * dwarf-regs.c : Mapping of DWARF debug register numbers into register names. |
3 | * | 4 | * |
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c index 9e21538c42ae..6276b340f893 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "cpumap.h" | 2 | #include "cpumap.h" |
2 | #include "env.h" | 3 | #include "env.h" |
3 | #include "util.h" | 4 | #include "util.h" |
diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h index b164dfd2dcbf..1eb35b190b34 100644 --- a/tools/perf/util/env.h +++ b/tools/perf/util/env.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_ENV_H | 2 | #ifndef __PERF_ENV_H |
2 | #define __PERF_ENV_H | 3 | #define __PERF_ENV_H |
3 | 4 | ||
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 1c905ba3641b..fc690fecbfd6 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <dirent.h> | 2 | #include <dirent.h> |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <inttypes.h> | 4 | #include <inttypes.h> |
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index ee7bcc898d35..5524ee69279c 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_RECORD_H | 2 | #ifndef __PERF_RECORD_H |
2 | #define __PERF_RECORD_H | 3 | #define __PERF_RECORD_H |
3 | 4 | ||
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index bf2c4936e35f..c1750a400bb7 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_EVLIST_H | 2 | #ifndef __PERF_EVLIST_H |
2 | #define __PERF_EVLIST_H 1 | 3 | #define __PERF_EVLIST_H 1 |
3 | 4 | ||
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4bb89373eb52..0dccdb89572c 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -271,12 +271,17 @@ struct perf_evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx) | |||
271 | return evsel; | 271 | return evsel; |
272 | } | 272 | } |
273 | 273 | ||
274 | static bool perf_event_can_profile_kernel(void) | ||
275 | { | ||
276 | return geteuid() == 0 || perf_event_paranoid() == -1; | ||
277 | } | ||
278 | |||
274 | struct perf_evsel *perf_evsel__new_cycles(bool precise) | 279 | struct perf_evsel *perf_evsel__new_cycles(bool precise) |
275 | { | 280 | { |
276 | struct perf_event_attr attr = { | 281 | struct perf_event_attr attr = { |
277 | .type = PERF_TYPE_HARDWARE, | 282 | .type = PERF_TYPE_HARDWARE, |
278 | .config = PERF_COUNT_HW_CPU_CYCLES, | 283 | .config = PERF_COUNT_HW_CPU_CYCLES, |
279 | .exclude_kernel = geteuid() != 0, | 284 | .exclude_kernel = !perf_event_can_profile_kernel(), |
280 | }; | 285 | }; |
281 | struct perf_evsel *evsel; | 286 | struct perf_evsel *evsel; |
282 | 287 | ||
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index dd2c4b5112a5..b4df79d72329 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_EVSEL_H | 2 | #ifndef __PERF_EVSEL_H |
2 | #define __PERF_EVSEL_H 1 | 3 | #define __PERF_EVSEL_H 1 |
3 | 4 | ||
diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c index 583f3a602506..1fd7c2e46db2 100644 --- a/tools/perf/util/evsel_fprintf.c +++ b/tools/perf/util/evsel_fprintf.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <inttypes.h> | 2 | #include <inttypes.h> |
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include <stdbool.h> | 4 | #include <stdbool.h> |
diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h index 400ef9eab00a..046160831f90 100644 --- a/tools/perf/util/expr.h +++ b/tools/perf/util/expr.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PARSE_CTX_H | 2 | #ifndef PARSE_CTX_H |
2 | #define PARSE_CTX_H 1 | 3 | #define PARSE_CTX_H 1 |
3 | 4 | ||
diff --git a/tools/perf/util/find-vdso-map.c b/tools/perf/util/find-vdso-map.c index 95ef1cffc056..d7823e3508fc 100644 --- a/tools/perf/util/find-vdso-map.c +++ b/tools/perf/util/find-vdso-map.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | static int find_vdso_map(void **start, void **end) | 2 | static int find_vdso_map(void **start, void **end) |
2 | { | 3 | { |
3 | FILE *maps; | 4 | FILE *maps; |
diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h index 2424bd9862a3..de322d51c7fe 100644 --- a/tools/perf/util/genelf.h +++ b/tools/perf/util/genelf.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __GENELF_H__ | 2 | #ifndef __GENELF_H__ |
2 | #define __GENELF_H__ | 3 | #define __GENELF_H__ |
3 | 4 | ||
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh index 0ac2037c970c..9bbcec4e3365 100755 --- a/tools/perf/util/generate-cmdlist.sh +++ b/tools/perf/util/generate-cmdlist.sh | |||
@@ -1,4 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | 3 | ||
3 | echo "/* Automatically generated by $0 */ | 4 | echo "/* Automatically generated by $0 */ |
4 | struct cmdname_help | 5 | struct cmdname_help |
diff --git a/tools/perf/util/group.h b/tools/perf/util/group.h index 116debe7a995..f36c7e31780a 100644 --- a/tools/perf/util/group.h +++ b/tools/perf/util/group.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef GROUP_H | 2 | #ifndef GROUP_H |
2 | #define GROUP_H 1 | 3 | #define GROUP_H 1 |
3 | 4 | ||
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 605bbd5404fb..ba0cea8fef72 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include "util.h" | 4 | #include "util.h" |
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index f7a16ee527b8..29ccbfdf8724 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_HEADER_H | 2 | #ifndef __PERF_HEADER_H |
2 | #define __PERF_HEADER_H | 3 | #define __PERF_HEADER_H |
3 | 4 | ||
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-cmd.c index 15b95300d7f3..4f07a5ba5030 100644 --- a/tools/perf/util/help-unknown-cmd.c +++ b/tools/perf/util/help-unknown-cmd.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "cache.h" | 2 | #include "cache.h" |
2 | #include "config.h" | 3 | #include "config.h" |
3 | #include <poll.h> | 4 | #include <poll.h> |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index e60d8d8ea4c2..097473600d94 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "util.h" | 2 | #include "util.h" |
2 | #include "build-id.h" | 3 | #include "build-id.h" |
3 | #include "hist.h" | 4 | #include "hist.h" |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index e60dda26a920..f6630cb95eff 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_HIST_H | 2 | #ifndef __PERF_HIST_H |
2 | #define __PERF_HIST_H | 3 | #define __PERF_HIST_H |
3 | 4 | ||
diff --git a/tools/perf/util/include/asm/asm-offsets.h b/tools/perf/util/include/asm/asm-offsets.h index ed538942523d..3aff4cf44944 100644 --- a/tools/perf/util/include/asm/asm-offsets.h +++ b/tools/perf/util/include/asm/asm-offsets.h | |||
@@ -1 +1,2 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* stub */ | 2 | /* stub */ |
diff --git a/tools/perf/util/include/asm/cpufeature.h b/tools/perf/util/include/asm/cpufeature.h index acffd5e4d1d4..2270481c7e0a 100644 --- a/tools/perf/util/include/asm/cpufeature.h +++ b/tools/perf/util/include/asm/cpufeature.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | #ifndef PERF_CPUFEATURE_H | 3 | #ifndef PERF_CPUFEATURE_H |
3 | #define PERF_CPUFEATURE_H | 4 | #define PERF_CPUFEATURE_H |
diff --git a/tools/perf/util/include/asm/dwarf2.h b/tools/perf/util/include/asm/dwarf2.h index afe38199e922..e9876be63dbf 100644 --- a/tools/perf/util/include/asm/dwarf2.h +++ b/tools/perf/util/include/asm/dwarf2.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | #ifndef PERF_DWARF2_H | 3 | #ifndef PERF_DWARF2_H |
3 | #define PERF_DWARF2_H | 4 | #define PERF_DWARF2_H |
diff --git a/tools/perf/util/include/asm/uaccess.h b/tools/perf/util/include/asm/uaccess.h index d0f72b8fcc35..6a6f4b990547 100644 --- a/tools/perf/util/include/asm/uaccess.h +++ b/tools/perf/util/include/asm/uaccess.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_ASM_UACCESS_H_ | 2 | #ifndef _PERF_ASM_UACCESS_H_ |
2 | #define _PERF_ASM_UACCESS_H_ | 3 | #define _PERF_ASM_UACCESS_H_ |
3 | 4 | ||
diff --git a/tools/perf/util/include/dwarf-regs.h b/tools/perf/util/include/dwarf-regs.h index 43bfd8da7919..7d99a084e82d 100644 --- a/tools/perf/util/include/dwarf-regs.h +++ b/tools/perf/util/include/dwarf-regs.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_DWARF_REGS_H_ | 2 | #ifndef _PERF_DWARF_REGS_H_ |
2 | #define _PERF_DWARF_REGS_H_ | 3 | #define _PERF_DWARF_REGS_H_ |
3 | 4 | ||
diff --git a/tools/perf/util/include/linux/linkage.h b/tools/perf/util/include/linux/linkage.h index 06387cffe125..f01d48a8d707 100644 --- a/tools/perf/util/include/linux/linkage.h +++ b/tools/perf/util/include/linux/linkage.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | 2 | ||
2 | #ifndef PERF_LINUX_LINKAGE_H_ | 3 | #ifndef PERF_LINUX_LINKAGE_H_ |
3 | #define PERF_LINUX_LINKAGE_H_ | 4 | #define PERF_LINUX_LINKAGE_H_ |
diff --git a/tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk b/tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk index 54e961659514..ddd5c4c21129 100644 --- a/tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk +++ b/tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk | |||
@@ -1,4 +1,5 @@ | |||
1 | #!/bin/awk -f | 1 | #!/bin/awk -f |
2 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # gen-insn-attr-x86.awk: Instruction attribute table generator | 3 | # gen-insn-attr-x86.awk: Instruction attribute table generator |
3 | # Written by Masami Hiramatsu <mhiramat@redhat.com> | 4 | # Written by Masami Hiramatsu <mhiramat@redhat.com> |
4 | # | 5 | # |
diff --git a/tools/perf/util/intlist.h b/tools/perf/util/intlist.h index 020b9ca1b47e..85bab8735fa9 100644 --- a/tools/perf/util/intlist.h +++ b/tools/perf/util/intlist.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_INTLIST_H | 2 | #ifndef __PERF_INTLIST_H |
2 | #define __PERF_INTLIST_H | 3 | #define __PERF_INTLIST_H |
3 | 4 | ||
diff --git a/tools/perf/util/jit.h b/tools/perf/util/jit.h index 3f42ee4d2a0b..c2582fa9fe21 100644 --- a/tools/perf/util/jit.h +++ b/tools/perf/util/jit.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __JIT_H__ | 2 | #ifndef __JIT_H__ |
2 | #define __JIT_H__ | 3 | #define __JIT_H__ |
3 | 4 | ||
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c index 9084930e1757..36483db032e8 100644 --- a/tools/perf/util/jitdump.c +++ b/tools/perf/util/jitdump.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <sys/sysmacros.h> | 2 | #include <sys/sysmacros.h> |
2 | #include <sys/types.h> | 3 | #include <sys/types.h> |
3 | #include <errno.h> | 4 | #include <errno.h> |
diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h index d01e73592f6e..7b1f06567521 100644 --- a/tools/perf/util/kvm-stat.h +++ b/tools/perf/util/kvm-stat.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_KVM_STAT_H | 2 | #ifndef __PERF_KVM_STAT_H |
2 | #define __PERF_KVM_STAT_H | 3 | #define __PERF_KVM_STAT_H |
3 | 4 | ||
diff --git a/tools/perf/util/levenshtein.c b/tools/perf/util/levenshtein.c index f616e4f65b67..a217ecf0359d 100644 --- a/tools/perf/util/levenshtein.c +++ b/tools/perf/util/levenshtein.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "levenshtein.h" | 2 | #include "levenshtein.h" |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
diff --git a/tools/perf/util/levenshtein.h b/tools/perf/util/levenshtein.h index b0fcb6d8a881..34ca173c557d 100644 --- a/tools/perf/util/levenshtein.h +++ b/tools/perf/util/levenshtein.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_LEVENSHTEIN_H | 2 | #ifndef __PERF_LEVENSHTEIN_H |
2 | #define __PERF_LEVENSHTEIN_H | 3 | #define __PERF_LEVENSHTEIN_H |
3 | 4 | ||
diff --git a/tools/perf/util/libunwind/arm64.c b/tools/perf/util/libunwind/arm64.c index 6559bc586643..66756e6be111 100644 --- a/tools/perf/util/libunwind/arm64.c +++ b/tools/perf/util/libunwind/arm64.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * This file setups defines to compile arch specific binary from the | 3 | * This file setups defines to compile arch specific binary from the |
3 | * generic one. | 4 | * generic one. |
diff --git a/tools/perf/util/libunwind/x86_32.c b/tools/perf/util/libunwind/x86_32.c index 957ffff72428..c5e568188e19 100644 --- a/tools/perf/util/libunwind/x86_32.c +++ b/tools/perf/util/libunwind/x86_32.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * This file setups defines to compile arch specific binary from the | 3 | * This file setups defines to compile arch specific binary from the |
3 | * generic one. | 4 | * generic one. |
diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c index 209b0c82eff4..4952b429caa7 100644 --- a/tools/perf/util/llvm-utils.c +++ b/tools/perf/util/llvm-utils.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2015, Wang Nan <wangnan0@huawei.com> | 3 | * Copyright (C) 2015, Wang Nan <wangnan0@huawei.com> |
3 | * Copyright (C) 2015, Huawei Inc. | 4 | * Copyright (C) 2015, Huawei Inc. |
diff --git a/tools/perf/util/llvm-utils.h b/tools/perf/util/llvm-utils.h index c87a2a92a88f..d3ad8deb5db4 100644 --- a/tools/perf/util/llvm-utils.h +++ b/tools/perf/util/llvm-utils.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2015, Wang Nan <wangnan0@huawei.com> | 3 | * Copyright (C) 2015, Wang Nan <wangnan0@huawei.com> |
3 | * Copyright (C) 2015, Huawei Inc. | 4 | * Copyright (C) 2015, Huawei Inc. |
diff --git a/tools/perf/util/lzma.c b/tools/perf/util/lzma.c index 4ca7c5c6cdcd..07498eaddc08 100644 --- a/tools/perf/util/lzma.c +++ b/tools/perf/util/lzma.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <lzma.h> | 3 | #include <lzma.h> |
3 | #include <stdio.h> | 4 | #include <stdio.h> |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index df709363ef69..bd5d5b5e2218 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <dirent.h> | 2 | #include <dirent.h> |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <inttypes.h> | 4 | #include <inttypes.h> |
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index 3cdb1340f917..d551aa80a59b 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_MACHINE_H | 2 | #ifndef __PERF_MACHINE_H |
2 | #define __PERF_MACHINE_H | 3 | #define __PERF_MACHINE_H |
3 | 4 | ||
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index bdaa0a4edc17..4e7bd2750122 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "symbol.h" | 2 | #include "symbol.h" |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <inttypes.h> | 4 | #include <inttypes.h> |
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 73aacf7a7dc4..1fb9b8589adc 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_MAP_H | 2 | #ifndef __PERF_MAP_H |
2 | #define __PERF_MAP_H | 3 | #define __PERF_MAP_H |
3 | 4 | ||
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index 28afe5fa84d6..93f74d8d3cdd 100644 --- a/tools/perf/util/mem-events.c +++ b/tools/perf/util/mem-events.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stddef.h> | 2 | #include <stddef.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include <string.h> | 4 | #include <string.h> |
diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h index 40f72ee4f42a..a889ec2fa9f5 100644 --- a/tools/perf/util/mem-events.h +++ b/tools/perf/util/mem-events.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_MEM_EVENTS_H | 2 | #ifndef __PERF_MEM_EVENTS_H |
2 | #define __PERF_MEM_EVENTS_H | 3 | #define __PERF_MEM_EVENTS_H |
3 | 4 | ||
diff --git a/tools/perf/util/memswap.c b/tools/perf/util/memswap.c index 55f7faa8d9ec..c1317e4983bc 100644 --- a/tools/perf/util/memswap.c +++ b/tools/perf/util/memswap.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <byteswap.h> | 2 | #include <byteswap.h> |
2 | #include "memswap.h" | 3 | #include "memswap.h" |
3 | #include <linux/types.h> | 4 | #include <linux/types.h> |
diff --git a/tools/perf/util/memswap.h b/tools/perf/util/memswap.h index 7d1b1c34bb57..1e29ff903ca9 100644 --- a/tools/perf/util/memswap.h +++ b/tools/perf/util/memswap.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_MEMSWAP_H_ | 2 | #ifndef PERF_MEMSWAP_H_ |
2 | #define PERF_MEMSWAP_H_ | 3 | #define PERF_MEMSWAP_H_ |
3 | 4 | ||
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c index 4de398cfb577..8e09fd2d842f 100644 --- a/tools/perf/util/ordered-events.c +++ b/tools/perf/util/ordered-events.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <linux/list.h> | 4 | #include <linux/list.h> |
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h index e11468a9a6e4..96e5292d88e2 100644 --- a/tools/perf/util/ordered-events.h +++ b/tools/perf/util/ordered-events.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __ORDERED_EVENTS_H | 2 | #ifndef __ORDERED_EVENTS_H |
2 | #define __ORDERED_EVENTS_H | 3 | #define __ORDERED_EVENTS_H |
3 | 4 | ||
diff --git a/tools/perf/util/parse-branch-options.c b/tools/perf/util/parse-branch-options.c index e71fb5f31e84..bd779d9f4d1e 100644 --- a/tools/perf/util/parse-branch-options.c +++ b/tools/perf/util/parse-branch-options.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "perf.h" | 2 | #include "perf.h" |
2 | #include "util/util.h" | 3 | #include "util/util.h" |
3 | #include "util/debug.h" | 4 | #include "util/debug.h" |
diff --git a/tools/perf/util/parse-branch-options.h b/tools/perf/util/parse-branch-options.h index 6086fd90eb23..11d1722733f2 100644 --- a/tools/perf/util/parse-branch-options.h +++ b/tools/perf/util/parse-branch-options.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_PARSE_BRANCH_OPTIONS_H | 2 | #ifndef _PERF_PARSE_BRANCH_OPTIONS_H |
2 | #define _PERF_PARSE_BRANCH_OPTIONS_H 1 | 3 | #define _PERF_PARSE_BRANCH_OPTIONS_H 1 |
3 | #include <stdint.h> | 4 | #include <stdint.h> |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index f6257fb4f08c..56694e3409ea 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/hw_breakpoint.h> | 2 | #include <linux/hw_breakpoint.h> |
2 | #include <linux/err.h> | 3 | #include <linux/err.h> |
3 | #include <dirent.h> | 4 | #include <dirent.h> |
@@ -309,10 +310,11 @@ static char *get_config_name(struct list_head *head_terms) | |||
309 | static struct perf_evsel * | 310 | static struct perf_evsel * |
310 | __add_event(struct list_head *list, int *idx, | 311 | __add_event(struct list_head *list, int *idx, |
311 | struct perf_event_attr *attr, | 312 | struct perf_event_attr *attr, |
312 | char *name, struct cpu_map *cpus, | 313 | char *name, struct perf_pmu *pmu, |
313 | struct list_head *config_terms, bool auto_merge_stats) | 314 | struct list_head *config_terms, bool auto_merge_stats) |
314 | { | 315 | { |
315 | struct perf_evsel *evsel; | 316 | struct perf_evsel *evsel; |
317 | struct cpu_map *cpus = pmu ? pmu->cpus : NULL; | ||
316 | 318 | ||
317 | event_attr_init(attr); | 319 | event_attr_init(attr); |
318 | 320 | ||
@@ -323,7 +325,7 @@ __add_event(struct list_head *list, int *idx, | |||
323 | (*idx)++; | 325 | (*idx)++; |
324 | evsel->cpus = cpu_map__get(cpus); | 326 | evsel->cpus = cpu_map__get(cpus); |
325 | evsel->own_cpus = cpu_map__get(cpus); | 327 | evsel->own_cpus = cpu_map__get(cpus); |
326 | evsel->system_wide = !!cpus; | 328 | evsel->system_wide = pmu ? pmu->is_uncore : false; |
327 | evsel->auto_merge_stats = auto_merge_stats; | 329 | evsel->auto_merge_stats = auto_merge_stats; |
328 | 330 | ||
329 | if (name) | 331 | if (name) |
@@ -1233,7 +1235,7 @@ static int __parse_events_add_pmu(struct parse_events_state *parse_state, | |||
1233 | 1235 | ||
1234 | if (!head_config) { | 1236 | if (!head_config) { |
1235 | attr.type = pmu->type; | 1237 | attr.type = pmu->type; |
1236 | evsel = __add_event(list, &parse_state->idx, &attr, NULL, pmu->cpus, NULL, auto_merge_stats); | 1238 | evsel = __add_event(list, &parse_state->idx, &attr, NULL, pmu, NULL, auto_merge_stats); |
1237 | return evsel ? 0 : -ENOMEM; | 1239 | return evsel ? 0 : -ENOMEM; |
1238 | } | 1240 | } |
1239 | 1241 | ||
@@ -1254,7 +1256,7 @@ static int __parse_events_add_pmu(struct parse_events_state *parse_state, | |||
1254 | return -EINVAL; | 1256 | return -EINVAL; |
1255 | 1257 | ||
1256 | evsel = __add_event(list, &parse_state->idx, &attr, | 1258 | evsel = __add_event(list, &parse_state->idx, &attr, |
1257 | get_config_name(head_config), pmu->cpus, | 1259 | get_config_name(head_config), pmu, |
1258 | &config_terms, auto_merge_stats); | 1260 | &config_terms, auto_merge_stats); |
1259 | if (evsel) { | 1261 | if (evsel) { |
1260 | evsel->unit = info.unit; | 1262 | evsel->unit = info.unit; |
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index 635135125111..eed50b54bab3 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_PARSE_EVENTS_H | 2 | #ifndef __PERF_PARSE_EVENTS_H |
2 | #define __PERF_PARSE_EVENTS_H | 3 | #define __PERF_PARSE_EVENTS_H |
3 | /* | 4 | /* |
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index c42edeac451f..6680e4fb7967 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l | |||
@@ -8,6 +8,9 @@ | |||
8 | 8 | ||
9 | %{ | 9 | %{ |
10 | #include <errno.h> | 10 | #include <errno.h> |
11 | #include <sys/types.h> | ||
12 | #include <sys/stat.h> | ||
13 | #include <unistd.h> | ||
11 | #include "../perf.h" | 14 | #include "../perf.h" |
12 | #include "parse-events.h" | 15 | #include "parse-events.h" |
13 | #include "parse-events-bison.h" | 16 | #include "parse-events-bison.h" |
@@ -53,9 +56,8 @@ static int str(yyscan_t scanner, int token) | |||
53 | return token; | 56 | return token; |
54 | } | 57 | } |
55 | 58 | ||
56 | static bool isbpf(yyscan_t scanner) | 59 | static bool isbpf_suffix(char *text) |
57 | { | 60 | { |
58 | char *text = parse_events_get_text(scanner); | ||
59 | int len = strlen(text); | 61 | int len = strlen(text); |
60 | 62 | ||
61 | if (len < 2) | 63 | if (len < 2) |
@@ -68,6 +70,17 @@ static bool isbpf(yyscan_t scanner) | |||
68 | return false; | 70 | return false; |
69 | } | 71 | } |
70 | 72 | ||
73 | static bool isbpf(yyscan_t scanner) | ||
74 | { | ||
75 | char *text = parse_events_get_text(scanner); | ||
76 | struct stat st; | ||
77 | |||
78 | if (!isbpf_suffix(text)) | ||
79 | return false; | ||
80 | |||
81 | return stat(text, &st) == 0; | ||
82 | } | ||
83 | |||
71 | /* | 84 | /* |
72 | * This function is called when the parser gets two kind of input: | 85 | * This function is called when the parser gets two kind of input: |
73 | * | 86 | * |
@@ -141,6 +154,10 @@ do { \ | |||
141 | yycolumn += yyleng; \ | 154 | yycolumn += yyleng; \ |
142 | } while (0); | 155 | } while (0); |
143 | 156 | ||
157 | #define USER_REJECT \ | ||
158 | yycolumn -= yyleng; \ | ||
159 | REJECT | ||
160 | |||
144 | %} | 161 | %} |
145 | 162 | ||
146 | %x mem | 163 | %x mem |
@@ -322,8 +339,8 @@ r{num_raw_hex} { return raw(yyscanner); } | |||
322 | {num_hex} { return value(yyscanner, 16); } | 339 | {num_hex} { return value(yyscanner, 16); } |
323 | 340 | ||
324 | {modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); } | 341 | {modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); } |
325 | {bpf_object} { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_OBJECT); } | 342 | {bpf_object} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_OBJECT); } |
326 | {bpf_source} { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_SOURCE); } | 343 | {bpf_source} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_SOURCE); } |
327 | {name} { return pmu_str_check(yyscanner); } | 344 | {name} { return pmu_str_check(yyscanner); } |
328 | "/" { BEGIN(config); return '/'; } | 345 | "/" { BEGIN(config); return '/'; } |
329 | - { return '-'; } | 346 | - { return '-'; } |
diff --git a/tools/perf/util/parse-regs-options.c b/tools/perf/util/parse-regs-options.c index 646ecf736aad..e6599e290f46 100644 --- a/tools/perf/util/parse-regs-options.c +++ b/tools/perf/util/parse-regs-options.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "perf.h" | 2 | #include "perf.h" |
2 | #include "util/util.h" | 3 | #include "util/util.h" |
3 | #include "util/debug.h" | 4 | #include "util/debug.h" |
diff --git a/tools/perf/util/parse-regs-options.h b/tools/perf/util/parse-regs-options.h index 7d762b188007..cdefb1acf6be 100644 --- a/tools/perf/util/parse-regs-options.h +++ b/tools/perf/util/parse-regs-options.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_PARSE_REGS_OPTIONS_H | 2 | #ifndef _PERF_PARSE_REGS_OPTIONS_H |
2 | #define _PERF_PARSE_REGS_OPTIONS_H 1 | 3 | #define _PERF_PARSE_REGS_OPTIONS_H 1 |
3 | struct option; | 4 | struct option; |
diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c index 50ec3bc87a60..933f5c6bffb4 100644 --- a/tools/perf/util/path.c +++ b/tools/perf/util/path.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * I'm tired of doing "vsnprintf()" etc just to open a | 3 | * I'm tired of doing "vsnprintf()" etc just to open a |
3 | * file, so here's a "return static buffer with printf" | 4 | * file, so here's a "return static buffer with printf" |
diff --git a/tools/perf/util/path.h b/tools/perf/util/path.h index 9a276a58e3c2..14a254ada7eb 100644 --- a/tools/perf/util/path.h +++ b/tools/perf/util/path.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_PATH_H | 2 | #ifndef _PERF_PATH_H |
2 | #define _PERF_PATH_H | 3 | #define _PERF_PATH_H |
3 | 4 | ||
diff --git a/tools/perf/util/perf-hooks.c b/tools/perf/util/perf-hooks.c index d55092964da2..4f3aa8d99ef4 100644 --- a/tools/perf/util/perf-hooks.c +++ b/tools/perf/util/perf-hooks.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * perf_hooks.c | 3 | * perf_hooks.c |
3 | * | 4 | * |
diff --git a/tools/perf/util/perf-hooks.h b/tools/perf/util/perf-hooks.h index 838d5797bc1e..27fbec62d4fe 100644 --- a/tools/perf/util/perf-hooks.h +++ b/tools/perf/util/perf-hooks.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_UTIL_PERF_HOOKS_H | 2 | #ifndef PERF_UTIL_PERF_HOOKS_H |
2 | #define PERF_UTIL_PERF_HOOKS_H | 3 | #define PERF_UTIL_PERF_HOOKS_H |
3 | 4 | ||
diff --git a/tools/perf/util/perf_regs.c b/tools/perf/util/perf_regs.c index b2ae039eff85..2acfcc527cac 100644 --- a/tools/perf/util/perf_regs.c +++ b/tools/perf/util/perf_regs.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include "perf_regs.h" | 3 | #include "perf_regs.h" |
3 | #include "event.h" | 4 | #include "event.h" |
diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h index 32b37d19dcc3..c9319f8d17a6 100644 --- a/tools/perf/util/perf_regs.h +++ b/tools/perf/util/perf_regs.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_REGS_H | 2 | #ifndef __PERF_REGS_H |
2 | #define __PERF_REGS_H | 3 | #define __PERF_REGS_H |
3 | 4 | ||
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index ac16a9db1fb5..b10b35a63138 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/list.h> | 2 | #include <linux/list.h> |
2 | #include <linux/compiler.h> | 3 | #include <linux/compiler.h> |
3 | #include <sys/types.h> | 4 | #include <sys/types.h> |
@@ -470,17 +471,36 @@ static void pmu_read_sysfs(void) | |||
470 | closedir(dir); | 471 | closedir(dir); |
471 | } | 472 | } |
472 | 473 | ||
474 | static struct cpu_map *__pmu_cpumask(const char *path) | ||
475 | { | ||
476 | FILE *file; | ||
477 | struct cpu_map *cpus; | ||
478 | |||
479 | file = fopen(path, "r"); | ||
480 | if (!file) | ||
481 | return NULL; | ||
482 | |||
483 | cpus = cpu_map__read(file); | ||
484 | fclose(file); | ||
485 | return cpus; | ||
486 | } | ||
487 | |||
488 | /* | ||
489 | * Uncore PMUs have a "cpumask" file under sysfs. CPU PMUs (e.g. on arm/arm64) | ||
490 | * may have a "cpus" file. | ||
491 | */ | ||
492 | #define CPUS_TEMPLATE_UNCORE "%s/bus/event_source/devices/%s/cpumask" | ||
493 | #define CPUS_TEMPLATE_CPU "%s/bus/event_source/devices/%s/cpus" | ||
494 | |||
473 | static struct cpu_map *pmu_cpumask(const char *name) | 495 | static struct cpu_map *pmu_cpumask(const char *name) |
474 | { | 496 | { |
475 | struct stat st; | ||
476 | char path[PATH_MAX]; | 497 | char path[PATH_MAX]; |
477 | FILE *file; | ||
478 | struct cpu_map *cpus; | 498 | struct cpu_map *cpus; |
479 | const char *sysfs = sysfs__mountpoint(); | 499 | const char *sysfs = sysfs__mountpoint(); |
480 | const char *templates[] = { | 500 | const char *templates[] = { |
481 | "%s/bus/event_source/devices/%s/cpumask", | 501 | CPUS_TEMPLATE_UNCORE, |
482 | "%s/bus/event_source/devices/%s/cpus", | 502 | CPUS_TEMPLATE_CPU, |
483 | NULL | 503 | NULL |
484 | }; | 504 | }; |
485 | const char **template; | 505 | const char **template; |
486 | 506 | ||
@@ -489,20 +509,25 @@ static struct cpu_map *pmu_cpumask(const char *name) | |||
489 | 509 | ||
490 | for (template = templates; *template; template++) { | 510 | for (template = templates; *template; template++) { |
491 | snprintf(path, PATH_MAX, *template, sysfs, name); | 511 | snprintf(path, PATH_MAX, *template, sysfs, name); |
492 | if (stat(path, &st) == 0) | 512 | cpus = __pmu_cpumask(path); |
493 | break; | 513 | if (cpus) |
514 | return cpus; | ||
494 | } | 515 | } |
495 | 516 | ||
496 | if (!*template) | 517 | return NULL; |
497 | return NULL; | 518 | } |
498 | 519 | ||
499 | file = fopen(path, "r"); | 520 | static bool pmu_is_uncore(const char *name) |
500 | if (!file) | 521 | { |
501 | return NULL; | 522 | char path[PATH_MAX]; |
523 | struct cpu_map *cpus; | ||
524 | const char *sysfs = sysfs__mountpoint(); | ||
502 | 525 | ||
503 | cpus = cpu_map__read(file); | 526 | snprintf(path, PATH_MAX, CPUS_TEMPLATE_UNCORE, sysfs, name); |
504 | fclose(file); | 527 | cpus = __pmu_cpumask(path); |
505 | return cpus; | 528 | cpu_map__put(cpus); |
529 | |||
530 | return !!cpus; | ||
506 | } | 531 | } |
507 | 532 | ||
508 | /* | 533 | /* |
@@ -617,6 +642,8 @@ static struct perf_pmu *pmu_lookup(const char *name) | |||
617 | 642 | ||
618 | pmu->cpus = pmu_cpumask(name); | 643 | pmu->cpus = pmu_cpumask(name); |
619 | 644 | ||
645 | pmu->is_uncore = pmu_is_uncore(name); | ||
646 | |||
620 | INIT_LIST_HEAD(&pmu->format); | 647 | INIT_LIST_HEAD(&pmu->format); |
621 | INIT_LIST_HEAD(&pmu->aliases); | 648 | INIT_LIST_HEAD(&pmu->aliases); |
622 | list_splice(&format, &pmu->format); | 649 | list_splice(&format, &pmu->format); |
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 389e9729331f..eca99435f4a0 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PMU_H | 2 | #ifndef __PMU_H |
2 | #define __PMU_H | 3 | #define __PMU_H |
3 | 4 | ||
@@ -22,6 +23,7 @@ struct perf_pmu { | |||
22 | char *name; | 23 | char *name; |
23 | __u32 type; | 24 | __u32 type; |
24 | bool selectable; | 25 | bool selectable; |
26 | bool is_uncore; | ||
25 | struct perf_event_attr *default_config; | 27 | struct perf_event_attr *default_config; |
26 | struct cpu_map *cpus; | 28 | struct cpu_map *cpus; |
27 | struct list_head format; /* HEAD struct perf_pmu_format -> list */ | 29 | struct list_head format; /* HEAD struct perf_pmu_format -> list */ |
diff --git a/tools/perf/util/print_binary.c b/tools/perf/util/print_binary.c index e908177b9976..779e35c9e566 100644 --- a/tools/perf/util/print_binary.c +++ b/tools/perf/util/print_binary.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "print_binary.h" | 2 | #include "print_binary.h" |
2 | #include <linux/log2.h> | 3 | #include <linux/log2.h> |
3 | #include "sane_ctype.h" | 4 | #include "sane_ctype.h" |
diff --git a/tools/perf/util/print_binary.h b/tools/perf/util/print_binary.h index da0427263d2d..2be3075e2b05 100644 --- a/tools/perf/util/print_binary.h +++ b/tools/perf/util/print_binary.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_PRINT_BINARY_H | 2 | #ifndef PERF_PRINT_BINARY_H |
2 | #define PERF_PRINT_BINARY_H | 3 | #define PERF_PRINT_BINARY_H |
3 | 4 | ||
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h index 078681d12168..45b14f020558 100644 --- a/tools/perf/util/probe-event.h +++ b/tools/perf/util/probe-event.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PROBE_EVENT_H | 2 | #ifndef _PROBE_EVENT_H |
2 | #define _PROBE_EVENT_H | 3 | #define _PROBE_EVENT_H |
3 | 4 | ||
diff --git a/tools/perf/util/probe-file.h b/tools/perf/util/probe-file.h index 2ca4163abafe..63f29b1d22c1 100644 --- a/tools/perf/util/probe-file.h +++ b/tools/perf/util/probe-file.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PROBE_FILE_H | 2 | #ifndef __PROBE_FILE_H |
2 | #define __PROBE_FILE_H | 3 | #define __PROBE_FILE_H |
3 | 4 | ||
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h index 27f061551012..16252980ff00 100644 --- a/tools/perf/util/probe-finder.h +++ b/tools/perf/util/probe-finder.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PROBE_FINDER_H | 2 | #ifndef _PROBE_FINDER_H |
2 | #define _PROBE_FINDER_H | 3 | #define _PROBE_FINDER_H |
3 | 4 | ||
diff --git a/tools/perf/util/pstack.c b/tools/perf/util/pstack.c index b234a6e3d0d4..797fe1ae2d2e 100644 --- a/tools/perf/util/pstack.c +++ b/tools/perf/util/pstack.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Simple pointer stack | 3 | * Simple pointer stack |
3 | * | 4 | * |
diff --git a/tools/perf/util/pstack.h b/tools/perf/util/pstack.h index ded7f2e36624..8729b8be061d 100644 --- a/tools/perf/util/pstack.h +++ b/tools/perf/util/pstack.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_PSTACK_ | 2 | #ifndef _PERF_PSTACK_ |
2 | #define _PERF_PSTACK_ | 3 | #define _PERF_PSTACK_ |
3 | 4 | ||
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index c129e99114ae..8e49d9cafcfc 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <Python.h> | 2 | #include <Python.h> |
2 | #include <structmember.h> | 3 | #include <structmember.h> |
3 | #include <inttypes.h> | 4 | #include <inttypes.h> |
diff --git a/tools/perf/util/quote.c b/tools/perf/util/quote.c index 1ba8920151d8..22eaa201aa27 100644 --- a/tools/perf/util/quote.c +++ b/tools/perf/util/quote.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include "strbuf.h" | 4 | #include "strbuf.h" |
diff --git a/tools/perf/util/quote.h b/tools/perf/util/quote.h index 055ca45bed99..274bf26d3511 100644 --- a/tools/perf/util/quote.h +++ b/tools/perf/util/quote.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_QUOTE_H | 2 | #ifndef __PERF_QUOTE_H |
2 | #define __PERF_QUOTE_H | 3 | #define __PERF_QUOTE_H |
3 | 4 | ||
diff --git a/tools/perf/util/rb_resort.h b/tools/perf/util/rb_resort.h index 808cc45611fe..7d8972b33f6b 100644 --- a/tools/perf/util/rb_resort.h +++ b/tools/perf/util/rb_resort.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_RESORT_RB_H_ | 2 | #ifndef _PERF_RESORT_RB_H_ |
2 | #define _PERF_RESORT_RB_H_ | 3 | #define _PERF_RESORT_RB_H_ |
3 | /* | 4 | /* |
diff --git a/tools/perf/util/rblist.h b/tools/perf/util/rblist.h index ff9913b994c2..4c8638a22571 100644 --- a/tools/perf/util/rblist.h +++ b/tools/perf/util/rblist.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_RBLIST_H | 2 | #ifndef __PERF_RBLIST_H |
2 | #define __PERF_RBLIST_H | 3 | #define __PERF_RBLIST_H |
3 | 4 | ||
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index d91bdf5a1aa4..1e97937b03a9 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "evlist.h" | 2 | #include "evlist.h" |
2 | #include "evsel.h" | 3 | #include "evsel.h" |
3 | #include "cpumap.h" | 4 | #include "cpumap.h" |
diff --git a/tools/perf/util/sane_ctype.h b/tools/perf/util/sane_ctype.h index 4308c22c22ad..c2b42ff9ff32 100644 --- a/tools/perf/util/sane_ctype.h +++ b/tools/perf/util/sane_ctype.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_SANE_CTYPE_H | 2 | #ifndef _PERF_SANE_CTYPE_H |
2 | #define _PERF_SANE_CTYPE_H | 3 | #define _PERF_SANE_CTYPE_H |
3 | 4 | ||
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index a7ebd9fe8e40..da55081aefc6 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
@@ -374,6 +375,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool) | |||
374 | tool->mmap2 = process_event_stub; | 375 | tool->mmap2 = process_event_stub; |
375 | if (tool->comm == NULL) | 376 | if (tool->comm == NULL) |
376 | tool->comm = process_event_stub; | 377 | tool->comm = process_event_stub; |
378 | if (tool->namespaces == NULL) | ||
379 | tool->namespaces = process_event_stub; | ||
377 | if (tool->fork == NULL) | 380 | if (tool->fork == NULL) |
378 | tool->fork = process_event_stub; | 381 | tool->fork = process_event_stub; |
379 | if (tool->exit == NULL) | 382 | if (tool->exit == NULL) |
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 47b5e7dbcb18..41caa098ed15 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_SESSION_H | 2 | #ifndef __PERF_SESSION_H |
2 | #define __PERF_SESSION_H | 3 | #define __PERF_SESSION_H |
3 | 4 | ||
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index eb3ab902a1c0..84a33f1e9ec9 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <regex.h> | 4 | #include <regex.h> |
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index f36dc4980a6c..b2b55e5149a7 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_SORT_H | 2 | #ifndef __PERF_SORT_H |
2 | #define __PERF_SORT_H | 3 | #define __PERF_SORT_H |
3 | #include "../builtin.h" | 4 | #include "../builtin.h" |
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c index ed8e8d2de942..4105682afc7a 100644 --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <inttypes.h> | 2 | #include <inttypes.h> |
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
diff --git a/tools/perf/util/srcline.h b/tools/perf/util/srcline.h index 7b52ba88676e..8e73f607dfa3 100644 --- a/tools/perf/util/srcline.h +++ b/tools/perf/util/srcline.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_SRCLINE_H | 2 | #ifndef PERF_SRCLINE_H |
2 | #define PERF_SRCLINE_H | 3 | #define PERF_SRCLINE_H |
3 | 4 | ||
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index a04cf56d3517..37363869c9a1 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include "evsel.h" | 3 | #include "evsel.h" |
3 | #include "stat.h" | 4 | #include "stat.h" |
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 35e9848734d6..c9bae5fb8b47 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <math.h> | 4 | #include <math.h> |
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index eacaf958e19d..96326b1f9443 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_STATS_H | 2 | #ifndef __PERF_STATS_H |
2 | #define __PERF_STATS_H | 3 | #define __PERF_STATS_H |
3 | 4 | ||
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c index aafe908b82b5..3d1cf5bf7f18 100644 --- a/tools/perf/util/strbuf.c +++ b/tools/perf/util/strbuf.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "debug.h" | 2 | #include "debug.h" |
2 | #include "util.h" | 3 | #include "util.h" |
3 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
diff --git a/tools/perf/util/strbuf.h b/tools/perf/util/strbuf.h index 802d743378af..ea94d8628980 100644 --- a/tools/perf/util/strbuf.h +++ b/tools/perf/util/strbuf.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_STRBUF_H | 2 | #ifndef __PERF_STRBUF_H |
2 | #define __PERF_STRBUF_H | 3 | #define __PERF_STRBUF_H |
3 | 4 | ||
diff --git a/tools/perf/util/strfilter.c b/tools/perf/util/strfilter.c index 4dc0af669a30..7f3253d44afd 100644 --- a/tools/perf/util/strfilter.c +++ b/tools/perf/util/strfilter.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "util.h" | 2 | #include "util.h" |
2 | #include "string2.h" | 3 | #include "string2.h" |
3 | #include "strfilter.h" | 4 | #include "strfilter.h" |
diff --git a/tools/perf/util/strfilter.h b/tools/perf/util/strfilter.h index cff5eda88728..e0c25a40f796 100644 --- a/tools/perf/util/strfilter.h +++ b/tools/perf/util/strfilter.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_STRFILTER_H | 2 | #ifndef __PERF_STRFILTER_H |
2 | #define __PERF_STRFILTER_H | 3 | #define __PERF_STRFILTER_H |
3 | /* General purpose glob matching filter */ | 4 | /* General purpose glob matching filter */ |
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c index cca53b693a48..aaa08ee8c717 100644 --- a/tools/perf/util/string.c +++ b/tools/perf/util/string.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "string2.h" | 2 | #include "string2.h" |
2 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
3 | #include <linux/string.h> | 4 | #include <linux/string.h> |
diff --git a/tools/perf/util/string2.h b/tools/perf/util/string2.h index 2f619681bd6a..ee14ca5451ab 100644 --- a/tools/perf/util/string2.h +++ b/tools/perf/util/string2.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_STRING_H | 2 | #ifndef PERF_STRING_H |
2 | #define PERF_STRING_H | 3 | #define PERF_STRING_H |
3 | 4 | ||
diff --git a/tools/perf/util/strlist.h b/tools/perf/util/strlist.h index 19207e50fce5..d58f1e08b170 100644 --- a/tools/perf/util/strlist.h +++ b/tools/perf/util/strlist.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_STRLIST_H | 2 | #ifndef __PERF_STRLIST_H |
2 | #define __PERF_STRLIST_H | 3 | #define __PERF_STRLIST_H |
3 | 4 | ||
diff --git a/tools/perf/util/svghelper.h b/tools/perf/util/svghelper.h index 946fdf2db97c..e55338d5c3bd 100644 --- a/tools/perf/util/svghelper.h +++ b/tools/perf/util/svghelper.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_SVGHELPER_H | 2 | #ifndef __PERF_SVGHELPER_H |
2 | #define __PERF_SVGHELPER_H | 3 | #define __PERF_SVGHELPER_H |
3 | 4 | ||
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 5c39f420111e..2de770511e70 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <fcntl.h> | 2 | #include <fcntl.h> |
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include <errno.h> | 4 | #include <errno.h> |
@@ -810,12 +811,6 @@ static u64 ref_reloc(struct kmap *kmap) | |||
810 | void __weak arch__sym_update(struct symbol *s __maybe_unused, | 811 | void __weak arch__sym_update(struct symbol *s __maybe_unused, |
811 | GElf_Sym *sym __maybe_unused) { } | 812 | GElf_Sym *sym __maybe_unused) { } |
812 | 813 | ||
813 | void __weak arch__adjust_sym_map_offset(GElf_Sym *sym, GElf_Shdr *shdr, | ||
814 | struct map *map __maybe_unused) | ||
815 | { | ||
816 | sym->st_value -= shdr->sh_addr - shdr->sh_offset; | ||
817 | } | ||
818 | |||
819 | int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, | 814 | int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, |
820 | struct symsrc *runtime_ss, int kmodule) | 815 | struct symsrc *runtime_ss, int kmodule) |
821 | { | 816 | { |
@@ -996,7 +991,7 @@ int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, | |||
996 | 991 | ||
997 | /* Adjust symbol to map to file offset */ | 992 | /* Adjust symbol to map to file offset */ |
998 | if (adjust_kernel_syms) | 993 | if (adjust_kernel_syms) |
999 | arch__adjust_sym_map_offset(&sym, &shdr, map); | 994 | sym.st_value -= shdr.sh_addr - shdr.sh_offset; |
1000 | 995 | ||
1001 | if (strcmp(section_name, | 996 | if (strcmp(section_name, |
1002 | (curr_dso->short_name + | 997 | (curr_dso->short_name + |
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c index 1a5aa35b0100..ff48d0d49584 100644 --- a/tools/perf/util/symbol-minimal.c +++ b/tools/perf/util/symbol-minimal.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "symbol.h" | 2 | #include "symbol.h" |
2 | #include "util.h" | 3 | #include "util.h" |
3 | 4 | ||
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 5909ee4c7ade..6492ef38b090 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <dirent.h> | 2 | #include <dirent.h> |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 2bd6a1f01a1c..6352022593c6 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_SYMBOL | 2 | #ifndef __PERF_SYMBOL |
2 | #define __PERF_SYMBOL 1 | 3 | #define __PERF_SYMBOL 1 |
3 | 4 | ||
@@ -344,9 +345,6 @@ int setup_intlist(struct intlist **list, const char *list_str, | |||
344 | #ifdef HAVE_LIBELF_SUPPORT | 345 | #ifdef HAVE_LIBELF_SUPPORT |
345 | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr); | 346 | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr); |
346 | void arch__sym_update(struct symbol *s, GElf_Sym *sym); | 347 | void arch__sym_update(struct symbol *s, GElf_Sym *sym); |
347 | void arch__adjust_sym_map_offset(GElf_Sym *sym, | ||
348 | GElf_Shdr *shdr __maybe_unused, | ||
349 | struct map *map __maybe_unused); | ||
350 | #endif | 348 | #endif |
351 | 349 | ||
352 | #define SYMBOL_A 0 | 350 | #define SYMBOL_A 0 |
diff --git a/tools/perf/util/symbol_fprintf.c b/tools/perf/util/symbol_fprintf.c index 63694e174e5c..6dd2cb88ccbe 100644 --- a/tools/perf/util/symbol_fprintf.c +++ b/tools/perf/util/symbol_fprintf.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <elf.h> | 2 | #include <elf.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <stdio.h> | 4 | #include <stdio.h> |
diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 19e5db90394c..6eea7cff3d4e 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c | |||
@@ -15,9 +15,9 @@ | |||
15 | 15 | ||
16 | #include "syscalltbl.h" | 16 | #include "syscalltbl.h" |
17 | #include <stdlib.h> | 17 | #include <stdlib.h> |
18 | #include <linux/compiler.h> | ||
18 | 19 | ||
19 | #ifdef HAVE_SYSCALL_TABLE | 20 | #ifdef HAVE_SYSCALL_TABLE |
20 | #include <linux/compiler.h> | ||
21 | #include <string.h> | 21 | #include <string.h> |
22 | #include "string2.h" | 22 | #include "string2.h" |
23 | #include "util.h" | 23 | #include "util.h" |
diff --git a/tools/perf/util/syscalltbl.h b/tools/perf/util/syscalltbl.h index e9fb8786da7c..c8e7e9ce0f01 100644 --- a/tools/perf/util/syscalltbl.h +++ b/tools/perf/util/syscalltbl.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_SYSCALLTBL_H | 2 | #ifndef __PERF_SYSCALLTBL_H |
2 | #define __PERF_SYSCALLTBL_H | 3 | #define __PERF_SYSCALLTBL_H |
3 | 4 | ||
diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h index 7381b1ca4041..446aa7a56f25 100644 --- a/tools/perf/util/target.h +++ b/tools/perf/util/target.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_TARGET_H | 2 | #ifndef _PERF_TARGET_H |
2 | #define _PERF_TARGET_H | 3 | #define _PERF_TARGET_H |
3 | 4 | ||
diff --git a/tools/perf/util/term.c b/tools/perf/util/term.c index 8f254a74d97d..e7aa82c06c76 100644 --- a/tools/perf/util/term.c +++ b/tools/perf/util/term.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "term.h" | 2 | #include "term.h" |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include <termios.h> | 4 | #include <termios.h> |
diff --git a/tools/perf/util/term.h b/tools/perf/util/term.h index 2c06a61846a1..607b170a9017 100644 --- a/tools/perf/util/term.h +++ b/tools/perf/util/term.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_TERM_H | 2 | #ifndef __PERF_TERM_H |
2 | #define __PERF_TERM_H | 3 | #define __PERF_TERM_H |
3 | 4 | ||
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index aee9a42102ba..1dbcd3c8dee0 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "../perf.h" | 2 | #include "../perf.h" |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index cb1a5dd5c2b9..fdcea7c0cac1 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_THREAD_H | 2 | #ifndef __PERF_THREAD_H |
2 | #define __PERF_THREAD_H | 3 | #define __PERF_THREAD_H |
3 | 4 | ||
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c index 63ead7b06324..be0d5a736dea 100644 --- a/tools/perf/util/thread_map.c +++ b/tools/perf/util/thread_map.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <dirent.h> | 2 | #include <dirent.h> |
2 | #include <errno.h> | 3 | #include <errno.h> |
3 | #include <limits.h> | 4 | #include <limits.h> |
diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h index bd34d7a0b9fa..f15803985435 100644 --- a/tools/perf/util/thread_map.h +++ b/tools/perf/util/thread_map.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_THREAD_MAP_H | 2 | #ifndef __PERF_THREAD_MAP_H |
2 | #define __PERF_THREAD_MAP_H | 3 | #define __PERF_THREAD_MAP_H |
3 | 4 | ||
diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c index 5b5d0214debd..81927d027417 100644 --- a/tools/perf/util/time-utils.c +++ b/tools/perf/util/time-utils.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdlib.h> | 2 | #include <stdlib.h> |
2 | #include <string.h> | 3 | #include <string.h> |
3 | #include <sys/time.h> | 4 | #include <sys/time.h> |
diff --git a/tools/perf/util/time-utils.h b/tools/perf/util/time-utils.h index 8656be08513b..15b475c50ccf 100644 --- a/tools/perf/util/time-utils.h +++ b/tools/perf/util/time-utils.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _TIME_UTILS_H_ | 2 | #ifndef _TIME_UTILS_H_ |
2 | #define _TIME_UTILS_H_ | 3 | #define _TIME_UTILS_H_ |
3 | 4 | ||
diff --git a/tools/perf/util/tool.h b/tools/perf/util/tool.h index d549e50db397..2532b558099b 100644 --- a/tools/perf/util/tool.h +++ b/tools/perf/util/tool.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_TOOL_H | 2 | #ifndef __PERF_TOOL_H |
2 | #define __PERF_TOOL_H | 3 | #define __PERF_TOOL_H |
3 | 4 | ||
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h index 9bdfb78a9a35..506150a75bd0 100644 --- a/tools/perf/util/top.h +++ b/tools/perf/util/top.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_TOP_H | 2 | #ifndef __PERF_TOP_H |
2 | #define __PERF_TOP_H 1 | 3 | #define __PERF_TOP_H 1 |
3 | 4 | ||
diff --git a/tools/perf/util/trace-event.c b/tools/perf/util/trace-event.c index c330780674fc..16a776371d03 100644 --- a/tools/perf/util/trace-event.c +++ b/tools/perf/util/trace-event.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | 2 | ||
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include <unistd.h> | 4 | #include <unistd.h> |
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h index 1fbc044f9eb0..dcbdb53dc702 100644 --- a/tools/perf/util/trace-event.h +++ b/tools/perf/util/trace-event.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_UTIL_TRACE_EVENT_H | 2 | #ifndef _PERF_UTIL_TRACE_EVENT_H |
2 | #define _PERF_UTIL_TRACE_EVENT_H | 3 | #define _PERF_UTIL_TRACE_EVENT_H |
3 | 4 | ||
diff --git a/tools/perf/util/trigger.h b/tools/perf/util/trigger.h index e97d7016d771..370138e7e35c 100644 --- a/tools/perf/util/trigger.h +++ b/tools/perf/util/trigger.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __TRIGGER_H_ | 2 | #ifndef __TRIGGER_H_ |
2 | #define __TRIGGER_H_ 1 | 3 | #define __TRIGGER_H_ 1 |
3 | 4 | ||
diff --git a/tools/perf/util/tsc.c b/tools/perf/util/tsc.c index 1b741646eed0..bfa782421cbd 100644 --- a/tools/perf/util/tsc.c +++ b/tools/perf/util/tsc.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include <linux/types.h> | 3 | #include <linux/types.h> |
3 | 4 | ||
diff --git a/tools/perf/util/tsc.h b/tools/perf/util/tsc.h index d5b11e2b85e0..e0c3af34ac8d 100644 --- a/tools/perf/util/tsc.h +++ b/tools/perf/util/tsc.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_TSC_H | 2 | #ifndef __PERF_TSC_H |
2 | #define __PERF_TSC_H | 3 | #define __PERF_TSC_H |
3 | 4 | ||
diff --git a/tools/perf/util/units.c b/tools/perf/util/units.c index 4767ec2c5ef6..a46762aec4c9 100644 --- a/tools/perf/util/units.c +++ b/tools/perf/util/units.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "units.h" | 2 | #include "units.h" |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <limits.h> | 4 | #include <limits.h> |
diff --git a/tools/perf/util/units.h b/tools/perf/util/units.h index f02c87317150..99263b6a23f7 100644 --- a/tools/perf/util/units.h +++ b/tools/perf/util/units.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef PERF_UNIT_H | 2 | #ifndef PERF_UNIT_H |
2 | #define PERF_UNIT_H | 3 | #define PERF_UNIT_H |
3 | 4 | ||
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index 7755a5e0fe5e..1e9c974faf67 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
2 | #include <elfutils/libdw.h> | 3 | #include <elfutils/libdw.h> |
3 | #include <elfutils/libdwfl.h> | 4 | #include <elfutils/libdwfl.h> |
diff --git a/tools/perf/util/unwind-libdw.h b/tools/perf/util/unwind-libdw.h index 4a2b269a7b3b..0cbd2650e280 100644 --- a/tools/perf/util/unwind-libdw.h +++ b/tools/perf/util/unwind-libdw.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_UNWIND_LIBDW_H | 2 | #ifndef __PERF_UNWIND_LIBDW_H |
2 | #define __PERF_UNWIND_LIBDW_H | 3 | #define __PERF_UNWIND_LIBDW_H |
3 | 4 | ||
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c index 672c2ada9357..7a42f703e858 100644 --- a/tools/perf/util/unwind-libunwind-local.c +++ b/tools/perf/util/unwind-libunwind-local.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Post mortem Dwarf CFI based unwinding on top of regs and stack dumps. | 3 | * Post mortem Dwarf CFI based unwinding on top of regs and stack dumps. |
3 | * | 4 | * |
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c index 8aef572d0889..647a1e6b4c7b 100644 --- a/tools/perf/util/unwind-libunwind.c +++ b/tools/perf/util/unwind-libunwind.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "unwind.h" | 2 | #include "unwind.h" |
2 | #include "thread.h" | 3 | #include "thread.h" |
3 | #include "session.h" | 4 | #include "session.h" |
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h index bfbdcc6198c9..8a44a1569a21 100644 --- a/tools/perf/util/unwind.h +++ b/tools/perf/util/unwind.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __UNWIND_H | 2 | #ifndef __UNWIND_H |
2 | #define __UNWIND_H | 3 | #define __UNWIND_H |
3 | 4 | ||
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c index 6cc9d9888ce0..070d25ceea6a 100644 --- a/tools/perf/util/usage.c +++ b/tools/perf/util/usage.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * usage.c | 3 | * usage.c |
3 | * | 4 | * |
diff --git a/tools/perf/util/util-cxx.h b/tools/perf/util/util-cxx.h index 0e0e019c9f34..80a99e458d4e 100644 --- a/tools/perf/util/util-cxx.h +++ b/tools/perf/util/util-cxx.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Support C++ source use utilities defined in util.h | 3 | * Support C++ source use utilities defined in util.h |
3 | */ | 4 | */ |
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 4c360daa4e24..3687b720327a 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "../perf.h" | 2 | #include "../perf.h" |
2 | #include "util.h" | 3 | #include "util.h" |
3 | #include "debug.h" | 4 | #include "debug.h" |
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index b136c271125f..b52765e6d7b4 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef GIT_COMPAT_UTIL_H | 2 | #ifndef GIT_COMPAT_UTIL_H |
2 | #define GIT_COMPAT_UTIL_H | 3 | #define GIT_COMPAT_UTIL_H |
3 | 4 | ||
diff --git a/tools/perf/util/values.c b/tools/perf/util/values.c index 8a32bb0095e5..4b7a303e4ba8 100644 --- a/tools/perf/util/values.c +++ b/tools/perf/util/values.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <inttypes.h> | 2 | #include <inttypes.h> |
2 | #include <stdio.h> | 3 | #include <stdio.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
diff --git a/tools/perf/util/values.h b/tools/perf/util/values.h index 808ff9c73bf5..8c41f22f42cf 100644 --- a/tools/perf/util/values.h +++ b/tools/perf/util/values.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_VALUES_H | 2 | #ifndef __PERF_VALUES_H |
2 | #define __PERF_VALUES_H | 3 | #define __PERF_VALUES_H |
3 | 4 | ||
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c index d3c39eec89a8..cffcda448c28 100644 --- a/tools/perf/util/vdso.c +++ b/tools/perf/util/vdso.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <errno.h> | 2 | #include <errno.h> |
2 | #include <unistd.h> | 3 | #include <unistd.h> |
3 | #include <stdio.h> | 4 | #include <stdio.h> |
diff --git a/tools/perf/util/vdso.h b/tools/perf/util/vdso.h index cdc4fabfc212..bc74ace603ae 100644 --- a/tools/perf/util/vdso.h +++ b/tools/perf/util/vdso.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef __PERF_VDSO__ | 2 | #ifndef __PERF_VDSO__ |
2 | #define __PERF_VDSO__ | 3 | #define __PERF_VDSO__ |
3 | 4 | ||
diff --git a/tools/perf/util/xyarray.c b/tools/perf/util/xyarray.c index c8f415d9877b..dc95154f5646 100644 --- a/tools/perf/util/xyarray.c +++ b/tools/perf/util/xyarray.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include "xyarray.h" | 2 | #include "xyarray.h" |
2 | #include "util.h" | 3 | #include "util.h" |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
diff --git a/tools/perf/util/xyarray.h b/tools/perf/util/xyarray.h index 4ba726c90870..7ffe562e7ae7 100644 --- a/tools/perf/util/xyarray.h +++ b/tools/perf/util/xyarray.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | #ifndef _PERF_XYARRAY_H_ | 2 | #ifndef _PERF_XYARRAY_H_ |
2 | #define _PERF_XYARRAY_H_ 1 | 3 | #define _PERF_XYARRAY_H_ 1 |
3 | 4 | ||
@@ -23,12 +24,12 @@ static inline void *xyarray__entry(struct xyarray *xy, int x, int y) | |||
23 | 24 | ||
24 | static inline int xyarray__max_y(struct xyarray *xy) | 25 | static inline int xyarray__max_y(struct xyarray *xy) |
25 | { | 26 | { |
26 | return xy->max_x; | 27 | return xy->max_y; |
27 | } | 28 | } |
28 | 29 | ||
29 | static inline int xyarray__max_x(struct xyarray *xy) | 30 | static inline int xyarray__max_x(struct xyarray *xy) |
30 | { | 31 | { |
31 | return xy->max_y; | 32 | return xy->max_x; |
32 | } | 33 | } |
33 | 34 | ||
34 | #endif /* _PERF_XYARRAY_H_ */ | 35 | #endif /* _PERF_XYARRAY_H_ */ |
diff --git a/tools/perf/util/zlib.c b/tools/perf/util/zlib.c index 1329d843eb7b..008fe68d7b76 100644 --- a/tools/perf/util/zlib.c +++ b/tools/perf/util/zlib.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <unistd.h> | 3 | #include <unistd.h> |
3 | #include <sys/stat.h> | 4 | #include <sys/stat.h> |