History

Merge tag 'perf-core-for-mingo-4.17-20180413' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull tooling improvements and fixes from Arnaldo Carvalho de Melo: perf annotate fixes and improvements: - Allow showing offsets in more than just jump targets, use the new 'O' hotkey in the TUI, config ~/.perfconfig annotate.offset_level for it and for --stdio2 (Arnaldo Carvalho de Melo) - Use the resolved variable names from objdump disassembled lines to make them more compact, just like was already done for some instructions, like "mov", this eventually will be done more generally, but lets now add some more to the existing mechanism (Arnaldo Carvalho de Melo) perf record fixes: - Change warning for missing topology sysfs entry to debug, as not all architectures have those files, s390 being one of those (Thomas Richter) perf sched fixes: - Fix -g/--call-graph documentation (Takuya Yamamoto) perf stat: - Enable 1ms interval for printing event counters values in (Alexey Budankov) perf test fixes: - Run dwarf unwind on arm32 (Kim Phillips) - Remove unused ptrace.h include from LLVM test, sidesteping older clang's lack of support for some asm constructs (Arnaldo Carvalho de Melo) perf version fixes: - Do not print info about HAVE_LIBAUDIT_SUPPORT in 'perf version --build-options' when HAVE_SYSCALL_TABLE_SUPPORT is true, as libaudit won't be used in that case, print info about syscall_table support instead (Jin Yao) Build system fixes: - Use HAVE_..._SUPPORT used consistently (Jin Yao) - Restore READ_ONCE() C++ compatibility in tools/include (Mark Rutland) - Give hints about package names needed to build jvmti (Arnaldo Carvalho de Melo)

Ingo Molnar committed 8 years ago

Commit aacd1882 parents 60cc43f b0d5c8125 files · +178 −48Browse files

Unified · Split

25 files
  1. arch/x86/include/asm/asm.h +0 −2
  2. tools/include/linux/compiler.h +15 −5
  3. tools/perf/Documentation/perf-config.txt +5 −0
  4. tools/perf/Documentation/perf-sched.txt +2 −2
  5. tools/perf/Documentation/perf-stat.txt +1 −1
  6. tools/perf/Makefile.config +2 −2
  7. tools/perf/arch/arm/include/arch-tests.h +12 −0
  8. tools/perf/arch/arm/tests/Build +2 −0
  9. tools/perf/arch/arm/tests/arch-tests.c +16 −0
  10. tools/perf/arch/x86/annotate/instructions.c +66 −1
  11. tools/perf/builtin-help.c +1 −1
  12. tools/perf/builtin-script.c +2 −2
  13. tools/perf/builtin-stat.c +2 −12
  14. tools/perf/builtin-version.c +3 −0
  15. tools/perf/perf.c +2 −2
  16. tools/perf/tests/bpf-script-test-kbuild.c +0 −1
  17. tools/perf/tests/builtin-test.c +1 −0
  18. tools/perf/ui/browsers/annotate.c +5 −0
  19. tools/perf/util/annotate.c +21 −5
  20. tools/perf/util/annotate.h +9 −0
  21. tools/perf/util/generate-cmdlist.sh +1 −1
  22. tools/perf/util/header.c +2 −1
  23. tools/perf/util/symbol.c +3 −5
  24. tools/perf/util/syscalltbl.c +3 −3
  25. tools/perf/util/trace-event-scripting.c +2 −2
