diff options
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/MANIFEST | 87 | ||||
| -rw-r--r-- | tools/perf/arch/s390/util/Build | 1 | ||||
| -rw-r--r-- | tools/perf/arch/s390/util/sym-handling.c | 29 | ||||
| -rw-r--r-- | tools/perf/util/callchain.c | 35 | ||||
| -rw-r--r-- | tools/perf/util/evsel.c | 7 | ||||
| -rw-r--r-- | tools/perf/util/symbol-elf.c | 8 | ||||
| -rw-r--r-- | tools/perf/util/symbol.h | 3 | ||||
| -rw-r--r-- | tools/perf/util/syscalltbl.c | 2 |
8 files changed, 31 insertions, 141 deletions
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/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/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/util/callchain.c b/tools/perf/util/callchain.c index 510b513e0f01..be09d77cade0 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c | |||
| @@ -65,8 +65,6 @@ static int parse_callchain_mode(const char *value) | |||
| 65 | callchain_param.mode = CHAIN_FOLDED; | 65 | callchain_param.mode = CHAIN_FOLDED; |
| 66 | return 0; | 66 | return 0; |
| 67 | } | 67 | } |
| 68 | |||
| 69 | pr_err("Invalid callchain mode: %s\n", value); | ||
| 70 | return -1; | 68 | return -1; |
| 71 | } | 69 | } |
| 72 | 70 | ||
| @@ -82,8 +80,6 @@ static int parse_callchain_order(const char *value) | |||
| 82 | callchain_param.order_set = true; | 80 | callchain_param.order_set = true; |
| 83 | return 0; | 81 | return 0; |
| 84 | } | 82 | } |
| 85 | |||
| 86 | pr_err("Invalid callchain order: %s\n", value); | ||
| 87 | return -1; | 83 | return -1; |
| 88 | } | 84 | } |
| 89 | 85 | ||
| @@ -105,8 +101,6 @@ static int parse_callchain_sort_key(const char *value) | |||
| 105 | callchain_param.branch_callstack = 1; | 101 | callchain_param.branch_callstack = 1; |
| 106 | return 0; | 102 | return 0; |
| 107 | } | 103 | } |
| 108 | |||
| 109 | pr_err("Invalid callchain sort key: %s\n", value); | ||
| 110 | return -1; | 104 | return -1; |
| 111 | } | 105 | } |
| 112 | 106 | ||
| @@ -124,8 +118,6 @@ static int parse_callchain_value(const char *value) | |||
| 124 | callchain_param.value = CCVAL_COUNT; | 118 | callchain_param.value = CCVAL_COUNT; |
| 125 | return 0; | 119 | return 0; |
| 126 | } | 120 | } |
| 127 | |||
| 128 | pr_err("Invalid callchain config key: %s\n", value); | ||
| 129 | return -1; | 121 | return -1; |
| 130 | } | 122 | } |
| 131 | 123 | ||
| @@ -319,12 +311,27 @@ int perf_callchain_config(const char *var, const char *value) | |||
| 319 | 311 | ||
| 320 | return ret; | 312 | return ret; |
| 321 | } | 313 | } |
| 322 | if (!strcmp(var, "print-type")) | 314 | if (!strcmp(var, "print-type")){ |
| 323 | return parse_callchain_mode(value); | 315 | int ret; |
| 324 | if (!strcmp(var, "order")) | 316 | ret = parse_callchain_mode(value); |
| 325 | return parse_callchain_order(value); | 317 | if (ret == -1) |
| 326 | if (!strcmp(var, "sort-key")) | 318 | pr_err("Invalid callchain mode: %s\n", value); |
| 327 | return parse_callchain_sort_key(value); | 319 | return ret; |
| 320 | } | ||
| 321 | if (!strcmp(var, "order")){ | ||
| 322 | int ret; | ||
| 323 | ret = parse_callchain_order(value); | ||
| 324 | if (ret == -1) | ||
| 325 | pr_err("Invalid callchain order: %s\n", value); | ||
| 326 | return ret; | ||
| 327 | } | ||
| 328 | if (!strcmp(var, "sort-key")){ | ||
| 329 | int ret; | ||
| 330 | ret = parse_callchain_sort_key(value); | ||
| 331 | if (ret == -1) | ||
| 332 | pr_err("Invalid callchain sort key: %s\n", value); | ||
| 333 | return ret; | ||
| 334 | } | ||
| 328 | if (!strcmp(var, "threshold")) { | 335 | if (!strcmp(var, "threshold")) { |
| 329 | callchain_param.min_percent = strtod(value, &endptr); | 336 | callchain_param.min_percent = strtod(value, &endptr); |
| 330 | if (value == endptr) { | 337 | if (value == endptr) { |
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/symbol-elf.c b/tools/perf/util/symbol-elf.c index 5c39f420111e..9cf781f0d8a2 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c | |||
| @@ -810,12 +810,6 @@ static u64 ref_reloc(struct kmap *kmap) | |||
| 810 | void __weak arch__sym_update(struct symbol *s __maybe_unused, | 810 | void __weak arch__sym_update(struct symbol *s __maybe_unused, |
| 811 | GElf_Sym *sym __maybe_unused) { } | 811 | GElf_Sym *sym __maybe_unused) { } |
| 812 | 812 | ||
| 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, | 813 | int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, |
| 820 | struct symsrc *runtime_ss, int kmodule) | 814 | struct symsrc *runtime_ss, int kmodule) |
| 821 | { | 815 | { |
| @@ -996,7 +990,7 @@ int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, | |||
| 996 | 990 | ||
| 997 | /* Adjust symbol to map to file offset */ | 991 | /* Adjust symbol to map to file offset */ |
| 998 | if (adjust_kernel_syms) | 992 | if (adjust_kernel_syms) |
| 999 | arch__adjust_sym_map_offset(&sym, &shdr, map); | 993 | sym.st_value -= shdr.sh_addr - shdr.sh_offset; |
| 1000 | 994 | ||
| 1001 | if (strcmp(section_name, | 995 | if (strcmp(section_name, |
| 1002 | (curr_dso->short_name + | 996 | (curr_dso->short_name + |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 2bd6a1f01a1c..aad99e7e179b 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
| @@ -344,9 +344,6 @@ int setup_intlist(struct intlist **list, const char *list_str, | |||
| 344 | #ifdef HAVE_LIBELF_SUPPORT | 344 | #ifdef HAVE_LIBELF_SUPPORT |
| 345 | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr); | 345 | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr); |
| 346 | void arch__sym_update(struct symbol *s, GElf_Sym *sym); | 346 | 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 | 347 | #endif |
| 351 | 348 | ||
| 352 | #define SYMBOL_A 0 | 349 | #define SYMBOL_A 0 |
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" |
