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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

perf top:

Tommi Rantala:

- Fix stdio interface input handling with glibc 2.28+.

perf bench:

Tommi Rantala:

- Restore thread count default to online CPU count in futex-wake bench.

perf jevents:

John Garry:

- Fix leak of mapfile memory.

perf diff:

Nick Desaulniers:

- Fix undefined string comparision spotted by clang's -Wstring-compare.

misc:

Ian Rogers:

- Fix off-by 1 relative directory includes.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>

+98 -84
+7 -7
tools/include/uapi/asm/errno.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 #if defined(__i386__) || defined(__x86_64__) 3 - #include "../../arch/x86/include/uapi/asm/errno.h" 3 + #include "../../../arch/x86/include/uapi/asm/errno.h" 4 4 #elif defined(__powerpc__) 5 - #include "../../arch/powerpc/include/uapi/asm/errno.h" 5 + #include "../../../arch/powerpc/include/uapi/asm/errno.h" 6 6 #elif defined(__sparc__) 7 - #include "../../arch/sparc/include/uapi/asm/errno.h" 7 + #include "../../../arch/sparc/include/uapi/asm/errno.h" 8 8 #elif defined(__alpha__) 9 - #include "../../arch/alpha/include/uapi/asm/errno.h" 9 + #include "../../../arch/alpha/include/uapi/asm/errno.h" 10 10 #elif defined(__mips__) 11 - #include "../../arch/mips/include/uapi/asm/errno.h" 11 + #include "../../../arch/mips/include/uapi/asm/errno.h" 12 12 #elif defined(__ia64__) 13 - #include "../../arch/ia64/include/uapi/asm/errno.h" 13 + #include "../../../arch/ia64/include/uapi/asm/errno.h" 14 14 #elif defined(__xtensa__) 15 - #include "../../arch/xtensa/include/uapi/asm/errno.h" 15 + #include "../../../arch/xtensa/include/uapi/asm/errno.h" 16 16 #else 17 17 #include <asm-generic/errno.h> 18 18 #endif
+10 -10
tools/perf/arch/arm64/util/arm-spe.c
··· 11 11 #include <linux/zalloc.h> 12 12 #include <time.h> 13 13 14 - #include "../../util/cpumap.h" 15 - #include "../../util/event.h" 16 - #include "../../util/evsel.h" 17 - #include "../../util/evlist.h" 18 - #include "../../util/session.h" 14 + #include "../../../util/cpumap.h" 15 + #include "../../../util/event.h" 16 + #include "../../../util/evsel.h" 17 + #include "../../../util/evlist.h" 18 + #include "../../../util/session.h" 19 19 #include <internal/lib.h> // page_size 20 - #include "../../util/pmu.h" 21 - #include "../../util/debug.h" 22 - #include "../../util/auxtrace.h" 23 - #include "../../util/record.h" 24 - #include "../../util/arm-spe.h" 20 + #include "../../../util/pmu.h" 21 + #include "../../../util/debug.h" 22 + #include "../../../util/auxtrace.h" 23 + #include "../../../util/record.h" 24 + #include "../../../util/arm-spe.h" 25 25 26 26 #define KiB(x) ((x) * 1024) 27 27 #define MiB(x) ((x) * 1024 * 1024)
+1 -1
tools/perf/arch/arm64/util/perf_regs.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - #include "../../util/perf_regs.h" 2 + #include "../../../util/perf_regs.h" 3 3 4 4 const struct sample_reg sample_reg_masks[] = { 5 5 SMPL_REG_END
+2 -2
tools/perf/arch/powerpc/util/perf_regs.c
··· 4 4 #include <regex.h> 5 5 #include <linux/zalloc.h> 6 6 7 - #include "../../util/perf_regs.h" 8 - #include "../../util/debug.h" 7 + #include "../../../util/perf_regs.h" 8 + #include "../../../util/debug.h" 9 9 10 10 #include <linux/kernel.h> 11 11
+7 -7
tools/perf/arch/x86/util/auxtrace.c
··· 7 7 #include <errno.h> 8 8 #include <stdbool.h> 9 9 10 - #include "../../util/header.h" 11 - #include "../../util/debug.h" 12 - #include "../../util/pmu.h" 13 - #include "../../util/auxtrace.h" 14 - #include "../../util/intel-pt.h" 15 - #include "../../util/intel-bts.h" 16 - #include "../../util/evlist.h" 10 + #include "../../../util/header.h" 11 + #include "../../../util/debug.h" 12 + #include "../../../util/pmu.h" 13 + #include "../../../util/auxtrace.h" 14 + #include "../../../util/intel-pt.h" 15 + #include "../../../util/intel-bts.h" 16 + #include "../../../util/evlist.h" 17 17 18 18 static 19 19 struct auxtrace_record *auxtrace_record__init_intel(struct evlist *evlist,
+6 -6
tools/perf/arch/x86/util/event.c
··· 3 3 #include <linux/string.h> 4 4 #include <linux/zalloc.h> 5 5 6 - #include "../../util/event.h" 7 - #include "../../util/synthetic-events.h" 8 - #include "../../util/machine.h" 9 - #include "../../util/tool.h" 10 - #include "../../util/map.h" 11 - #include "../../util/debug.h" 6 + #include "../../../util/event.h" 7 + #include "../../../util/synthetic-events.h" 8 + #include "../../../util/machine.h" 9 + #include "../../../util/tool.h" 10 + #include "../../../util/map.h" 11 + #include "../../../util/debug.h" 12 12 13 13 #if defined(__x86_64__) 14 14
+2 -2
tools/perf/arch/x86/util/header.c
··· 7 7 #include <string.h> 8 8 #include <regex.h> 9 9 10 - #include "../../util/debug.h" 11 - #include "../../util/header.h" 10 + #include "../../../util/debug.h" 11 + #include "../../../util/header.h" 12 12 13 13 static inline void 14 14 cpuid(unsigned int op, unsigned int *a, unsigned int *b, unsigned int *c,
+12 -12
tools/perf/arch/x86/util/intel-bts.c
··· 11 11 #include <linux/log2.h> 12 12 #include <linux/zalloc.h> 13 13 14 - #include "../../util/cpumap.h" 15 - #include "../../util/event.h" 16 - #include "../../util/evsel.h" 17 - #include "../../util/evlist.h" 18 - #include "../../util/mmap.h" 19 - #include "../../util/session.h" 20 - #include "../../util/pmu.h" 21 - #include "../../util/debug.h" 22 - #include "../../util/record.h" 23 - #include "../../util/tsc.h" 24 - #include "../../util/auxtrace.h" 25 - #include "../../util/intel-bts.h" 14 + #include "../../../util/cpumap.h" 15 + #include "../../../util/event.h" 16 + #include "../../../util/evsel.h" 17 + #include "../../../util/evlist.h" 18 + #include "../../../util/mmap.h" 19 + #include "../../../util/session.h" 20 + #include "../../../util/pmu.h" 21 + #include "../../../util/debug.h" 22 + #include "../../../util/record.h" 23 + #include "../../../util/tsc.h" 24 + #include "../../../util/auxtrace.h" 25 + #include "../../../util/intel-bts.h" 26 26 #include <internal/lib.h> // page_size 27 27 28 28 #define KiB(x) ((x) * 1024)
+15 -15
tools/perf/arch/x86/util/intel-pt.c
··· 13 13 #include <linux/zalloc.h> 14 14 #include <cpuid.h> 15 15 16 - #include "../../util/session.h" 17 - #include "../../util/event.h" 18 - #include "../../util/evlist.h" 19 - #include "../../util/evsel.h" 20 - #include "../../util/evsel_config.h" 21 - #include "../../util/cpumap.h" 22 - #include "../../util/mmap.h" 16 + #include "../../../util/session.h" 17 + #include "../../../util/event.h" 18 + #include "../../../util/evlist.h" 19 + #include "../../../util/evsel.h" 20 + #include "../../../util/evsel_config.h" 21 + #include "../../../util/cpumap.h" 22 + #include "../../../util/mmap.h" 23 23 #include <subcmd/parse-options.h> 24 - #include "../../util/parse-events.h" 25 - #include "../../util/pmu.h" 26 - #include "../../util/debug.h" 27 - #include "../../util/auxtrace.h" 28 - #include "../../util/record.h" 29 - #include "../../util/target.h" 30 - #include "../../util/tsc.h" 24 + #include "../../../util/parse-events.h" 25 + #include "../../../util/pmu.h" 26 + #include "../../../util/debug.h" 27 + #include "../../../util/auxtrace.h" 28 + #include "../../../util/record.h" 29 + #include "../../../util/target.h" 30 + #include "../../../util/tsc.h" 31 31 #include <internal/lib.h> // page_size 32 - #include "../../util/intel-pt.h" 32 + #include "../../../util/intel-pt.h" 33 33 34 34 #define KiB(x) ((x) * 1024) 35 35 #define MiB(x) ((x) * 1024 * 1024)
+3 -3
tools/perf/arch/x86/util/machine.c
··· 5 5 #include <stdlib.h> 6 6 7 7 #include <internal/lib.h> // page_size 8 - #include "../../util/machine.h" 9 - #include "../../util/map.h" 10 - #include "../../util/symbol.h" 8 + #include "../../../util/machine.h" 9 + #include "../../../util/map.h" 10 + #include "../../../util/symbol.h" 11 11 #include <linux/ctype.h> 12 12 13 13 #include <symbol/kallsyms.h>
+4 -4
tools/perf/arch/x86/util/perf_regs.c
··· 5 5 #include <linux/kernel.h> 6 6 #include <linux/zalloc.h> 7 7 8 - #include "../../perf-sys.h" 9 - #include "../../util/perf_regs.h" 10 - #include "../../util/debug.h" 11 - #include "../../util/event.h" 8 + #include "../../../perf-sys.h" 9 + #include "../../../util/perf_regs.h" 10 + #include "../../../util/debug.h" 11 + #include "../../../util/event.h" 12 12 13 13 const struct sample_reg sample_reg_masks[] = { 14 14 SMPL_REG(AX, PERF_REG_X86_AX),
+3 -3
tools/perf/arch/x86/util/pmu.c
··· 4 4 #include <linux/stddef.h> 5 5 #include <linux/perf_event.h> 6 6 7 - #include "../../util/intel-pt.h" 8 - #include "../../util/intel-bts.h" 9 - #include "../../util/pmu.h" 7 + #include "../../../util/intel-pt.h" 8 + #include "../../../util/intel-bts.h" 9 + #include "../../../util/pmu.h" 10 10 11 11 struct perf_event_attr *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused) 12 12 {
+1
tools/perf/bench/epoll-ctl.c
··· 312 312 exit(EXIT_FAILURE); 313 313 } 314 314 315 + memset(&act, 0, sizeof(act)); 315 316 sigfillset(&act.sa_mask); 316 317 act.sa_sigaction = toggle_done; 317 318 sigaction(SIGINT, &act, NULL);
+1
tools/perf/bench/epoll-wait.c
··· 426 426 exit(EXIT_FAILURE); 427 427 } 428 428 429 + memset(&act, 0, sizeof(act)); 429 430 sigfillset(&act.sa_mask); 430 431 act.sa_sigaction = toggle_done; 431 432 sigaction(SIGINT, &act, NULL);
+1
tools/perf/bench/futex-hash.c
··· 137 137 if (!cpu) 138 138 goto errmem; 139 139 140 + memset(&act, 0, sizeof(act)); 140 141 sigfillset(&act.sa_mask); 141 142 act.sa_sigaction = toggle_done; 142 143 sigaction(SIGINT, &act, NULL);
+1
tools/perf/bench/futex-lock-pi.c
··· 160 160 if (!cpu) 161 161 err(EXIT_FAILURE, "calloc"); 162 162 163 + memset(&act, 0, sizeof(act)); 163 164 sigfillset(&act.sa_mask); 164 165 act.sa_sigaction = toggle_done; 165 166 sigaction(SIGINT, &act, NULL);
+1
tools/perf/bench/futex-requeue.c
··· 128 128 if (!cpu) 129 129 err(EXIT_FAILURE, "cpu_map__new"); 130 130 131 + memset(&act, 0, sizeof(act)); 131 132 sigfillset(&act.sa_mask); 132 133 act.sa_sigaction = toggle_done; 133 134 sigaction(SIGINT, &act, NULL);
+1
tools/perf/bench/futex-wake-parallel.c
··· 234 234 exit(EXIT_FAILURE); 235 235 } 236 236 237 + memset(&act, 0, sizeof(act)); 237 238 sigfillset(&act.sa_mask); 238 239 act.sa_sigaction = toggle_done; 239 240 sigaction(SIGINT, &act, NULL);
+3 -2
tools/perf/bench/futex-wake.c
··· 43 43 static pthread_mutex_t thread_lock; 44 44 static pthread_cond_t thread_parent, thread_worker; 45 45 static struct stats waketime_stats, wakeup_stats; 46 - static unsigned int ncpus, threads_starting, nthreads = 0; 46 + static unsigned int threads_starting, nthreads = 0; 47 47 static int futex_flag = 0; 48 48 49 49 static const struct option options[] = { ··· 136 136 if (!cpu) 137 137 err(EXIT_FAILURE, "calloc"); 138 138 139 + memset(&act, 0, sizeof(act)); 139 140 sigfillset(&act.sa_mask); 140 141 act.sa_sigaction = toggle_done; 141 142 sigaction(SIGINT, &act, NULL); 142 143 143 144 if (!nthreads) 144 - nthreads = ncpus; 145 + nthreads = cpu->nr; 145 146 146 147 worker = calloc(nthreads, sizeof(*worker)); 147 148 if (!worker)
+2 -1
tools/perf/builtin-diff.c
··· 1312 1312 end_line = map__srcline(he->ms.map, bi->sym->start + bi->end, 1313 1313 he->ms.sym); 1314 1314 1315 - if ((start_line != SRCLINE_UNKNOWN) && (end_line != SRCLINE_UNKNOWN)) { 1315 + if ((strncmp(start_line, SRCLINE_UNKNOWN, strlen(SRCLINE_UNKNOWN)) != 0) && 1316 + (strncmp(end_line, SRCLINE_UNKNOWN, strlen(SRCLINE_UNKNOWN)) != 0)) { 1316 1317 scnprintf(buf, sizeof(buf), "[%s -> %s] %4ld", 1317 1318 start_line, end_line, block_he->diff.cycles); 1318 1319 } else {
+3 -1
tools/perf/builtin-top.c
··· 684 684 delay_msecs = top->delay_secs * MSEC_PER_SEC; 685 685 set_term_quiet_input(&save); 686 686 /* trash return*/ 687 - getc(stdin); 687 + clearerr(stdin); 688 + if (poll(&stdin_poll, 1, 0) > 0) 689 + getc(stdin); 688 690 689 691 while (!done) { 690 692 perf_top__print_sym_table(top);
+9 -6
tools/perf/pmu-events/jevents.c
··· 1082 1082 */ 1083 1083 int main(int argc, char *argv[]) 1084 1084 { 1085 - int rc; 1085 + int rc, ret = 0; 1086 1086 int maxfds; 1087 1087 char ldirname[PATH_MAX]; 1088 - 1089 1088 const char *arch; 1090 1089 const char *output_file; 1091 1090 const char *start_dirname; ··· 1155 1156 /* Make build fail */ 1156 1157 fclose(eventsfp); 1157 1158 free_arch_std_events(); 1158 - return 1; 1159 + ret = 1; 1160 + goto out_free_mapfile; 1159 1161 } else if (rc) { 1160 1162 goto empty_map; 1161 1163 } ··· 1174 1174 /* Make build fail */ 1175 1175 fclose(eventsfp); 1176 1176 free_arch_std_events(); 1177 - return 1; 1177 + ret = 1; 1178 1178 } 1179 1179 1180 - return 0; 1180 + 1181 + goto out_free_mapfile; 1181 1182 1182 1183 empty_map: 1183 1184 fclose(eventsfp); 1184 1185 create_empty_mapping(output_file); 1185 1186 free_arch_std_events(); 1186 - return 0; 1187 + out_free_mapfile: 1188 + free(mapfile); 1189 + return ret; 1187 1190 }
+2 -1
tools/perf/util/block-info.c
··· 295 295 end_line = map__srcline(he->ms.map, bi->sym->start + bi->end, 296 296 he->ms.sym); 297 297 298 - if ((start_line != SRCLINE_UNKNOWN) && (end_line != SRCLINE_UNKNOWN)) { 298 + if ((strncmp(start_line, SRCLINE_UNKNOWN, strlen(SRCLINE_UNKNOWN)) != 0) && 299 + (strncmp(end_line, SRCLINE_UNKNOWN, strlen(SRCLINE_UNKNOWN)) != 0)) { 299 300 scnprintf(buf, sizeof(buf), "[%s -> %s]", 300 301 start_line, end_line); 301 302 } else {
+1 -1
tools/perf/util/map.c
··· 431 431 432 432 if (map && map->dso) { 433 433 char *srcline = map__srcline(map, addr, NULL); 434 - if (srcline != SRCLINE_UNKNOWN) 434 + if (strncmp(srcline, SRCLINE_UNKNOWN, strlen(SRCLINE_UNKNOWN)) != 0) 435 435 ret = fprintf(fp, "%s%s", prefix, srcline); 436 436 free_srcline(srcline); 437 437 }