arch/x86/include/asm/asm.h+0−2
@@ -136,7 +136,6 @@ · 135 unmodified lines
136136 #endif
137137
138138 #ifndef __ASSEMBLY__
139−#ifndef __BPF__
140139 /*
141140 * This output constraint should be used for any inline asm which has a "call"
142141 * instruction. Otherwise the asm may be inserted before the frame pointer
@@ -146,6 +145,5 @@ · 3 unmodified lines
146145 register unsigned long current_stack_pointer asm(_ASM_SP);
147146 #define ASM_CALL_CONSTRAINT "+r" (current_stack_pointer)
148147 #endif
149−#endif
150148
151149 #endif /* _ASM_X86_ASM_H */
tools/include/linux/compiler.h+15−5
@@ -151,11 +151,21 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s · 150 unmodified lines
151151 * required ordering.
152152 */
153153
154−#define READ_ONCE(x) \
155− ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; })
156−
157−#define WRITE_ONCE(x, val) \
158− ({ union { typeof(x) __val; char __c[1]; } __u = { .__val = (val) }; __write_once_size(&(x), __u.__c, sizeof(x)); __u.__val; })
154+#define READ_ONCE(x) \
155+({ \
156+ union { typeof(x) __val; char __c[1]; } __u = \
157+ { .__c = { 0 } }; \
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+})
159169
160170
161171 #ifndef __fallthrough
tools/perf/Documentation/perf-config.txt+5−0
@@ -334,6 +334,11 @@ annotate.*:: · 333 unmodified lines
334334
335335 99.93 │ mov %eax,%eax
336336
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+
337342 hist.*::
338343 hist.percentage::
339344 This option control the way to calculate overhead of filtered entries -
tools/perf/Documentation/perf-sched.txt+2−2
@@ -104,8 +104,8 @@ OPTIONS for 'perf sched timehist' · 103 unmodified lines
104104 kallsyms pathname
105105
106106 -g::
107−--no-call-graph::
108− Do not display call chains if present.
107+--call-graph::
108+ Display call chains if present (default on).
109109
110110 --max-stack::
111111 Maximum number of functions to display in backtrace, default 5.
tools/perf/Documentation/perf-stat.txt+1−1
@@ -153,7 +153,7 @@ perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' -- m · 152 unmodified lines
153153
154154 -I msecs::
155155 --interval-print msecs::
156−Print count deltas every N milliseconds (minimum: 10ms)
156+Print count deltas every N milliseconds (minimum: 1ms)
157157 The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals. Use with caution.
158158 example: 'perf stat -I 1000 -e cycles -a sleep 5'
159159
tools/perf/Makefile.config+2−2
@@ -68,7 +68,7 @@ ifeq ($(NO_PERF_REGS),0) · 67 unmodified lines
6868 endif
6969
7070 ifneq ($(NO_SYSCALL_TABLE),1)
71− CFLAGS += -DHAVE_SYSCALL_TABLE
71+ CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
7272 endif
7373
7474 # So far there's only x86 and arm libdw unwind support merged in perf.
@@ -847,7 +847,7 @@ ifndef NO_JVMTI · 772 unmodified lines
847847 ifeq ($(feature-jvmti), 1)
848848 $(call detected_var,JDIR)
849849 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)
851851 NO_JVMTI := 1
852852 endif
853853 endif
tools/perf/arch/arm/include/arch-tests.h+12−0
@@ -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
6+struct thread;
7+struct perf_sample;
8+#endif
9+
10+extern struct test arch_tests[];
11+
12+#endif
tools/perf/arch/arm/tests/Build+2−0
@@ -1,2 +1,4 @@
11 libperf-y += regs_load.o
22 libperf-y += dwarf-unwind.o
3+
4+libperf-y += arch-tests.o
tools/perf/arch/arm/tests/arch-tests.c+16−0
@@ -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+
6+struct 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+};
tools/perf/arch/x86/annotate/instructions.c+66−1
@@ -1,21 +1,43 @@
11 // SPDX-License-Identifier: GPL-2.0
22 static struct ins x86__instructions[] = {
3+ { .name = "adc", .ops = &mov_ops, },
4+ { .name = "adcb", .ops = &mov_ops, },
5+ { .name = "adcl", .ops = &mov_ops, },
36 { .name = "add", .ops = &mov_ops, },
47 { .name = "addl", .ops = &mov_ops, },
58 { .name = "addq", .ops = &mov_ops, },
9+ { .name = "addsd", .ops = &mov_ops, },
610 { .name = "addw", .ops = &mov_ops, },
711 { .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, },
821 { .name = "bts", .ops = &mov_ops, },
22+ { .name = "btsq", .ops = &mov_ops, },
923 { .name = "call", .ops = &call_ops, },
1024 { .name = "callq", .ops = &call_ops, },
25+ { .name = "cmovbe", .ops = &mov_ops, },
26+ { .name = "cmove", .ops = &mov_ops, },
27+ { .name = "cmovae", .ops = &mov_ops, },
1128 { .name = "cmp", .ops = &mov_ops, },
1229 { .name = "cmpb", .ops = &mov_ops, },
1330 { .name = "cmpl", .ops = &mov_ops, },
1431 { .name = "cmpq", .ops = &mov_ops, },
1532 { .name = "cmpw", .ops = &mov_ops, },
1633 { .name = "cmpxch", .ops = &mov_ops, },
34+ { .name = "cmpxchg", .ops = &mov_ops, },
35+ { .name = "cs", .ops = &mov_ops, },
1736 { .name = "dec", .ops = &dec_ops, },
1837 { .name = "decl", .ops = &dec_ops, },
38+ { .name = "divsd", .ops = &mov_ops, },
39+ { .name = "divss", .ops = &mov_ops, },
40+ { .name = "gs", .ops = &mov_ops, },
1941 { .name = "imul", .ops = &mov_ops, },
2042 { .name = "inc", .ops = &dec_ops, },
2143 { .name = "incl", .ops = &dec_ops, },
@@ -57,25 +79,68 @@ static struct ins x86__instructions[] = { · 35 unmodified lines
5779 { .name = "lea", .ops = &mov_ops, },
5880 { .name = "lock", .ops = &lock_ops, },
5981 { .name = "mov", .ops = &mov_ops, },
82+ { .name = "movapd", .ops = &mov_ops, },
83+ { .name = "movaps", .ops = &mov_ops, },
6084 { .name = "movb", .ops = &mov_ops, },
6185 { .name = "movdqa", .ops = &mov_ops, },
86+ { .name = "movdqu", .ops = &mov_ops, },
6287 { .name = "movl", .ops = &mov_ops, },
6388 { .name = "movq", .ops = &mov_ops, },
89+ { .name = "movsd", .ops = &mov_ops, },
6490 { .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, },
6595 { .name = "movzbl", .ops = &mov_ops, },
6696 { .name = "movzwl", .ops = &mov_ops, },
97+ { .name = "mulsd", .ops = &mov_ops, },
98+ { .name = "mulss", .ops = &mov_ops, },
6799 { .name = "nop", .ops = &nop_ops, },
68100 { .name = "nopl", .ops = &nop_ops, },
69101 { .name = "nopw", .ops = &nop_ops, },
70102 { .name = "or", .ops = &mov_ops, },
103+ { .name = "orb", .ops = &mov_ops, },
71104 { .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, },
72122 { .name = "test", .ops = &mov_ops, },
73123 { .name = "testb", .ops = &mov_ops, },
74124 { .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, },
75136 { .name = "xadd", .ops = &mov_ops, },
76137 { .name = "xbeginl", .ops = &jump_ops, },
77138 { .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, },
79144 };
80145
81146 static bool x86__ins_is_fused(struct arch *arch, const char *ins1,
tools/perf/builtin-help.c+1−1
@@ -439,7 +439,7 @@ int cmd_help(int argc, const char **argv) · 438 unmodified lines
439439 #ifdef HAVE_LIBELF_SUPPORT
440440 "probe",
441441 #endif
442−#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
442+#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)
443443 "trace",
444444 #endif
445445 NULL };
tools/perf/builtin-script.c+2−2
@@ -2801,11 +2801,11 @@ int find_scripts(char **scripts_array, char **scripts_path_array) · 2800 unmodified lines
28012801 for_each_lang(scripts_path, scripts_dir, lang_dirent) {
28022802 scnprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path,
28032803 lang_dirent->d_name);
2804−#ifdef NO_LIBPERL
2804+#ifndef HAVE_LIBPERL_SUPPORT
28052805 if (strstr(lang_path, "perl"))
28062806 continue;
28072807 #endif
2808−#ifdef NO_LIBPYTHON
2808+#ifndef HAVE_LIBPYTHON_SUPPORT
28092809 if (strstr(lang_path, "python"))
28102810 continue;
28112811 #endif
tools/perf/builtin-stat.c+2−12
@@ -1943,7 +1943,8 @@ static const struct option stat_options[] = { · 1942 unmodified lines
19431943 OPT_STRING(0, "post", &post_cmd, "command",
19441944 "command to run after to the measured command"),
19451945 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)"),
19471948 OPT_INTEGER(0, "interval-count", &stat_config.times,
19481949 "print counts for fixed number of times"),
19491950 OPT_UINTEGER(0, "timeout", &stat_config.timeout,
@@ -2923,17 +2924,6 @@ int cmd_stat(int argc, const char **argv) · 973 unmodified lines
29232924 }
29242925 }
29252926
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−
29372927 if (stat_config.times && interval)
29382928 interval_count = true;
29392929 else if (stat_config.times && !interval) {
tools/perf/builtin-version.c+3−0
@@ -60,7 +60,10 @@ static void library_status(void) · 59 unmodified lines
6060 STATUS(HAVE_DWARF_GETLOCATIONS_SUPPORT, dwarf_getlocations);
6161 STATUS(HAVE_GLIBC_SUPPORT, glibc);
6262 STATUS(HAVE_GTK2_SUPPORT, gtk2);
63+#ifndef HAVE_SYSCALL_TABLE_SUPPORT
6364 STATUS(HAVE_LIBAUDIT_SUPPORT, libaudit);
65+#endif
66+ STATUS(HAVE_SYSCALL_TABLE_SUPPORT, syscall_table);
6467 STATUS(HAVE_LIBBFD_SUPPORT, libbfd);
6568 STATUS(HAVE_LIBELF_SUPPORT, libelf);
6669 STATUS(HAVE_LIBNUMA_SUPPORT, libnuma);
tools/perf/perf.c+2−2
@@ -73,7 +73,7 @@ static struct cmd_struct commands[] = { · 72 unmodified lines
7373 { "lock", cmd_lock, 0 },
7474 { "kvm", cmd_kvm, 0 },
7575 { "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)
7777 { "trace", cmd_trace, 0 },
7878 #endif
7979 { "inject", cmd_inject, 0 },
@@ -491,7 +491,7 @@ int main(int argc, const char **argv) · 411 unmodified lines
491491 argv[0] = cmd;
492492 }
493493 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)
495495 setup_path();
496496 argv[0] = "trace";
497497 return cmd_trace(argc, argv);
tools/perf/tests/bpf-script-test-kbuild.c+0−1
@@ -9,7 +9,6 @@ · 8 unmodified lines
99 #define SEC(NAME) __attribute__((section(NAME), used))
1010
1111 #include <uapi/linux/fs.h>
12−#include <uapi/asm/ptrace.h>
1312
1413 SEC("func=vfs_llseek")
1514 int bpf_func__vfs_llseek(void *ctx)
tools/perf/tests/builtin-test.c+1−0
@@ -118,6 +118,7 @@ static struct test generic_tests[] = { · 117 unmodified lines
118118 {
119119 .desc = "Breakpoint accounting",
120120 .func = test__bp_accounting,
121+ .is_supported = test__bp_signal_is_supported,
121122 },
122123 {
123124 .desc = "Number of exit events of a simple workload",
tools/perf/ui/browsers/annotate.c+5−0
@@ -692,6 +692,7 @@ static int annotate_browser__run(struct annotate_browser *browser, · 691 unmodified lines
692692 "J Toggle showing number of jump sources on targets\n"
693693 "n Search next string\n"
694694 "o Toggle disassembler output/simplified view\n"
695+ "O Bump offset level (jump targets -> +call -> all -> cycle thru)\n"
695696 "s Toggle source code view\n"
696697 "t Circulate percent, total period, samples view\n"
697698 "/ Search string\n"
@@ -719,6 +720,10 @@ static int annotate_browser__run(struct annotate_browser *browser, · 21 unmodified lines
719720 notes->options->use_offset = !notes->options->use_offset;
720721 annotation__update_column_widths(notes);
721722 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;
722727 case 'j':
723728 notes->options->jump_arrows = !notes->options->jump_arrows;
724729 continue;
tools/perf/util/annotate.c+21−5
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 struct annotation_options annotation__default_options = {
4747 .use_offset = true,
4848 .jump_arrows = true,
49+ .offset_level = ANNOTATION__OFFSET_JUMP_TARGETS,
4950 };
5051
5152 const char *disassembler_style;
@@ -2512,7 +2513,8 @@ static void __annotation_line__write(struct annotation_line *al, struct annotati · 2460 unmodified lines
25122513 if (!notes->options->use_offset) {
25132514 printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr);
25142515 } else {
2515− if (al->jump_sources) {
2516+ if (al->jump_sources &&
2517+ notes->options->offset_level >= ANNOTATION__OFFSET_JUMP_TARGETS) {
25162518 if (notes->options->show_nr_jumps) {
25172519 int prev;
25182520 printed = scnprintf(bf, sizeof(bf), "%*d ",
@@ -2523,9 +2525,14 @@ static void __annotation_line__write(struct annotation_line *al, struct annotati · 4 unmodified lines
25232525 obj__printf(obj, bf);
25242526 obj__set_color(obj, prev);
25252527 }
2526−
2528+print_addr:
25272529 printed = scnprintf(bf, sizeof(bf), "%*" PRIx64 ": ",
25282530 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;
25292536 } else {
25302537 printed = scnprintf(bf, sizeof(bf), "%-*s ",
25312538 notes->widths.addr, " ");
@@ -2642,10 +2649,11 @@ int __annotation__scnprintf_samples_period(struct annotation *notes, · 110 unmodified lines
26422649 */
26432650 static struct annotation_config {
26442651 const char *name;
2645− bool *value;
2652+ void *value;
26462653 } annotation__configs[] = {
26472654 ANNOTATION__CFG(hide_src_code),
26482655 ANNOTATION__CFG(jump_arrows),
2656+ ANNOTATION__CFG(offset_level),
26492657 ANNOTATION__CFG(show_linenr),
26502658 ANNOTATION__CFG(show_nr_jumps),
26512659 ANNOTATION__CFG(show_nr_samples),
@@ -2677,8 +2685,16 @@ static int annotation__config(const char *var, const char *value, · 25 unmodified lines
26772685
26782686 if (cfg == NULL)
26792687 pr_debug("%s variable unknown, ignoring...", var);
2680− else
2681− *cfg->value = perf_config_bool(name, value);
2688+ else if (strcmp(var, "annotate.offset_level") == 0) {
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+ }
26822698 return 0;
26832699 }
26842700
tools/perf/util/annotate.h+9−0
@@ -70,8 +70,17 @@ struct annotation_options { · 69 unmodified lines
7070 show_nr_jumps,
7171 show_nr_samples,
7272 show_total_period;
73+ u8 offset_level;
7374 };
7475
76+enum {
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+
7584 extern struct annotation_options annotation__default_options;
7685
7786 struct annotation;
tools/perf/util/generate-cmdlist.sh+1−1
@@ -38,7 +38,7 @@ do · 37 unmodified lines
3838 done
3939 echo "#endif /* HAVE_LIBELF_SUPPORT */"
4040
41−echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)"
41+echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)"
4242 sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
4343 sort |
4444 while read cmd
tools/perf/util/header.c+2−1
@@ -1320,7 +1320,8 @@ static int build_mem_topology(struct memory_node *nodes, u64 size, u64 *cntp) · 1319 unmodified lines
13201320
13211321 dir = opendir(path);
13221322 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);
13241325 return -1;
13251326 }
13261327
tools/perf/util/symbol.c+3−5
@@ -2091,16 +2091,14 @@ static bool symbol__read_kptr_restrict(void) · 2090 unmodified lines
20912091
20922092 int symbol__annotation_init(void)
20932093 {
2094+ if (symbol_conf.init_annotation)
2095+ return 0;
2096+
20942097 if (symbol_conf.initialized) {
20952098 pr_err("Annotation needs to be init before symbol__init()\n");
20962099 return -1;
20972100 }
20982101
2099− if (symbol_conf.init_annotation) {
2100− pr_warning("Annotation being initialized multiple times\n");
2101− return 0;
2102− }
2103−
21042102 symbol_conf.priv_size += sizeof(struct annotation);
21052103 symbol_conf.init_annotation = true;
21062104 return 0;
tools/perf/util/syscalltbl.c+3−3
@@ -17,7 +17,7 @@ · 16 unmodified lines
1717 #include <stdlib.h>
1818 #include <linux/compiler.h>
1919
20−#ifdef HAVE_SYSCALL_TABLE
20+#ifdef HAVE_SYSCALL_TABLE_SUPPORT
2121 #include <string.h>
2222 #include "string2.h"
2323 #include "util.h"
@@ -139,7 +139,7 @@ int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_g · 115 unmodified lines
139139 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx);
140140 }
141141
142−#else /* HAVE_SYSCALL_TABLE */
142+#else /* HAVE_SYSCALL_TABLE_SUPPORT */
143143
144144 #include <libaudit.h>
145145
@@ -176,4 +176,4 @@ int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_g · 30 unmodified lines
176176 {
177177 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx);
178178 }
179−#endif /* HAVE_SYSCALL_TABLE */
179+#endif /* HAVE_SYSCALL_TABLE_SUPPORT */
tools/perf/util/trace-event-scripting.c+2−2
@@ -98,7 +98,7 @@ static void register_python_scripting(struct scripting_ops *scripting_ops) · 97 unmodified lines
9898 }
9999 }
100100
101−#ifdef NO_LIBPYTHON
101+#ifndef HAVE_LIBPYTHON_SUPPORT
102102 void setup_python_scripting(void)
103103 {
104104 register_python_scripting(&python_scripting_unsupported_ops);
@@ -161,7 +161,7 @@ static void register_perl_scripting(struct scripting_ops *scripting_ops) · 56 unmodified lines
161161 }
162162 }
163163
164−#ifdef NO_LIBPERL
164+#ifndef HAVE_LIBPERL_SUPPORT
165165 void setup_perl_scripting(void)
166166 {
167167 register_perl_scripting(&perl_scripting_unsupported_ops);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t