From 8026fe69cad229af6d7577333858085b86ec3457 Mon Sep 17 00:00:00 2001 From: Ruidong Tian Date: Fri, 24 Feb 2023 15:06:30 +0800 Subject: [PATCH] spec: add perf/coresight support perf/coresight use third lib named opencsd to decode perf.data which collected from armv8/v9 ETM/ETE. This patch consists of 3 parts: 1. Add CORESIGHT=1 flag to enable perf collect Arm Coresight data. 2. Add opencsd && opencsd-devel BuildRequires to build perf with CORESIGHT=1 3. Add opencsd Requires to support perf decode Coresight data. Signed-off-by: Ruidong Tian Reviewed-by: Qiao Ma Link: https://gitee.com/src-anolis-sig/cloud-kernel/pulls/3 --- kernel.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index 1352745..b212ffc 100644 --- a/kernel.spec +++ b/kernel.spec @@ -198,6 +198,10 @@ BuildRequires: sparse BuildRequires: zlib-devel binutils-devel newt-devel perl(ExtUtils::Embed) bison flex xz-devel BuildRequires: audit-libs-devel BuildRequires: java-devel +%ifarch aarch64 +BuildRequires: opencsd +BuildRequires: opencsd-devel +%endif %ifnarch s390x BuildRequires: numactl-devel %endif @@ -352,6 +356,9 @@ It provides the kernel source files common to all builds. Summary: Performance monitoring for the Linux kernel Group: Development/System Requires: bzip2 +%ifarch aarch64 +Requires: opencsd +%endif License: GPLv2 %description -n perf This package contains the perf tool, which enables performance monitoring @@ -1192,8 +1199,14 @@ BuildKernel %make_target %kernel_image debug BuildKernel %make_target %kernel_image %endif +%ifarch aarch64 +%define perf_coresight CORESIGHT=1 +%else +%define perf_coresight CORESIGHT=0 +%endif + %global perf_make \ - make EXTRA_CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="%{__global_ldflags}" -C tools/perf V=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 prefix=%{_prefix} PYTHON=%{__python3} + make EXTRA_CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="%{__global_ldflags}" -C tools/perf V=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 %{perf_coresight} prefix=%{_prefix} PYTHON=%{__python3} %if %{with_perf} # perf # make sure check-headers.sh is executable -- Gitee