diff --git a/kernel.spec b/kernel.spec index e331fb34e28e35c3110eee10e7f58b48d7b55180..b9cc2b2e22d73ab24af959b147bda8640ce468a6 100644 --- a/kernel.spec +++ b/kernel.spec @@ -20,11 +20,13 @@ %define with_debuginfo 1 +%define with_perf 1 + %define with_source 1 Name: kernel Version: 4.19.90 -Release: %{hulkrelease}.0082 +Release: %{hulkrelease}.0083 Summary: Linux Kernel License: GPLv2 URL: http://www.kernel.org/ @@ -73,6 +75,11 @@ BuildRequires: pciutils-devel gettext BuildRequires: rpm-build, elfutils BuildRequires: numactl-devel python3-devel glibc-static python3-docutils BuildRequires: perl-generators perl(Carp) libunwind-devel gtk2-devel libbabeltrace-devel java-1.8.0-openjdk +BuildRequires: perl-generators perl(Carp) libunwind-devel gtk2-devel +%if 0%{?with_perf} +# libbabeltrace-devel >= 1.3.0 +BuildRequires: libbabeltrace-devel java-1.8.0-openjdk-devel +%endif AutoReq: no AutoProv: yes @@ -130,6 +137,7 @@ Obsoletes: kernel-tools-libs-devel This package contains the development files for the tools/ directory from the kernel source. +%if 0%{?with_perf} %package -n perf Summary: Performance monitoring for the Linux kernel %description -n perf @@ -150,6 +158,7 @@ Summary: Python bindings for apps which will manipulate perf events %description -n python3-perf A Python module that permits applications written in the Python programming language to use the interface to manipulate perf events. +%endif %package -n bpftool Summary: Inspection and simple manipulation of eBPF programs and maps @@ -189,6 +198,7 @@ package or when debugging this package.\ %files -n kernel-tools-debuginfo -f kernel-tools-debugfiles.list %{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{_bindir}/centrino-decode.*(\.debug)?|.*%{_bindir}/powernow-k8-decode.*(\.debug)?|.*%{_bindir}/cpupower.*(\.debug)?|.*%{_libdir}/libcpupower.*|.*%{_libdir}/libcpupower.*|.*%{_bindir}/turbostat.(\.debug)?|.*%{_bindir}/.*gpio.*(\.debug)?|.*%{_bindir}/.*iio.*(\.debug)?|.*%{_bindir}/tmon.*(.debug)?|XXX' -o kernel-tools-debugfiles.list} +%if 0%{?with_perf} %debuginfo_template -n perf %files -n perf-debuginfo -f perf-debugfiles.list %{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{_bindir}/perf.*(\.debug)?|.*%{_libexecdir}/perf-core/.*|.*%{_libdir}/traceevent/.*|XXX' -o perf-debugfiles.list} @@ -201,7 +211,7 @@ package or when debugging this package.\ %debuginfo_template -n python3-perf %files -n python3-perf-debuginfo -f python3-perf-debugfiles.list %{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{python3_sitearch}/perf.*(.debug)?|XXX' -o python3-perf-debugfiles.list} - +%endif %endif %prep @@ -264,7 +274,9 @@ cp -a ../linux-%{KernelVer} ../linux-%{KernelVer}-Source find ../linux-%{KernelVer}-Source -type f -name "\.*" -exec rm -rf {} \; >/dev/null %endif +%if 0%{?with_perf} cp -a tools/perf tools/python3-perf +%endif %build cd linux-%{KernelVer} @@ -298,6 +310,7 @@ make ARCH=%{Arch} modules %{?_smp_mflags} %endif ## make tools +%if 0%{?with_perf} # perf %global perf_make \ make EXTRA_CFLAGS="-Wl,-z,now -g -Wall -fstack-protector-strong -fPIC" EXTRA_PERFLIBS="-fpie -pie" %{?_smp_mflags} -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 prefix=%{_prefix} @@ -314,6 +327,7 @@ chmod +x tools/python3-perf/check-headers.sh pushd tools/perf/Documentation/ make %{?_smp_mflags} man popd +%endif # bpftool pushd tools/bpf/bpftool @@ -360,8 +374,8 @@ popd %install +%define _python_bytecompile_errors_terminate_build 0 %if 0%{?with_source} - %define _python_bytecompile_errors_terminate_build 0 mkdir -p $RPM_BUILD_ROOT/usr/src/ mv linux-%{KernelVer}-Source $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer} cp linux-%{KernelVer}/.config $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer}/ @@ -550,6 +564,7 @@ popd ## install tools +%if 0%{?with_perf} # perf # perf tool binary and supporting scripts/binaries %{perf_make} %{perf_python2} DESTDIR=%{buildroot} lib=%{_lib} install-bin install-traceevent-plugins @@ -564,11 +579,14 @@ rm -rf %{buildroot}/usr/lib/perf/include/bpf/ # python-perf extension %{perf_make} %{perf_python3} DESTDIR=%{buildroot} install-python_ext %{perf_make} %{perf_python2} DESTDIR=%{buildroot} install-python_ext +%endif -# perf man pages (note: implicit rpm magic compresses them later) install -d %{buildroot}/%{_mandir}/man1 install -pm0644 tools/kvm/kvm_stat/kvm_stat.1 %{buildroot}/%{_mandir}/man1/ +# perf man pages (note: implicit rpm magic compresses them later) +%if 0%{?with_perf} install -pm0644 tools/perf/Documentation/*.1 %{buildroot}/%{_mandir}/man1/ +%endif # bpftool pushd tools/bpf/bpftool @@ -715,6 +733,7 @@ fi /usr/src/kernels/%{KernelVer} /usr/include/* +%if 0%{?with_perf} %files -n perf %{_bindir}/perf %dir %{_libdir}/traceevent @@ -735,6 +754,7 @@ fi %files -n python3-perf %license linux-%{KernelVer}/COPYING %{python3_sitearch}/* +%endif %files -n kernel-tools -f cpupower.lang %{_bindir}/cpupower @@ -791,6 +811,10 @@ fi %changelog +* Thu Apr 27 2021 Jiachen Fan - 4.19.90-2104.21.0.0083 +- Add the option of "with_perf" +- Output jvmti plug-in as part of perf building + * Sun Apr 25 2021 Cheng Jian - 4.19.90-2104.21.0.0082 - bcache: Rewrite patch to delay to invalidate cache data - nfc: Avoid endless loops caused by repeated llcp_sock_connect()