aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/include/linux/compiler.h20
-rw-r--r--tools/perf/Documentation/perf-config.txt5
-rw-r--r--tools/perf/Documentation/perf-sched.txt4
-rw-r--r--tools/perf/Documentation/perf-stat.txt2
-rw-r--r--tools/perf/Makefile.config4
-rw-r--r--tools/perf/arch/arm/include/arch-tests.h12
-rw-r--r--tools/perf/arch/arm/tests/Build2
-rw-r--r--tools/perf/arch/arm/tests/arch-tests.c16
-rw-r--r--tools/perf/arch/x86/annotate/instructions.c67
-rw-r--r--tools/perf/builtin-help.c2
-rw-r--r--tools/perf/builtin-script.c4
-rw-r--r--tools/perf/builtin-stat.c14
-rw-r--r--tools/perf/builtin-version.c3
-rw-r--r--tools/perf/perf.c4
-rw-r--r--tools/perf/tests/bpf-script-test-kbuild.c1
-rw-r--r--tools/perf/tests/builtin-test.c1
-rw-r--r--tools/perf/ui/browsers/annotate.c5
-rw-r--r--tools/perf/util/annotate.c26
-rw-r--r--tools/perf/util/annotate.h9
-rwxr-xr-xtools/perf/util/generate-cmdlist.sh2
-rw-r--r--tools/perf/util/header.c3
-rw-r--r--tools/perf/util/symbol.c8
-rw-r--r--tools/perf/util/syscalltbl.c6
-rw-r--r--tools/perf/util/trace-event-scripting.c4
24 files changed, 178 insertions, 46 deletions
diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 04e32f965ad7..1827c2f973f9 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -151,11 +151,21 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
151 * required ordering. 151 * required ordering.
152 */ 152 */
153 153
154#define READ_ONCE(x) \ 154#define READ_ONCE(x) \
155 ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; }) 155({ \
156 156 union { typeof(x) __val; char __c[1]; } __u = \
157#define WRITE_ONCE(x, val) \ 157 { .__c = { 0 } }; \
158 ({ union { typeof(x) __val; char __c[1]; } __u = { .__val = (val) }; __write_once_size(&(x), __u.__c, sizeof(x)); __u.__val; }) 158 __read_once_size(&(x), __u.__c, sizeof(x)); \
159 __u.__val; \
160})
161
162#define WRITE_ONCE(x, val) \
163({ \
164 union { typeof(x) __val; char __c[1]; } __u = \
165 { .__val = (val) }; \
166 __write_once_size(&(x), __u.__c, sizeof(x)); \
167 __u.__val; \
168})
159 169
160 170
161#ifndef __fallthrough 171#ifndef __fallthrough
diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index 5b4fff3adc4b..32f4a898e3f2 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -334,6 +334,11 @@ annotate.*::
334 334
335 99.93 │ mov %eax,%eax 335 99.93 │ mov %eax,%eax
336 336
337 annotate.offset_level::
338 Default is '1', meaning just jump targets will have offsets show right beside
339 the instruction. When set to '2' 'call' instructions will also have its offsets
340 shown, 3 or higher will show offsets for all instructions.
341
337hist.*:: 342hist.*::
338 hist.percentage:: 343 hist.percentage::
339 This option control the way to calculate overhead of filtered entries - 344 This option control the way to calculate overhead of filtered entries -
diff --git a/tools/perf/Documentation/perf-sched.txt b/tools/perf/Documentation/perf-sched.txt
index bb33601a823b..63f938b887dd 100644
--- a/tools/perf/Documentation/perf-sched.txt
+++ b/tools/perf/Documentation/perf-sched.txt
@@ -104,8 +104,8 @@ OPTIONS for 'perf sched timehist'
104 kallsyms pathname 104 kallsyms pathname
105 105
106-g:: 106-g::
107--no-call-graph:: 107--call-graph::
108 Do not display call chains if present. 108 Display call chains if present (default on).
109 109
110--max-stack:: 110--max-stack::
111 Maximum number of functions to display in backtrace, default 5. 111 Maximum number of functions to display in backtrace, default 5.
diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
index f15b306be183..e6c3b4e555c2 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -153,7 +153,7 @@ perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' -- m
153 153
154-I msecs:: 154-I msecs::
155--interval-print msecs:: 155--interval-print msecs::
156Print count deltas every N milliseconds (minimum: 10ms) 156Print count deltas every N milliseconds (minimum: 1ms)
157The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals. Use with caution. 157The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals. Use with caution.
158 example: 'perf stat -I 1000 -e cycles -a sleep 5' 158 example: 'perf stat -I 1000 -e cycles -a sleep 5'
159 159
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index c7abd83a8e19..ae7dc46e8f8a 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -68,7 +68,7 @@ ifeq ($(NO_PERF_REGS),0)
68endif 68endif
69 69
70ifneq ($(NO_SYSCALL_TABLE),1) 70ifneq ($(NO_SYSCALL_TABLE),1)
71 CFLAGS += -DHAVE_SYSCALL_TABLE 71 CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
72endif 72endif
73 73
74# So far there's only x86 and arm libdw unwind support merged in perf. 74# So far there's only x86 and arm libdw unwind support merged in perf.
@@ -847,7 +847,7 @@ ifndef NO_JVMTI
847 ifeq ($(feature-jvmti), 1) 847 ifeq ($(feature-jvmti), 1)
848 $(call detected_var,JDIR) 848 $(call detected_var,JDIR)
849 else 849 else
850 $(warning No openjdk development package found, please install JDK package) 850 $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel)
851 NO_JVMTI := 1 851 NO_JVMTI := 1
852 endif 852 endif
853endif 853endif
diff --git a/tools/perf/arch/arm/include/arch-tests.h b/tools/perf/arch/arm/include/arch-tests.h
new file mode 100644
index 000000000000..90ec4c8cb880
--- /dev/null
+++ b/tools/perf/arch/arm/include/arch-tests.h
@@ -0,0 +1,12 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef ARCH_TESTS_H
3#define ARCH_TESTS_H
4
5#ifdef HAVE_DWARF_UNWIND_SUPPORT
6struct thread;
7struct perf_sample;
8#endif
9
10extern struct test arch_tests[];
11
12#endif
diff --git a/tools/perf/arch/arm/tests/Build b/tools/perf/arch/arm/tests/Build
index b30eff9bcc83..883c57ff0c08 100644
--- a/tools/perf/arch/arm/tests/Build
+++ b/tools/perf/arch/arm/tests/Build
@@ -1,2 +1,4 @@
1libperf-y += regs_load.o 1libperf-y += regs_load.o
2libperf-y += dwarf-unwind.o 2libperf-y += dwarf-unwind.o
3
4libperf-y += arch-tests.o
diff --git a/tools/perf/arch/arm/tests/arch-tests.c b/tools/perf/arch/arm/tests/arch-tests.c
new file mode 100644
index 000000000000..5b1543c98022
--- /dev/null
+++ b/tools/perf/arch/arm/tests/arch-tests.c
@@ -0,0 +1,16 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <string.h>
3#include "tests/tests.h"
4#include "arch-tests.h"
5
6struct test arch_tests[] = {
7#ifdef HAVE_DWARF_UNWIND_SUPPORT
8 {
9 .desc = "DWARF unwind",
10 .func = test__dwarf_unwind,
11 },
12#endif
13 {
14 .func = NULL,
15 },
16};
diff --git a/tools/perf/arch/x86/annotate/instructions.c b/tools/perf/arch/x86/annotate/instructions.c
index 5bd1ba8c0282..44f5aba78210 100644
--- a/tools/perf/arch/x86/annotate/instructions.c
+++ b/tools/perf/arch/x86/annotate/instructions.c
@@ -1,21 +1,43 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2static struct ins x86__instructions[] = { 2static struct ins x86__instructions[] = {
3 { .name = "adc", .ops = &mov_ops, },
4 { .name = "adcb", .ops = &mov_ops, },
5 { .name = "adcl", .ops = &mov_ops, },
3 { .name = "add", .ops = &mov_ops, }, 6 { .name = "add", .ops = &mov_ops, },
4 { .name = "addl", .ops = &mov_ops, }, 7 { .name = "addl", .ops = &mov_ops, },
5 { .name = "addq", .ops = &mov_ops, }, 8 { .name = "addq", .ops = &mov_ops, },
9 { .name = "addsd", .ops = &mov_ops, },
6 { .name = "addw", .ops = &mov_ops, }, 10 { .name = "addw", .ops = &mov_ops, },
7 { .name = "and", .ops = &mov_ops, }, 11 { .name = "and", .ops = &mov_ops, },
12 { .name = "andb", .ops = &mov_ops, },
13 { .name = "andl", .ops = &mov_ops, },
14 { .name = "andpd", .ops = &mov_ops, },
15 { .name = "andps", .ops = &mov_ops, },
16 { .name = "andq", .ops = &mov_ops, },
17 { .name = "andw", .ops = &mov_ops, },
18 { .name = "bsr", .ops = &mov_ops, },
19 { .name = "bt", .ops = &mov_ops, },
20 { .name = "btr", .ops = &mov_ops, },
8 { .name = "bts", .ops = &mov_ops, }, 21 { .name = "bts", .ops = &mov_ops, },
22 { .name = "btsq", .ops = &mov_ops, },
9 { .name = "call", .ops = &call_ops, }, 23 { .name = "call", .ops = &call_ops, },
10 { .name = "callq", .ops = &call_ops, }, 24 { .name = "callq", .ops = &call_ops, },
25 { .name = "cmovbe", .ops = &mov_ops, },
26 { .name = "cmove", .ops = &mov_ops, },
27 { .name = "cmovae", .ops = &mov_ops, },
11 { .name = "cmp", .ops = &mov_ops, }, 28 { .name = "cmp", .ops = &mov_ops, },
12 { .name = "cmpb", .ops = &mov_ops, }, 29 { .name = "cmpb", .ops = &mov_ops, },
13 { .name = "cmpl", .ops = &mov_ops, }, 30 { .name = "cmpl", .ops = &mov_ops, },
14 { .name = "cmpq", .ops = &mov_ops, }, 31 { .name = "cmpq", .ops = &mov_ops, },
15 { .name = "cmpw", .ops = &mov_ops, }, 32 { .name = "cmpw", .ops = &mov_ops, },
16 { .name = "cmpxch", .ops = &mov_ops, }, 33 { .name = "cmpxch", .ops = &mov_ops, },
34 { .name = "cmpxchg", .ops = &mov_ops, },
35 { .name = "cs", .ops = &mov_ops, },
17 { .name = "dec", .ops = &dec_ops, }, 36 { .name = "dec", .ops = &dec_ops, },
18 { .name = "decl", .ops = &dec_ops, }, 37 { .name = "decl", .ops = &dec_ops, },
38 { .name = "divsd", .ops = &mov_ops, },
39 { .name = "divss", .ops = &mov_ops, },
40 { .name = "gs", .ops = &mov_ops, },
19 { .name = "imul", .ops = &mov_ops, }, 41 { .name = "imul", .ops = &mov_ops, },
20 { .name = "inc", .ops = &dec_ops, }, 42 { .name = "inc", .ops = &dec_ops, },
21 { .name = "incl", .ops = &dec_ops, }, 43 { .name = "incl", .ops = &dec_ops, },
@@ -57,25 +79,68 @@ static struct ins x86__instructions[] = {
57 { .name = "lea", .ops = &mov_ops, }, 79 { .name = "lea", .ops = &mov_ops, },
58 { .name = "lock", .ops = &lock_ops, }, 80 { .name = "lock", .ops = &lock_ops, },
59 { .name = "mov", .ops = &mov_ops, }, 81 { .name = "mov", .ops = &mov_ops, },
82 { .name = "movapd", .ops = &mov_ops, },
83 { .name = "movaps", .ops = &mov_ops, },
60 { .name = "movb", .ops = &mov_ops, }, 84 { .name = "movb", .ops = &mov_ops, },
61 { .name = "movdqa", .ops = &mov_ops, }, 85 { .name = "movdqa", .ops = &mov_ops, },
86 { .name = "movdqu", .ops = &mov_ops, },
62 { .name = "movl", .ops = &mov_ops, }, 87 { .name = "movl", .ops = &mov_ops, },
63 { .name = "movq", .ops = &mov_ops, }, 88 { .name = "movq", .ops = &mov_ops, },
89 { .name = "movsd", .ops = &mov_ops, },
64 { .name = "movslq", .ops = &mov_ops, }, 90 { .name = "movslq", .ops = &mov_ops, },
91 { .name = "movss", .ops = &mov_ops, },
92 { .name = "movupd", .ops = &mov_ops, },
93 { .name = "movups", .ops = &mov_ops, },
94 { .name = "movw", .ops = &mov_ops, },
65 { .name = "movzbl", .ops = &mov_ops, }, 95 { .name = "movzbl", .ops = &mov_ops, },
66 { .name = "movzwl", .ops = &mov_ops, }, 96 { .name = "movzwl", .ops = &mov_ops, },
97 { .name = "mulsd", .ops = &mov_ops, },
98 { .name = "mulss", .ops = &mov_ops, },
67 { .name = "nop", .ops = &nop_ops, }, 99 { .name = "nop", .ops = &nop_ops, },
68 { .name = "nopl", .ops = &nop_ops, }, 100 { .name = "nopl", .ops = &nop_ops, },
69 { .name = "nopw", .ops = &nop_ops, }, 101 { .name = "nopw", .ops = &nop_ops, },
70 { .name = "or", .ops = &mov_ops, }, 102 { .name = "or", .ops = &mov_ops, },
103 { .name = "orb", .ops = &mov_ops, },
71 { .name = "orl", .ops = &mov_ops, }, 104 { .name = "orl", .ops = &mov_ops, },
105 { .name = "orps", .ops = &mov_ops, },
106 { .name = "orq", .ops = &mov_ops, },
107 { .name = "pand", .ops = &mov_ops, },
108 { .name = "paddq", .ops = &mov_ops, },
109 { .name = "pcmpeqb", .ops = &mov_ops, },
110 { .name = "por", .ops = &mov_ops, },
111 { .name = "rclb", .ops = &mov_ops, },
112 { .name = "rcll", .ops = &mov_ops, },
113 { .name = "retq", .ops = &ret_ops, },
114 { .name = "sbb", .ops = &mov_ops, },
115 { .name = "sbbl", .ops = &mov_ops, },
116 { .name = "sete", .ops = &mov_ops, },
117 { .name = "sub", .ops = &mov_ops, },
118 { .name = "subl", .ops = &mov_ops, },
119 { .name = "subq", .ops = &mov_ops, },
120 { .name = "subsd", .ops = &mov_ops, },
121 { .name = "subw", .ops = &mov_ops, },
72 { .name = "test", .ops = &mov_ops, }, 122 { .name = "test", .ops = &mov_ops, },
73 { .name = "testb", .ops = &mov_ops, }, 123 { .name = "testb", .ops = &mov_ops, },
74 { .name = "testl", .ops = &mov_ops, }, 124 { .name = "testl", .ops = &mov_ops, },
125 { .name = "ucomisd", .ops = &mov_ops, },
126 { .name = "ucomiss", .ops = &mov_ops, },
127 { .name = "vaddsd", .ops = &mov_ops, },
128 { .name = "vandpd", .ops = &mov_ops, },
129 { .name = "vmovdqa", .ops = &mov_ops, },
130 { .name = "vmovq", .ops = &mov_ops, },
131 { .name = "vmovsd", .ops = &mov_ops, },
132 { .name = "vmulsd", .ops = &mov_ops, },
133 { .name = "vorpd", .ops = &mov_ops, },
134 { .name = "vsubsd", .ops = &mov_ops, },
135 { .name = "vucomisd", .ops = &mov_ops, },
75 { .name = "xadd", .ops = &mov_ops, }, 136 { .name = "xadd", .ops = &mov_ops, },
76 { .name = "xbeginl", .ops = &jump_ops, }, 137 { .name = "xbeginl", .ops = &jump_ops, },
77 { .name = "xbeginq", .ops = &jump_ops, }, 138 { .name = "xbeginq", .ops = &jump_ops, },
78 { .name = "retq", .ops = &ret_ops, }, 139 { .name = "xchg", .ops = &mov_ops, },
140 { .name = "xor", .ops = &mov_ops, },
141 { .name = "xorb", .ops = &mov_ops, },
142 { .name = "xorpd", .ops = &mov_ops, },
143 { .name = "xorps", .ops = &mov_ops, },
79}; 144};
80 145
81static bool x86__ins_is_fused(struct arch *arch, const char *ins1, 146static bool x86__ins_is_fused(struct arch *arch, const char *ins1,
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 4aca13f23b9d..1c41b4eaf73c 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -439,7 +439,7 @@ int cmd_help(int argc, const char **argv)
439#ifdef HAVE_LIBELF_SUPPORT 439#ifdef HAVE_LIBELF_SUPPORT
440 "probe", 440 "probe",
441#endif 441#endif
442#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE) 442#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)
443 "trace", 443 "trace",
444#endif 444#endif
445 NULL }; 445 NULL };
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 313c42423393..b17edbcd98cc 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -2801,11 +2801,11 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
2801 for_each_lang(scripts_path, scripts_dir, lang_dirent) { 2801 for_each_lang(scripts_path, scripts_dir, lang_dirent) {
2802 scnprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path, 2802 scnprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path,
2803 lang_dirent->d_name); 2803 lang_dirent->d_name);
2804#ifdef NO_LIBPERL 2804#ifndef HAVE_LIBPERL_SUPPORT
2805 if (strstr(lang_path, "perl")) 2805 if (strstr(lang_path, "perl"))
2806 continue; 2806 continue;
2807#endif 2807#endif
2808#ifdef NO_LIBPYTHON 2808#ifndef HAVE_LIBPYTHON_SUPPORT
2809 if (strstr(lang_path, "python")) 2809 if (strstr(lang_path, "python"))
2810 continue; 2810 continue;
2811#endif 2811#endif
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index f5c454855908..147a27e8c937 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1943,7 +1943,8 @@ static const struct option stat_options[] = {
1943 OPT_STRING(0, "post", &post_cmd, "command", 1943 OPT_STRING(0, "post", &post_cmd, "command",
1944 "command to run after to the measured command"), 1944 "command to run after to the measured command"),
1945 OPT_UINTEGER('I', "interval-print", &stat_config.interval, 1945 OPT_UINTEGER('I', "interval-print", &stat_config.interval,
1946 "print counts at regular interval in ms (>= 10)"), 1946 "print counts at regular interval in ms "
1947 "(overhead is possible for values <= 100ms)"),
1947 OPT_INTEGER(0, "interval-count", &stat_config.times, 1948 OPT_INTEGER(0, "interval-count", &stat_config.times,
1948 "print counts for fixed number of times"), 1949 "print counts for fixed number of times"),
1949 OPT_UINTEGER(0, "timeout", &stat_config.timeout, 1950 OPT_UINTEGER(0, "timeout", &stat_config.timeout,
@@ -2923,17 +2924,6 @@ int cmd_stat(int argc, const char **argv)
2923 } 2924 }
2924 } 2925 }
2925 2926
2926 if (interval && interval < 100) {
2927 if (interval < 10) {
2928 pr_err("print interval must be >= 10ms\n");
2929 parse_options_usage(stat_usage, stat_options, "I", 1);
2930 goto out;
2931 } else
2932 pr_warning("print interval < 100ms. "
2933 "The overhead percentage could be high in some cases. "
2934 "Please proceed with caution.\n");
2935 }
2936
2937 if (stat_config.times && interval) 2927 if (stat_config.times && interval)
2938 interval_count = true; 2928 interval_count = true;
2939 else if (stat_config.times && !interval) { 2929 else if (stat_config.times && !interval) {
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c
index 2abe3910d6b6..50df168be326 100644
--- a/tools/perf/builtin-version.c
+++ b/tools/perf/builtin-version.c
@@ -60,7 +60,10 @@ static void library_status(void)
60 STATUS(HAVE_DWARF_GETLOCATIONS_SUPPORT, dwarf_getlocations); 60 STATUS(HAVE_DWARF_GETLOCATIONS_SUPPORT, dwarf_getlocations);
61 STATUS(HAVE_GLIBC_SUPPORT, glibc); 61 STATUS(HAVE_GLIBC_SUPPORT, glibc);
62 STATUS(HAVE_GTK2_SUPPORT, gtk2); 62 STATUS(HAVE_GTK2_SUPPORT, gtk2);
63#ifndef HAVE_SYSCALL_TABLE_SUPPORT
63 STATUS(HAVE_LIBAUDIT_SUPPORT, libaudit); 64 STATUS(HAVE_LIBAUDIT_SUPPORT, libaudit);
65#endif
66 STATUS(HAVE_SYSCALL_TABLE_SUPPORT, syscall_table);
64 STATUS(HAVE_LIBBFD_SUPPORT, libbfd); 67 STATUS(HAVE_LIBBFD_SUPPORT, libbfd);
65 STATUS(HAVE_LIBELF_SUPPORT, libelf); 68 STATUS(HAVE_LIBELF_SUPPORT, libelf);
66 STATUS(HAVE_LIBNUMA_SUPPORT, libnuma); 69 STATUS(HAVE_LIBNUMA_SUPPORT, libnuma);
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 1659029d03fc..20a08cb32332 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -73,7 +73,7 @@ static struct cmd_struct commands[] = {
73 { "lock", cmd_lock, 0 }, 73 { "lock", cmd_lock, 0 },
74 { "kvm", cmd_kvm, 0 }, 74 { "kvm", cmd_kvm, 0 },
75 { "test", cmd_test, 0 }, 75 { "test", cmd_test, 0 },
76#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE) 76#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)
77 { "trace", cmd_trace, 0 }, 77 { "trace", cmd_trace, 0 },
78#endif 78#endif
79 { "inject", cmd_inject, 0 }, 79 { "inject", cmd_inject, 0 },
@@ -491,7 +491,7 @@ int main(int argc, const char **argv)
491 argv[0] = cmd; 491 argv[0] = cmd;
492 } 492 }
493 if (strstarts(cmd, "trace")) { 493 if (strstarts(cmd, "trace")) {
494#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE) 494#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)
495 setup_path(); 495 setup_path();
496 argv[0] = "trace"; 496 argv[0] = "trace";
497 return cmd_trace(argc, argv); 497 return cmd_trace(argc, argv);
diff --git a/tools/perf/tests/bpf-script-test-kbuild.c b/tools/perf/tests/bpf-script-test-kbuild.c
index 3626924740d8..ff3ec8337f0a 100644
--- a/tools/perf/tests/bpf-script-test-kbuild.c
+++ b/tools/perf/tests/bpf-script-test-kbuild.c
@@ -9,7 +9,6 @@
9#define SEC(NAME) __attribute__((section(NAME), used)) 9#define SEC(NAME) __attribute__((section(NAME), used))
10 10
11#include <uapi/linux/fs.h> 11#include <uapi/linux/fs.h>
12#include <uapi/asm/ptrace.h>
13 12
14SEC("func=vfs_llseek") 13SEC("func=vfs_llseek")
15int bpf_func__vfs_llseek(void *ctx) 14int bpf_func__vfs_llseek(void *ctx)
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 625f5a6772af..cac8f8889bc3 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -118,6 +118,7 @@ static struct test generic_tests[] = {
118 { 118 {
119 .desc = "Breakpoint accounting", 119 .desc = "Breakpoint accounting",
120 .func = test__bp_accounting, 120 .func = test__bp_accounting,
121 .is_supported = test__bp_signal_is_supported,
121 }, 122 },
122 { 123 {
123 .desc = "Number of exit events of a simple workload", 124 .desc = "Number of exit events of a simple workload",
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 12c099a87f8b..3781d74088a7 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -692,6 +692,7 @@ static int annotate_browser__run(struct annotate_browser *browser,
692 "J Toggle showing number of jump sources on targets\n" 692 "J Toggle showing number of jump sources on targets\n"
693 "n Search next string\n" 693 "n Search next string\n"
694 "o Toggle disassembler output/simplified view\n" 694 "o Toggle disassembler output/simplified view\n"
695 "O Bump offset level (jump targets -> +call -> all -> cycle thru)\n"
695 "s Toggle source code view\n" 696 "s Toggle source code view\n"
696 "t Circulate percent, total period, samples view\n" 697 "t Circulate percent, total period, samples view\n"
697 "/ Search string\n" 698 "/ Search string\n"
@@ -719,6 +720,10 @@ static int annotate_browser__run(struct annotate_browser *browser,
719 notes->options->use_offset = !notes->options->use_offset; 720 notes->options->use_offset = !notes->options->use_offset;
720 annotation__update_column_widths(notes); 721 annotation__update_column_widths(notes);
721 continue; 722 continue;
723 case 'O':
724 if (++notes->options->offset_level > ANNOTATION__MAX_OFFSET_LEVEL)
725 notes->options->offset_level = ANNOTATION__MIN_OFFSET_LEVEL;
726 continue;
722 case 'j': 727 case 'j':
723 notes->options->jump_arrows = !notes->options->jump_arrows; 728 notes->options->jump_arrows = !notes->options->jump_arrows;
724 continue; 729 continue;
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index fbad8dfbb186..536ee148bff8 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -46,6 +46,7 @@
46struct annotation_options annotation__default_options = { 46struct annotation_options annotation__default_options = {
47 .use_offset = true, 47 .use_offset = true,
48 .jump_arrows = true, 48 .jump_arrows = true,
49 .offset_level = ANNOTATION__OFFSET_JUMP_TARGETS,
49}; 50};
50 51
51const char *disassembler_style; 52const char *disassembler_style;
@@ -2512,7 +2513,8 @@ static void __annotation_line__write(struct annotation_line *al, struct annotati
2512 if (!notes->options->use_offset) { 2513 if (!notes->options->use_offset) {
2513 printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr); 2514 printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr);
2514 } else { 2515 } else {
2515 if (al->jump_sources) { 2516 if (al->jump_sources &&
2517 notes->options->offset_level >= ANNOTATION__OFFSET_JUMP_TARGETS) {
2516 if (notes->options->show_nr_jumps) { 2518 if (notes->options->show_nr_jumps) {
2517 int prev; 2519 int prev;
2518 printed = scnprintf(bf, sizeof(bf), "%*d ", 2520 printed = scnprintf(bf, sizeof(bf), "%*d ",
@@ -2523,9 +2525,14 @@ static void __annotation_line__write(struct annotation_line *al, struct annotati
2523 obj__printf(obj, bf); 2525 obj__printf(obj, bf);
2524 obj__set_color(obj, prev); 2526 obj__set_color(obj, prev);
2525 } 2527 }
2526 2528print_addr:
2527 printed = scnprintf(bf, sizeof(bf), "%*" PRIx64 ": ", 2529 printed = scnprintf(bf, sizeof(bf), "%*" PRIx64 ": ",
2528 notes->widths.target, addr); 2530 notes->widths.target, addr);
2531 } else if (ins__is_call(&disasm_line(al)->ins) &&
2532 notes->options->offset_level >= ANNOTATION__OFFSET_CALL) {
2533 goto print_addr;
2534 } else if (notes->options->offset_level == ANNOTATION__MAX_OFFSET_LEVEL) {
2535 goto print_addr;
2529 } else { 2536 } else {
2530 printed = scnprintf(bf, sizeof(bf), "%-*s ", 2537 printed = scnprintf(bf, sizeof(bf), "%-*s ",
2531 notes->widths.addr, " "); 2538 notes->widths.addr, " ");
@@ -2642,10 +2649,11 @@ int __annotation__scnprintf_samples_period(struct annotation *notes,
2642 */ 2649 */
2643static struct annotation_config { 2650static struct annotation_config {
2644 const char *name; 2651 const char *name;
2645 bool *value; 2652 void *value;
2646} annotation__configs[] = { 2653} annotation__configs[] = {
2647 ANNOTATION__CFG(hide_src_code), 2654 ANNOTATION__CFG(hide_src_code),
2648 ANNOTATION__CFG(jump_arrows), 2655 ANNOTATION__CFG(jump_arrows),
2656 ANNOTATION__CFG(offset_level),
2649 ANNOTATION__CFG(show_linenr), 2657 ANNOTATION__CFG(show_linenr),
2650 ANNOTATION__CFG(show_nr_jumps), 2658 ANNOTATION__CFG(show_nr_jumps),
2651 ANNOTATION__CFG(show_nr_samples), 2659 ANNOTATION__CFG(show_nr_samples),
@@ -2677,8 +2685,16 @@ static int annotation__config(const char *var, const char *value,
2677 2685
2678 if (cfg == NULL) 2686 if (cfg == NULL)
2679 pr_debug("%s variable unknown, ignoring...", var); 2687 pr_debug("%s variable unknown, ignoring...", var);
2680 else 2688 else if (strcmp(var, "annotate.offset_level") == 0) {
2681 *cfg->value = perf_config_bool(name, value); 2689 perf_config_int(cfg->value, name, value);
2690
2691 if (*(int *)cfg->value > ANNOTATION__MAX_OFFSET_LEVEL)
2692 *(int *)cfg->value = ANNOTATION__MAX_OFFSET_LEVEL;
2693 else if (*(int *)cfg->value < ANNOTATION__MIN_OFFSET_LEVEL)
2694 *(int *)cfg->value = ANNOTATION__MIN_OFFSET_LEVEL;
2695 } else {
2696 *(bool *)cfg->value = perf_config_bool(name, value);
2697 }
2682 return 0; 2698 return 0;
2683} 2699}
2684 2700
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index db8d09bea07e..f28a9e43421d 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -70,8 +70,17 @@ struct annotation_options {
70 show_nr_jumps, 70 show_nr_jumps,
71 show_nr_samples, 71 show_nr_samples,
72 show_total_period; 72 show_total_period;
73 u8 offset_level;
73}; 74};
74 75
76enum {
77 ANNOTATION__OFFSET_JUMP_TARGETS = 1,
78 ANNOTATION__OFFSET_CALL,
79 ANNOTATION__MAX_OFFSET_LEVEL,
80};
81
82#define ANNOTATION__MIN_OFFSET_LEVEL ANNOTATION__OFFSET_JUMP_TARGETS
83
75extern struct annotation_options annotation__default_options; 84extern struct annotation_options annotation__default_options;
76 85
77struct annotation; 86struct annotation;
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index ff17920a5ebc..c3cef36d4176 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -38,7 +38,7 @@ do
38done 38done
39echo "#endif /* HAVE_LIBELF_SUPPORT */" 39echo "#endif /* HAVE_LIBELF_SUPPORT */"
40 40
41echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)" 41echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)"
42sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt | 42sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
43sort | 43sort |
44while read cmd 44while read cmd
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 121df1683c36..a8bff2178fbc 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1320,7 +1320,8 @@ static int build_mem_topology(struct memory_node *nodes, u64 size, u64 *cntp)
1320 1320
1321 dir = opendir(path); 1321 dir = opendir(path);
1322 if (!dir) { 1322 if (!dir) {
1323 pr_warning("failed: can't open node sysfs data\n"); 1323 pr_debug2("%s: could't read %s, does this arch have topology information?\n",
1324 __func__, path);
1324 return -1; 1325 return -1;
1325 } 1326 }
1326 1327
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 62b2dd2253eb..1466814ebada 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -2091,16 +2091,14 @@ static bool symbol__read_kptr_restrict(void)
2091 2091
2092int symbol__annotation_init(void) 2092int symbol__annotation_init(void)
2093{ 2093{
2094 if (symbol_conf.init_annotation)
2095 return 0;
2096
2094 if (symbol_conf.initialized) { 2097 if (symbol_conf.initialized) {
2095 pr_err("Annotation needs to be init before symbol__init()\n"); 2098 pr_err("Annotation needs to be init before symbol__init()\n");
2096 return -1; 2099 return -1;
2097 } 2100 }
2098 2101
2099 if (symbol_conf.init_annotation) {
2100 pr_warning("Annotation being initialized multiple times\n");
2101 return 0;
2102 }
2103
2104 symbol_conf.priv_size += sizeof(struct annotation); 2102 symbol_conf.priv_size += sizeof(struct annotation);
2105 symbol_conf.init_annotation = true; 2103 symbol_conf.init_annotation = true;
2106 return 0; 2104 return 0;
diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c
index 895122d638dd..0ee7f568d60c 100644
--- a/tools/perf/util/syscalltbl.c
+++ b/tools/perf/util/syscalltbl.c
@@ -17,7 +17,7 @@
17#include <stdlib.h> 17#include <stdlib.h>
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19 19
20#ifdef HAVE_SYSCALL_TABLE 20#ifdef HAVE_SYSCALL_TABLE_SUPPORT
21#include <string.h> 21#include <string.h>
22#include "string2.h" 22#include "string2.h"
23#include "util.h" 23#include "util.h"
@@ -139,7 +139,7 @@ int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_g
139 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); 139 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx);
140} 140}
141 141
142#else /* HAVE_SYSCALL_TABLE */ 142#else /* HAVE_SYSCALL_TABLE_SUPPORT */
143 143
144#include <libaudit.h> 144#include <libaudit.h>
145 145
@@ -176,4 +176,4 @@ int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_g
176{ 176{
177 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); 177 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx);
178} 178}
179#endif /* HAVE_SYSCALL_TABLE */ 179#endif /* HAVE_SYSCALL_TABLE_SUPPORT */
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 0ac9077f62a2..b1e5c3a2b8e3 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -98,7 +98,7 @@ static void register_python_scripting(struct scripting_ops *scripting_ops)
98 } 98 }
99} 99}
100 100
101#ifdef NO_LIBPYTHON 101#ifndef HAVE_LIBPYTHON_SUPPORT
102void setup_python_scripting(void) 102void setup_python_scripting(void)
103{ 103{
104 register_python_scripting(&python_scripting_unsupported_ops); 104 register_python_scripting(&python_scripting_unsupported_ops);
@@ -161,7 +161,7 @@ static void register_perl_scripting(struct scripting_ops *scripting_ops)
161 } 161 }
162} 162}
163 163
164#ifdef NO_LIBPERL 164#ifndef HAVE_LIBPERL_SUPPORT
165void setup_perl_scripting(void) 165void setup_perl_scripting(void)
166{ 166{
167 register_perl_scripting(&perl_scripting_unsupported_ops); 167 register_perl_scripting(&perl_scripting_unsupported_ops);