Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perf for openSUSE:Factory checked in at 2021-05-15 23:16:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perf (Old) and /work/SRC/openSUSE:Factory/.perf.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perf" Sat May 15 23:16:09 2021 rev:59 rq:892958 version:MACRO Changes: -------- --- /work/SRC/openSUSE:Factory/perf/perf.changes 2021-04-26 16:40:21.198147394 +0200 +++ /work/SRC/openSUSE:Factory/.perf.new.2988/perf.changes 2021-05-15 23:17:08.796511373 +0200 @@ -1,0 +2,6 @@ +Sat May 8 00:01:31 UTC 2021 - Tony Jones <to...@suse.com> + +- Switch to using libtraceevent shared library package. + New patch: perf-tools-enable-libtraceevent-dynamic-linking.patch + +------------------------------------------------------------------- New: ---- perf-tools-enable-libtraceevent-dynamic-linking.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perf.spec ++++++ --- /var/tmp/diff_new_pack.vEvAGx/_old 2021-05-15 23:17:09.188509842 +0200 +++ /var/tmp/diff_new_pack.vEvAGx/_new 2021-05-15 23:17:09.188509842 +0200 @@ -49,6 +49,7 @@ BuildRequires: libcap-devel BuildRequires: libdw-devel BuildRequires: libelf-devel +BuildRequires: libtraceevent-devel BuildRequires: libzstd-devel BuildRequires: newt-devel BuildRequires: openssl-devel @@ -63,6 +64,8 @@ BuildRequires: libnuma-devel %endif +Patch1: perf-tools-enable-libtraceevent-dynamic-linking.patch + %description This package provides a userspace tool 'perf', which monitors performance for either unmodified binaries or the entire system. It requires a Linux kernel @@ -84,7 +87,8 @@ cd tools/perf export WERROR=0 # PASS rpm optflags as EXTRA_FLAGS, passing as CFLAGS overrides and breaks build -make %{?_smp_mflags} -f Makefile.perf PYTHON=python3 \ +make %{?_smp_mflags} -f Makefile.perf V=1 PYTHON=python3 \ + LIBTRACEEVENT_DYNAMIC=1 \ EXTRA_CFLAGS="%{optflags}" \ ASCIIDOC8=1 USE_ASCIIDOCTOR=1 CORESIGHT=1 GTK2=1 \ prefix=%{_prefix} \ @@ -98,6 +102,7 @@ cd tools/perf export WERROR=0 make -f Makefile.perf V=1 PYTHON=python3 EXTRA_CFLAGS="%{optflags}" \ + LIBTRACEEVENT_DYNAMIC=1 \ ASCIIDOC8=1 USE_ASCIIDOCTOR=1 CORESIGHT=1 GTK2=1 \ prefix=%{_prefix} \ libdir=%{_libdir} \ @@ -114,6 +119,9 @@ mkdir -p %{buildroot}%{_datadir}/bash-completion/completions/ mv %{buildroot}%{_sysconfdir}/bash_completion.d/perf %{buildroot}%{_datadir}/bash-completion/completions/ +# temp workaround as perf Makefile is still installing plugins even with LIBTRACEEVENT_DYNAMIC=1 +rm -rf %{buildroot}/%{_libdir}/traceevent + %files %license COPYING %doc CREDITS README tools/perf/design.txt @@ -123,11 +131,6 @@ %{_bindir}/perf %{_bindir}/trace %{_libdir}/libperf-gtk.so -%ifnarch armv7l -%dir %{_libdir}/traceevent -%dir %{_libdir}/traceevent/plugins -%{_libdir}/traceevent/plugins/plugin_*.so -%endif %{_prefix}/lib/%{name}-core %{_datadir}/bash-completion/completions/perf %{_datadir}/%{name}-core ++++++ perf-tools-enable-libtraceevent-dynamic-linking.patch ++++++ From: Michael Petlan <mpet...@redhat.com> Date: Wed, 28 Apr 2021 11:20:23 +0200 Subject: perf tools: Enable libtraceevent dynamic linking Git-commit: 56d32d4cac645bac05fa70d935fa5040e3ab6bb3 Patch-mainline: v5.13-rc1 Currently we support only static linking with kernel's libtraceevent (tools/lib/traceevent). This patch adds libtraceevent package detection and support to link perf with it dynamically. The libtraceevent package status is displayed with: $ make VF=1 LIBTRACEEVENT_DYNAMIC=1 ... ... libtraceevent: [ on ] Default behavior remains the same (static linking). Committer testing: $ make LIBTRACEEVENT_DYNAMIC=1 VF=1 O=/tmp/build/perf -C tools/perf install-bin |& grep traceevent Makefile.config:1090: *** Error: No libtraceevent devel library found, please install libtraceevent-devel. Stop. $ Signed-off-by: Michael Petlan <mpet...@redhat.com> Tested-by: Arnaldo Carvalho de Melo <a...@redhat.com> Cc: Jiri Olsa <jo...@redhat.com> LPU-Reference: 20210428092023.4009-1-mpet...@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com> Signed-off-by: Tony Jones <to...@suse.de> --- tools/build/Makefile.feature | 1 + tools/build/feature/Makefile | 4 ++++ tools/build/feature/test-libtraceevent.c | 12 ++++++++++++ tools/perf/Makefile.config | 9 +++++++++ tools/perf/Makefile.perf | 8 ++++++-- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 74e255d58d8d..b3221a43fa65 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -52,6 +52,7 @@ FEATURE_TESTS_BASIC := \ libpython-version \ libslang \ libslang-include-subdir \ + libtraceevent \ libcrypto \ libunwind \ pthread-attr-setaffinity-np \ diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 3e55edb3ea54..ec203e28407f 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -36,6 +36,7 @@ FILES= \ test-libpython-version.bin \ test-libslang.bin \ test-libslang-include-subdir.bin \ + test-libtraceevent.bin \ test-libcrypto.bin \ test-libunwind.bin \ test-libunwind-debug-frame.bin \ @@ -196,6 +197,9 @@ $(OUTPUT)test-libslang.bin: $(OUTPUT)test-libslang-include-subdir.bin: $(BUILD) -lslang +$(OUTPUT)test-libtraceevent.bin: + $(BUILD) -ltraceevent + $(OUTPUT)test-libcrypto.bin: $(BUILD) -lcrypto diff --git a/tools/build/feature/test-libtraceevent.c b/tools/build/feature/test-libtraceevent.c new file mode 100644 index 000000000000..416b11ffd4b4 --- /dev/null +++ b/tools/build/feature/test-libtraceevent.c @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 +#include <traceevent/trace-seq.h> + +int main(void) +{ + int rv = 0; + struct trace_seq s; + trace_seq_init(&s); + rv += !(s.state == TRACE_SEQ__GOOD); + trace_seq_destroy(&s); + return rv; +} diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 3514fe956ed1..99c73a7b6a26 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -1079,6 +1079,15 @@ ifdef LIBPFM4 endif endif +ifdef LIBTRACEEVENT_DYNAMIC + $(call feature_check,libtraceevent) + ifeq ($(feature-libtraceevent), 1) + EXTLIBS += -ltraceevent + else + dummy := $(error Error: No libtraceevent devel library found, please install libtraceevent-devel); + endif +endif + # Among the variables below, these: # perfexecdir # perf_include_dir diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 6240fbb1646e..e47f04e5b51e 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -128,6 +128,8 @@ include ../scripts/utilities.mak # # Define BUILD_BPF_SKEL to enable BPF skeletons # +# Define LIBTRACEEVENT_DYNAMIC to enable libtraceevent dynamic linking +# # As per kernel Makefile, avoid funny character set dependencies unexport LC_ALL @@ -310,7 +312,6 @@ endif LIBTRACEEVENT = $(TE_PATH)libtraceevent.a export LIBTRACEEVENT - LIBTRACEEVENT_DYNAMIC_LIST = $(PLUGINS_PATH)libtraceevent-dynamic-list # @@ -375,12 +376,15 @@ endif export PERL_PATH -PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) $(LIBPERF) +PERFLIBS = $(LIBAPI) $(LIBSUBCMD) $(LIBPERF) ifndef NO_LIBBPF ifndef LIBBPF_DYNAMIC PERFLIBS += $(LIBBPF) endif endif +ifndef LIBTRACEEVENT_DYNAMIC + PERFLIBS += $(LIBTRACEEVENT) +endif # We choose to avoid "if .. else if .. else .. endif endif" # because maintaining the nesting to match is a pain. If