Skip to content

Commit 2a987e6

Browse files
committed
Merge tag 'perf-tools-fixes-for-v5.16-2021-12-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix SMT detection fast read path on sysfs. - Fix memory leaks when processing feature headers in perf.data files. - Fix 'Simple expression parser' 'perf test' on arch without CPU die topology info, such as s/390. - Fix building perf with BUILD_BPF_SKEL=1. - Fix 'perf bench' by reverting "perf bench: Fix two memory leaks detected with ASan". - Fix itrace space allowed for new attributes in 'perf script'. - Fix the build feature detection fast path, that was always failing on systems with python3 development packages, speeding up the build. - Reset shadow counts before loading, fixing metrics using duration_time. - Sync more kernel headers changed by the new futex_waitv syscall: s390 and powerpc. * tag 'perf-tools-fixes-for-v5.16-2021-12-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf bpf_skel: Do not use typedef to avoid error on old clang perf bpf: Fix building perf with BUILD_BPF_SKEL=1 by default in more distros perf header: Fix memory leaks when processing feature headers perf test: Reset shadow counts before loading perf test: Fix 'Simple expression parser' test on arch without CPU die topology info tools build: Remove needless libpython-version feature check that breaks test-all fast path perf tools: Fix SMT detection fast read path tools headers UAPI: Sync powerpc syscall table file changed by new futex_waitv syscall perf inject: Fix itrace space allowed for new attributes tools headers UAPI: Sync s390 syscall table file changed by new futex_waitv syscall Revert "perf bench: Fix two memory leaks detected with ASan"
2 parents 9572324 + 5a89753 commit 2a987e6

File tree

17 files changed

+47
-60
lines changed

17 files changed

+47
-60
lines changed

tools/build/Makefile.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ FEATURE_TESTS_BASIC := \
4848
numa_num_possible_cpus \
4949
libperl \
5050
libpython \
51-
libpython-version \
5251
libslang \
5352
libslang-include-subdir \
5453
libtraceevent \

tools/build/feature/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ FILES= \
3232
test-numa_num_possible_cpus.bin \
3333
test-libperl.bin \
3434
test-libpython.bin \
35-
test-libpython-version.bin \
3635
test-libslang.bin \
3736
test-libslang-include-subdir.bin \
3837
test-libtraceevent.bin \
@@ -227,9 +226,6 @@ $(OUTPUT)test-libperl.bin:
227226
$(OUTPUT)test-libpython.bin:
228227
$(BUILD) $(FLAGS_PYTHON_EMBED)
229228

230-
$(OUTPUT)test-libpython-version.bin:
231-
$(BUILD)
232-
233229
$(OUTPUT)test-libbfd.bin:
234230
$(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
235231

tools/build/feature/test-all.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
# include "test-libpython.c"
1515
#undef main
1616

17-
#define main main_test_libpython_version
18-
# include "test-libpython-version.c"
19-
#undef main
20-
2117
#define main main_test_libperl
2218
# include "test-libperl.c"
2319
#undef main
@@ -177,7 +173,6 @@
177173
int main(int argc, char *argv[])
178174
{
179175
main_test_libpython();
180-
main_test_libpython_version();
181176
main_test_libperl();
182177
main_test_hello();
183178
main_test_libelf();

tools/build/feature/test-libpython-version.c

Lines changed: 0 additions & 11 deletions
This file was deleted.

tools/perf/Makefile.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,6 @@ endif
271271

272272
FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
273273
FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
274-
FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS)
275-
FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS)
276274

277275
FEATURE_CHECK_LDFLAGS-libaio = -lrt
278276

tools/perf/arch/powerpc/entry/syscalls/syscall.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,3 +528,4 @@
528528
446 common landlock_restrict_self sys_landlock_restrict_self
529529
# 447 reserved for memfd_secret
530530
448 common process_mrelease sys_process_mrelease
531+
449 common futex_waitv sys_futex_waitv

tools/perf/arch/s390/entry/syscalls/syscall.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,3 +451,4 @@
451451
446 common landlock_restrict_self sys_landlock_restrict_self sys_landlock_restrict_self
452452
# 447 reserved for memfd_secret
453453
448 common process_mrelease sys_process_mrelease sys_process_mrelease
454+
449 common futex_waitv sys_futex_waitv sys_futex_waitv

tools/perf/bench/sched-messaging.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,6 @@ static unsigned int group(pthread_t *pth,
223223
snd_ctx->out_fds[i] = fds[1];
224224
if (!thread_mode)
225225
close(fds[0]);
226-
227-
free(ctx);
228226
}
229227

230228
/* Now we have all the fds, fork the senders */
@@ -241,8 +239,6 @@ static unsigned int group(pthread_t *pth,
241239
for (i = 0; i < num_fds; i++)
242240
close(snd_ctx->out_fds[i]);
243241

244-
free(snd_ctx);
245-
246242
/* Return number of children to reap */
247243
return num_fds * 2;
248244
}

tools/perf/builtin-inject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ static int __cmd_inject(struct perf_inject *inject)
820820
inject->tool.ordered_events = true;
821821
inject->tool.ordering_requires_timestamps = true;
822822
/* Allow space in the header for new attributes */
823-
output_data_offset = 4096;
823+
output_data_offset = roundup(8192 + session->header.data_offset, 4096);
824824
if (inject->strip)
825825
strip_init(inject);
826826
}

tools/perf/tests/expr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u
169169
TEST_ASSERT_VAL("#num_dies", expr__parse(&num_dies, ctx, "#num_dies") == 0);
170170
TEST_ASSERT_VAL("#num_cores >= #num_dies", num_cores >= num_dies);
171171
TEST_ASSERT_VAL("#num_packages", expr__parse(&num_packages, ctx, "#num_packages") == 0);
172-
TEST_ASSERT_VAL("#num_dies >= #num_packages", num_dies >= num_packages);
172+
173+
if (num_dies) // Some platforms do not have CPU die support, for example s390
174+
TEST_ASSERT_VAL("#num_dies >= #num_packages", num_dies >= num_packages);
173175

174176
/*
175177
* Source count returns the number of events aggregating in a leader

0 commit comments

Comments
 (0)