Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'perf/urgent' into perf/core, to pick up fixes

Signed-off-by: Ingo Molnar <mingo@kernel.org>

+69 -17
+1 -1
tools/include/uapi/linux/in.h
··· 268 268 #define IN_MULTICAST(a) IN_CLASSD(a) 269 269 #define IN_MULTICAST_NET 0xe0000000 270 270 271 - #define IN_BADCLASS(a) ((((long int) (a) ) == 0xffffffff) 271 + #define IN_BADCLASS(a) (((long int) (a) ) == (long int)0xffffffff) 272 272 #define IN_EXPERIMENTAL(a) IN_BADCLASS((a)) 273 273 274 274 #define IN_CLASSE(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
+12 -4
tools/perf/Documentation/perf-c2c.txt
··· 19 19 The perf c2c tool provides means for Shared Data C2C/HITM analysis. It allows 20 20 you to track down the cacheline contentions. 21 21 22 - The tool is based on x86's load latency and precise store facility events 23 - provided by Intel CPUs. These events provide: 22 + On x86, the tool is based on load latency and precise store facility events 23 + provided by Intel CPUs. On PowerPC, the tool uses random instruction sampling 24 + with thresholding feature. 25 + 26 + These events provide: 24 27 - memory address of the access 25 28 - type of the access (load and store details) 26 29 - latency (in cycles) of the load access ··· 49 46 50 47 -l:: 51 48 --ldlat:: 52 - Configure mem-loads latency. 49 + Configure mem-loads latency. (x86 only) 53 50 54 51 -k:: 55 52 --all-kernel:: ··· 122 119 -W,-d,--phys-data,--sample-cpu 123 120 124 121 Unless specified otherwise with '-e' option, following events are monitored by 125 - default: 122 + default on x86: 126 123 127 124 cpu/mem-loads,ldlat=30/P 128 125 cpu/mem-stores/P 126 + 127 + and following on PowerPC: 128 + 129 + cpu/mem-loads/ 130 + cpu/mem-stores/ 129 131 130 132 User can pass any 'perf record' option behind '--' mark, like (to enable 131 133 callchains and system wide monitoring):
+1 -1
tools/perf/Documentation/perf-mem.txt
··· 82 82 Be more verbose (show counter open errors, etc) 83 83 84 84 --ldlat <n>:: 85 - Specify desired latency for loads event. 85 + Specify desired latency for loads event. (x86 only) 86 86 87 87 In addition, for report all perf report options are valid, and for record 88 88 all perf record options.
+1
tools/perf/arch/powerpc/util/Build
··· 2 2 libperf-y += sym-handling.o 3 3 libperf-y += kvm-stat.o 4 4 libperf-y += perf_regs.o 5 + libperf-y += mem-events.o 5 6 6 7 libperf-$(CONFIG_DWARF) += dwarf-regs.o 7 8 libperf-$(CONFIG_DWARF) += skip-callchain-idx.o
+11
tools/perf/arch/powerpc/util/mem-events.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #include "mem-events.h" 3 + 4 + /* PowerPC does not support 'ldlat' parameter. */ 5 + char *perf_mem_events__name(int i) 6 + { 7 + if (i == PERF_MEM_EVENTS__LOAD) 8 + return (char *) "cpu/mem-loads/"; 9 + 10 + return (char *) "cpu/mem-stores/"; 11 + }
+18 -7
tools/perf/builtin-trace.c
··· 2514 2514 2515 2515 static bool perf_evlist__add_vfs_getname(struct perf_evlist *evlist) 2516 2516 { 2517 - struct perf_evsel *evsel = perf_evsel__newtp("probe", "vfs_getname"); 2517 + bool found = false; 2518 + struct perf_evsel *evsel, *tmp; 2519 + struct parse_events_error err = { .idx = 0, }; 2520 + int ret = parse_events(evlist, "probe:vfs_getname*", &err); 2518 2521 2519 - if (IS_ERR(evsel)) 2522 + if (ret) 2520 2523 return false; 2521 2524 2522 - if (perf_evsel__field(evsel, "pathname") == NULL) { 2525 + evlist__for_each_entry_safe(evlist, evsel, tmp) { 2526 + if (!strstarts(perf_evsel__name(evsel), "probe:vfs_getname")) 2527 + continue; 2528 + 2529 + if (perf_evsel__field(evsel, "pathname")) { 2530 + evsel->handler = trace__vfs_getname; 2531 + found = true; 2532 + continue; 2533 + } 2534 + 2535 + list_del_init(&evsel->node); 2536 + evsel->evlist = NULL; 2523 2537 perf_evsel__delete(evsel); 2524 - return false; 2525 2538 } 2526 2539 2527 - evsel->handler = trace__vfs_getname; 2528 - perf_evlist__add(evlist, evsel); 2529 - return true; 2540 + return found; 2530 2541 } 2531 2542 2532 2543 static struct perf_evsel *perf_evsel__new_pgfault(u64 config)
+1 -1
tools/perf/tests/evsel-tp-sched.c
··· 17 17 return -1; 18 18 } 19 19 20 - is_signed = !!(field->flags | TEP_FIELD_IS_SIGNED); 20 + is_signed = !!(field->flags & TEP_FIELD_IS_SIGNED); 21 21 if (should_be_signed && !is_signed) { 22 22 pr_debug("%s: \"%s\" signedness(%d) is wrong, should be %d\n", 23 23 evsel->name, name, is_signed, should_be_signed);
+1 -1
tools/perf/util/c++/clang.cpp
··· 160 160 } 161 161 PM.run(*Module); 162 162 163 - return std::move(Buffer); 163 + return Buffer; 164 164 } 165 165 166 166 }
+1 -1
tools/perf/util/mem-events.c
··· 28 28 static char mem_loads_name[100]; 29 29 static bool mem_loads_name__init; 30 30 31 - char *perf_mem_events__name(int i) 31 + char * __weak perf_mem_events__name(int i) 32 32 { 33 33 if (i == PERF_MEM_EVENTS__LOAD) { 34 34 if (!mem_loads_name__init) {
+22 -1
tools/perf/util/symbol-elf.c
··· 19 19 #define EM_AARCH64 183 /* ARM 64 bit */ 20 20 #endif 21 21 22 + #ifndef ELF32_ST_VISIBILITY 23 + #define ELF32_ST_VISIBILITY(o) ((o) & 0x03) 24 + #endif 25 + 26 + /* For ELF64 the definitions are the same. */ 27 + #ifndef ELF64_ST_VISIBILITY 28 + #define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o) 29 + #endif 30 + 31 + /* How to extract information held in the st_other field. */ 32 + #ifndef GELF_ST_VISIBILITY 33 + #define GELF_ST_VISIBILITY(val) ELF64_ST_VISIBILITY (val) 34 + #endif 35 + 22 36 typedef Elf64_Nhdr GElf_Nhdr; 23 37 24 38 #ifdef HAVE_CPLUS_DEMANGLE_SUPPORT ··· 101 87 return GELF_ST_TYPE(sym->st_info); 102 88 } 103 89 90 + static inline uint8_t elf_sym__visibility(const GElf_Sym *sym) 91 + { 92 + return GELF_ST_VISIBILITY(sym->st_other); 93 + } 94 + 104 95 #ifndef STT_GNU_IFUNC 105 96 #define STT_GNU_IFUNC 10 106 97 #endif ··· 130 111 return elf_sym__type(sym) == STT_NOTYPE && 131 112 sym->st_name != 0 && 132 113 sym->st_shndx != SHN_UNDEF && 133 - sym->st_shndx != SHN_ABS; 114 + sym->st_shndx != SHN_ABS && 115 + elf_sym__visibility(sym) != STV_HIDDEN && 116 + elf_sym__visibility(sym) != STV_INTERNAL; 134 117 } 135 118 136 119 static bool elf_sym__filter(GElf_Sym *sym)