From cdfa3fa001d29a0e4131c358c8ac4e20359338b7 Mon Sep 17 00:00:00 2001 From: Michel Lind Date: Nov 20 2024 19:50:21 +0000 Subject: Initial Hyperscale package Signed-off-by: Michel Lind --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e751f71 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/perf-6.9.0.tar.xz diff --git a/perf.spec b/perf.spec new file mode 100644 index 0000000..0a52beb --- /dev/null +++ b/perf.spec @@ -0,0 +1,184 @@ +# TODO: reenable once we get a basic build working +# https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck +# see build and install -- CXXFLAGS and LDFLAGS are enough +# still need to debug +#undefine _auto_set_build_flags + +%bcond_without manpages + +%if 0%{?facebook} +%bcond_with perl +%else +%bcond_without perl +%endif + +Name: perf +Version: 6.9.0 +Release: %autorelease +Summary: Performance monitoring for the Linux kernel + +License: GPL-2.0-only +URL: https://perf.wiki.kernel.org/ +Source: https://mirrors.edge.kernel.org/pub/linux/kernel/tools/perf/v%{version}/perf-%{version}.tar.xz + +BuildRequires: make +BuildRequires: bison +BuildRequires: flex +BuildRequires: clang +BuildRequires: gcc +BuildRequires: llvm-devel +BuildRequires: binutils-devel +BuildRequires: capstone-devel +BuildRequires: elfutils-devel +BuildRequires: elfutils-libelf-devel +BuildRequires: java-devel +BuildRequires: libbabeltrace-devel +BuildRequires: libcap-devel +BuildRequires: libtraceevent-devel +BuildRequires: libunwind-devel +BuildRequires: libbabeltrace-devel +BuildRequires: libpfm-devel +BuildRequires: libstdc++-devel +BuildRequires: libunwind-devel +BuildRequires: numactl-devel +BuildRequires: python-devel +BuildRequires: python3dist(setuptools) +BuildRequires: openssl-devel +%if %{with perl} +BuildRequires: perl-devel +BuildRequires: perl-interpreter +BuildRequires: perl-ExtUtils-Embed +%endif +BuildRequires: systemtap-sdt-devel +BuildRequires: slang-devel +BuildRequires: zlib-devel +%if %{with manpages} +BuildRequires: asciidoc +BuildRequires: xmlto +%endif + +%description +This package contains the perf tool, which enables performance monitoring +of the Linux kernel. + + +%package -n libperf +Summary: The perf library from kernel source + +%description -n libperf +This package contains the kernel source perf library. + + +%package -n libperf-devel +Summary: Development files for the perf library from kernel source +Requires: libperf%{?_isa} = %{version}-%{release} + +%description -n libperf-devel +This package includes libraries and header files needed for development +of applications which use perf library from kernel source. + + +%package -n python3-perf +Summary: Python bindings for apps which will manipulate perf events + +%description -n python3-perf +The python3-perf package contains a module that permits applications +written in the Python programming language to use the interface +to manipulate perf events. + + +%prep +%autosetup + + +%build +unset CXXFLAGS +unset LDFLAGS + +# /usr/bin/ld: perf-in.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE +#global optflags %{optflags} -fPIE + +%make_build -C tools/perf + +%make_build -C tools/lib/perf + +%install +unset CXXFLAGS +unset LDFLAGS + +%make_install -C tools/perf \ + prefix=%{_prefix} + +%make_install -C tools/lib/perf \ + prefix=%{_prefix} + +# python-perf extension +%make_install -C tools/perf \ + prefix=%{_prefix} \ + install-python_ext + +# remove the 'trace' symlink. +rm %{buildroot}%{_bindir}/trace + +rm -f %{buildroot}%{_libdir}/libperf.a + +%if %{without perl} +rm %{buildroot}%{_libexecdir}/perf-core/tests/shell/common/*.pl +%endif + +# TODO - make this customizable upstream +mkdir -p %{buildroot}%{bash_completions_dir} +mv %{buildroot}%{_sysconfdir}/bash_completion.d/perf %{buildroot}%{bash_completions_dir}/ +rmdir %{buildroot}%{_sysconfdir}/bash_completion.d +rmdir %{buildroot}%{_sysconfdir}/ + + +%files +# license add-license-file-here +%doc tools/perf/CREDITS +%{_bindir}/perf +%{_datadir}/perf-core +# tips.txt is both human readable and used by perf +# and really hard to override +%{_docdir}/perf-tip +%dir %{_includedir}/perf +%{_includedir}/perf/perf_dlfilter.h +%{_libdir}/libperf-jvmti.so +%{_libexecdir}/perf-core +%{bash_completions_dir}/perf +%if %{with manpages} +%{_mandir}/man1/perf*.1* +%endif + +%files -n libperf +%{_libdir}/libperf.so.0 +%{_libdir}/libperf.so.0.0.1 + +%files -n libperf-devel +%{_libdir}/libperf.so +%{_libdir}/pkgconfig/libperf.pc +%{_includedir}/internal/*.h +%{_includedir}/perf/bpf_perf.h +%{_includedir}/perf/core.h +%{_includedir}/perf/cpumap.h +%{_includedir}/perf/event.h +%{_includedir}/perf/evlist.h +%{_includedir}/perf/evsel.h +%{_includedir}/perf/mmap.h +%{_includedir}/perf/threadmap.h +%{_mandir}/man3/libperf.3.gz +%{_mandir}/man7/libperf-counting.7.gz +%{_mandir}/man7/libperf-sampling.7.gz +%{_docdir}/libperf/examples/sampling.c +%{_docdir}/libperf/examples/counting.c +%{_docdir}/libperf/html/libperf.html +%{_docdir}/libperf/html/libperf-counting.html +%{_docdir}/libperf/html/libperf-sampling.html + +%files -n python3-perf +%{python3_sitearch}/* + + +%changelog +%autochangelog +- diff --git a/sources b/sources new file mode 100644 index 0000000..fb4ce3c --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (perf-6.9.0.tar.xz) = b44f5575e3ea09f52ec2cf22cf3123ab366ae470cef0d83e36212a03e3fd897903948eb0eb72a93b5a5d8902a9aca1dfc1bd3238e573b24ec3f935e23de8a202