Add perf package build 33/252833/2
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Tue, 2 Feb 2021 18:16:12 +0000 (19:16 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 3 Feb 2021 03:45:50 +0000 (03:45 +0000)
Add build of the perf performance monitoring tool package.
Based on spec from the platform/kernel/linux-rpi3 kernel tree.

Change-Id: Iedee81ac5f81f63c40ed6a379f2fca3f793c4d8b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
packaging/linux-amlogic.spec

index fb61b40e8cb1226fde8cd721f70626c79e427f99..2aef3dc3ad19b367386aa48f0b00fe98de4cca24 100644 (file)
@@ -34,6 +34,12 @@ BuildRequires: module-init-tools
 BuildRequires: bison
 BuildRequires: flex
 BuildRequires: libopenssl1.1-devel
+BuildRequires: libunwind-devel
+BuildRequires: libdw-devel
+BuildRequires: libelf-devel
+BuildRequires: elfutils
+BuildRequires: xz-devel
+BuildRequires: binutils-devel
 
 %description
 The Linux Kernel, the operating system core itself
@@ -115,6 +121,15 @@ Provides: linux-kernel-devel-amlogic-kvim = %{version}-%{CHIPSET}-kvim
 %description -n linux-kernel-devel-amlogic-kvim
 This package provides kernel map and etc information.
 %endif
+
+%package -n linux-kernel-perf
+Summary: The perf performance counter tool
+Group: System/Kernel
+Provides: perf = %{fullVersion}
+
+%description -n linux-kernel-perf
+This package provides the "perf" tool that can be used to monitor performance
+counter events as well as various kernel internal events.
 ## 0. End   of Packages lists
 
 %prep
@@ -212,6 +227,14 @@ mv %{_builddir}/uapi-headers/usr %{buildroot}
 mv %{_builddir}/boot/* %{buildroot}/boot
 mv %{_builddir}/lib %{buildroot}
 %endif
+
+# 2-3. Install perf
+install -d %{buildroot}/usr
+make -s -C tools/perf EXTRA_CFLAGS="-fPIE -rdynamic" DESTDIR=%{buildroot}/usr install NO_LIBPERL=1
+rm -rf %{buildroot}/usr/etc
+rm -rf %{buildroot}/usr/lib/debug
+rm -rf %{buildroot}/usr/lib/perf
+rm -rf %{buildroot}/usr/share
 ## 2. End   of install steps
 
 %clean
@@ -252,4 +275,10 @@ rm -rf %{_builddir}/lib
 %files -n linux-kernel-devel-amlogic-kvim
 /boot/%{TARGET_VIMS}/kernel/*
 %endif
+
+%files -n linux-kernel-perf
+%license COPYING
+/usr/bin/*
+/usr/libexec/*
+/usr/lib/traceevent/*
 ## 3. End   of rpm pack