%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}
# 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
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
/boot/bootcode.bin
/boot/start*.elf
/boot/fixup*.dat
+
+%files -n linux-kernel-perf
+%license COPYING
+/usr/bin/*
+/usr/libexec/*
+/usr/lib/traceevent/*