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-tools-fixes-for-v5.17-2022-03-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

Pull perf tools fixes from Arnaldo Carvalho de Melo:

- Avoid iterating empty evlist, fixing a segfault with 'perf stat --null'

- Ignore case in topdown.slots check, fixing issue with Intel Icelake
JSON metrics.

- Fix symbol size calculation condition for fixing up corner case
symbol end address obtained from Kallsyms.

* tag 'perf-tools-fixes-for-v5.17-2022-03-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
perf parse-events: Ignore case in topdown.slots check
perf evlist: Avoid iteration for empty evlist.
perf symbols: Fix symbol size calculation condition

+19 -13
+1 -1
tools/perf/arch/x86/util/evlist.c
··· 29 29 30 30 __evlist__for_each_entry(list, evsel) { 31 31 if (evsel->pmu_name && !strcmp(evsel->pmu_name, "cpu") && 32 - evsel->name && strstr(evsel->name, "slots")) 32 + evsel->name && strcasestr(evsel->name, "slots")) 33 33 return evsel; 34 34 } 35 35 return first;
+17 -11
tools/perf/util/evlist.c
··· 346 346 { 347 347 struct evlist_cpu_iterator itr = { 348 348 .container = evlist, 349 - .evsel = evlist__first(evlist), 349 + .evsel = NULL, 350 350 .cpu_map_idx = 0, 351 351 .evlist_cpu_map_idx = 0, 352 352 .evlist_cpu_map_nr = perf_cpu_map__nr(evlist->core.all_cpus), ··· 354 354 .affinity = affinity, 355 355 }; 356 356 357 - if (itr.affinity) { 358 - itr.cpu = perf_cpu_map__cpu(evlist->core.all_cpus, 0); 359 - affinity__set(itr.affinity, itr.cpu.cpu); 360 - itr.cpu_map_idx = perf_cpu_map__idx(itr.evsel->core.cpus, itr.cpu); 361 - /* 362 - * If this CPU isn't in the evsel's cpu map then advance through 363 - * the list. 364 - */ 365 - if (itr.cpu_map_idx == -1) 366 - evlist_cpu_iterator__next(&itr); 357 + if (evlist__empty(evlist)) { 358 + /* Ensure the empty list doesn't iterate. */ 359 + itr.evlist_cpu_map_idx = itr.evlist_cpu_map_nr; 360 + } else { 361 + itr.evsel = evlist__first(evlist); 362 + if (itr.affinity) { 363 + itr.cpu = perf_cpu_map__cpu(evlist->core.all_cpus, 0); 364 + affinity__set(itr.affinity, itr.cpu.cpu); 365 + itr.cpu_map_idx = perf_cpu_map__idx(itr.evsel->core.cpus, itr.cpu); 366 + /* 367 + * If this CPU isn't in the evsel's cpu map then advance 368 + * through the list. 369 + */ 370 + if (itr.cpu_map_idx == -1) 371 + evlist_cpu_iterator__next(&itr); 372 + } 367 373 } 368 374 return itr; 369 375 }
+1 -1
tools/perf/util/symbol.c
··· 231 231 prev = curr; 232 232 curr = rb_entry(nd, struct symbol, rb_node); 233 233 234 - if (prev->end == prev->start && prev->end != curr->start) 234 + if (prev->end == prev->start || prev->end != curr->start) 235 235 arch__symbols__fixup_end(prev, curr); 236 236 } 237 237