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.15-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

Pull perf tools fixes from Arnaldo Carvalho de Melo:

- Fix 'perf test evsel' build error on !x86 architectures

- Fix libperf's test_stat_cpu mixup of CPU numbers and CPU indexes

- Output offsets for decompressed records, not just useless zeros

* tag 'perf-tools-fixes-for-v5.15-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
libperf tests: Fix test_stat_cpu
libperf test evsel: Fix build error on !x86 architectures
perf report: Output non-zero offset for decompressed records

+9 -8
+3 -3
tools/lib/perf/tests/test-evlist.c
··· 40 40 .type = PERF_TYPE_SOFTWARE, 41 41 .config = PERF_COUNT_SW_TASK_CLOCK, 42 42 }; 43 - int err, cpu, tmp; 43 + int err, idx; 44 44 45 45 cpus = perf_cpu_map__new(NULL); 46 46 __T("failed to create cpus", cpus); ··· 70 70 perf_evlist__for_each_evsel(evlist, evsel) { 71 71 cpus = perf_evsel__cpus(evsel); 72 72 73 - perf_cpu_map__for_each_cpu(cpu, tmp, cpus) { 73 + for (idx = 0; idx < perf_cpu_map__nr(cpus); idx++) { 74 74 struct perf_counts_values counts = { .val = 0 }; 75 75 76 - perf_evsel__read(evsel, cpu, 0, &counts); 76 + perf_evsel__read(evsel, idx, 0, &counts); 77 77 __T("failed to read value for evsel", counts.val != 0); 78 78 } 79 79 }
+4 -3
tools/lib/perf/tests/test-evsel.c
··· 22 22 .type = PERF_TYPE_SOFTWARE, 23 23 .config = PERF_COUNT_SW_CPU_CLOCK, 24 24 }; 25 - int err, cpu, tmp; 25 + int err, idx; 26 26 27 27 cpus = perf_cpu_map__new(NULL); 28 28 __T("failed to create cpus", cpus); ··· 33 33 err = perf_evsel__open(evsel, cpus, NULL); 34 34 __T("failed to open evsel", err == 0); 35 35 36 - perf_cpu_map__for_each_cpu(cpu, tmp, cpus) { 36 + for (idx = 0; idx < perf_cpu_map__nr(cpus); idx++) { 37 37 struct perf_counts_values counts = { .val = 0 }; 38 38 39 - perf_evsel__read(evsel, cpu, 0, &counts); 39 + perf_evsel__read(evsel, idx, 0, &counts); 40 40 __T("failed to read value for evsel", counts.val != 0); 41 41 } 42 42 ··· 148 148 __T("failed to mmap evsel", err == 0); 149 149 150 150 pc = perf_evsel__mmap_base(evsel, 0, 0); 151 + __T("failed to get mmapped address", pc); 151 152 152 153 #if defined(__i386__) || defined(__x86_64__) 153 154 __T("userspace counter access not supported", pc->cap_user_rdpmc);
+2 -2
tools/perf/util/session.c
··· 2116 2116 static int __perf_session__process_decomp_events(struct perf_session *session) 2117 2117 { 2118 2118 s64 skip; 2119 - u64 size, file_pos = 0; 2119 + u64 size; 2120 2120 struct decomp *decomp = session->decomp_last; 2121 2121 2122 2122 if (!decomp) ··· 2132 2132 size = event->header.size; 2133 2133 2134 2134 if (size < sizeof(struct perf_event_header) || 2135 - (skip = perf_session__process_event(session, event, file_pos)) < 0) { 2135 + (skip = perf_session__process_event(session, event, decomp->file_pos)) < 0) { 2136 2136 pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n", 2137 2137 decomp->file_pos + decomp->head, event->header.size, event->header.type); 2138 2138 return -EINVAL;