packaging: add perf package for perf tool and traceevent plugins 87/213387/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 5 Sep 2019 00:14:46 +0000 (09:14 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 5 Sep 2019 00:16:45 +0000 (09:16 +0900)
Add perf package for perf tool and its traceevent plugins.

Note: they are built from below directories.
- perf: tools/perf
- traceevent plugins: tools/lib/traceevent

Change-Id: I418c52ec7dffb6b98e72e402af5bf67c3d837ba7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
packaging/linux-rpi3.spec

index 9af261819771a6af02d56b2fbe1b989b9eb13fb1..ed7aae01c0be7d852098ca6e5028bd56cbe7a6b0 100644 (file)
@@ -64,6 +64,15 @@ Provides: %{variant}-kernel-devel-uname-r = %{fullVersion}
 %description -n %{variant}-linux-kernel-devel
 This package provides kernel map and etc information.
 
+%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.
+
 %prep
 %setup -q -n linux-kernel-%{version}
 
@@ -86,6 +95,10 @@ make dtbs %{?_smp_mflags}
 # 1-4. Build modules
 make modules %{?_smp_mflags}
 
+# 1-5. Build perf
+make -s -C tools/lib/traceevent %{?_smp_mflags}
+make -s -C tools/perf %{?_smp_mflags}
+
 %install
 QA_SKIP_BUILD_ROOT="DO_NOT_WANT"; export QA_SKIP_BUILD_ROOT
 
@@ -116,6 +129,13 @@ install -m 644 rpi3/boot/bootcode.bin %{buildroot}/boot/
 install -m 644 rpi3/boot/start*.elf %{buildroot}/boot/
 install -m 644 rpi3/boot/fixup*.dat %{buildroot}/boot/
 
+# 2-5. Install perf
+install -d %{buildroot}/usr
+make -s -C tools/perf DESTDIR=%{buildroot}/usr install
+rm -rf %{buildroot}/usr/etc
+rm -rf %{buildroot}/usr/lib/debug
+rm -rf %{buildroot}/usr/share
+
 # 3-1. remove unnecessary files to prepare for devel package
 find %{_builddir}/linux-kernel-%{version} -name ".tmp_vmlinux*" -delete
 find %{_builddir}/linux-kernel-%{version} -name ".gitignore" -delete
@@ -163,3 +183,9 @@ rm -rf %{buildroot}
 /boot/bootcode.bin
 /boot/start*.elf
 /boot/fixup*.dat
+
+%files -n linux-kernel-perf
+%license COPYING
+/usr/bin/*
+/usr/libexec/*
+/usr/lib/traceevent/*