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.14-2021-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

Pull perf tools fixes from Arnaldo Carvalho de Melo:

- Revert "perf map: Fix dso->nsinfo refcounting", this makes 'perf top'
abort, uncovering a design flaw on how namespace information is kept.
The fix for that is more than we can do right now, leave it for the
next merge window.

- Split --dump-raw-trace by AUX records for ARM's CoreSight, fixing up
the decoding of some records.

- Fix PMU alias matching.

Thanks to James Clark and John Garry for these fixes.

* tag 'perf-tools-fixes-for-v5.14-2021-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
Revert "perf map: Fix dso->nsinfo refcounting"
perf pmu: Fix alias matching
perf cs-etm: Split --dump-raw-trace by AUX records

+42 -13
+18 -2
tools/perf/util/cs-etm.c
··· 2434 2434 return 0; 2435 2435 } 2436 2436 2437 + static void dump_queued_data(struct cs_etm_auxtrace *etm, 2438 + struct perf_record_auxtrace *event) 2439 + { 2440 + struct auxtrace_buffer *buf; 2441 + unsigned int i; 2442 + /* 2443 + * Find all buffers with same reference in the queues and dump them. 2444 + * This is because the queues can contain multiple entries of the same 2445 + * buffer that were split on aux records. 2446 + */ 2447 + for (i = 0; i < etm->queues.nr_queues; ++i) 2448 + list_for_each_entry(buf, &etm->queues.queue_array[i].head, list) 2449 + if (buf->reference == event->reference) 2450 + cs_etm__dump_event(etm, buf); 2451 + } 2452 + 2437 2453 static int cs_etm__process_auxtrace_event(struct perf_session *session, 2438 2454 union perf_event *event, 2439 2455 struct perf_tool *tool __maybe_unused) ··· 2482 2466 cs_etm__dump_event(etm, buffer); 2483 2467 auxtrace_buffer__put_data(buffer); 2484 2468 } 2485 - } 2469 + } else if (dump_trace) 2470 + dump_queued_data(etm, &event->auxtrace); 2486 2471 2487 2472 return 0; 2488 2473 } ··· 3059 3042 3060 3043 if (dump_trace) { 3061 3044 cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu); 3062 - return 0; 3063 3045 } 3064 3046 3065 3047 err = cs_etm__synth_events(etm, session);
-2
tools/perf/util/map.c
··· 192 192 if (!(prot & PROT_EXEC)) 193 193 dso__set_loaded(dso); 194 194 } 195 - 196 - nsinfo__put(dso->nsinfo); 197 195 dso->nsinfo = nsi; 198 196 199 197 if (build_id__is_defined(bid))
+24 -9
tools/perf/util/pmu.c
··· 742 742 return perf_pmu__find_map(NULL); 743 743 } 744 744 745 - static bool perf_pmu__valid_suffix(char *pmu_name, char *tok) 745 + /* 746 + * Suffix must be in form tok_{digits}, or tok{digits}, or same as pmu_name 747 + * to be valid. 748 + */ 749 + static bool perf_pmu__valid_suffix(const char *pmu_name, char *tok) 746 750 { 747 - char *p; 751 + const char *p; 748 752 749 753 if (strncmp(pmu_name, tok, strlen(tok))) 750 754 return false; ··· 757 753 if (*p == 0) 758 754 return true; 759 755 760 - if (*p != '_') 761 - return false; 756 + if (*p == '_') 757 + ++p; 762 758 763 - ++p; 764 - if (*p == 0 || !isdigit(*p)) 765 - return false; 759 + /* Ensure we end in a number */ 760 + while (1) { 761 + if (!isdigit(*p)) 762 + return false; 763 + if (*(++p) == 0) 764 + break; 765 + } 766 766 767 767 return true; 768 768 } ··· 797 789 * match "socket" in "socketX_pmunameY" and then "pmuname" in 798 790 * "pmunameY". 799 791 */ 800 - for (; tok; name += strlen(tok), tok = strtok_r(NULL, ",", &tmp)) { 792 + while (1) { 793 + char *next_tok = strtok_r(NULL, ",", &tmp); 794 + 801 795 name = strstr(name, tok); 802 - if (!name || !perf_pmu__valid_suffix((char *)name, tok)) { 796 + if (!name || 797 + (!next_tok && !perf_pmu__valid_suffix(name, tok))) { 803 798 res = false; 804 799 goto out; 805 800 } 801 + if (!next_tok) 802 + break; 803 + tok = next_tok; 804 + name += strlen(tok); 806 805 } 807 806 808 807 res = true;