libkperf/libkperf.spec
2024-11-19 20:29:04 +08:00

100 lines
3.6 KiB
RPMSpec

Name: libkperf
Version: v1.2
Release: 2
Summary: Accelerated perf acquisition and symbol resolution
License: Mulan PSL v2
URL: https://gitee.com/openeuler/libkperf
Source0: %{name}-%{version}.tar.gz
Patch1: 0001-update-python-modules-_libkperf-Symbol.py.patch
Patch2: 0002-update-docs.patch
Patch3: 0003-fix-after-pmuopen-delete-evtList-exception.patch
Patch4: 0004-Delete-the-repeated-judgement-on-formatPath.patch
Patch5: 0005-pmu-event.patch
Patch6: 0006-adapt-events.patch
Patch7: 0007-update-python-modules-_libkperf-Pmu.py.patch
Patch8: 0008-.patch
Patch9: 0009-adapt-gcc-4.8.5.patch
Patch10: 0010-fix-spelling-error.patch
Patch11: 0011-add-perrno-operation-not-supported.patch
Patch12: 0012-UT-SpeProcCollectSubProc.patch
Patch13: 0013-simplify-CoreSpeData-call-by-removing-redundant-buf-.patch
Patch14: 0014-Update-Details.md.patch
Patch15: 0015-cleanup-remove-unused-variable-childPidList.patch
Patch16: 0016-update-include-pmu.h.patch
Patch17: 0017-Delete-unused-import-packages-and-fix-spelling-mista.patch
Patch18: 0018-Fixed-memory-allocation-check-in-symbol_resolve.cpp-.patch
Patch19: 0019-update-python-modules-kperf-pmu.py.patch
Patch20: 0020-update-pmu-spe.h.patch
BuildRequires: gcc-c++ make cmake numactl-devel
ExclusiveArch: aarch64
%description
Implement a low overhead pmu collection library, providing abstract interfaces for counting, sampling and symbol resolve.
%package devel
Summary: Development package for building Applications that use libkperf
License: Mulan PSL v2
Requires: %{name} = %{version}-%{release}
%description devel
Development package for libkperf library calls
%prep
%setup -q
%autosetup -n %{name}-%{version} -p1
wget https://gitee.com/openeuler/elfin-parser/repository/archive/v1.0-h1.tar.gz
tar -xvf v1.0-h1.tar.gz
cp -r elfin-parser-v1.0-h1/* third_party/elfin-parser/
%build
if [ -d %{buildroot} ];then
rm -rf %{buildroot}
fi
mkdir %{buildroot}
%install
./build.sh install_path=%{buildroot} build_type=DEBUG
if [ ! -d %{buildroot}/%{_libdir} ];then
mkdir -p %{buildroot}/%{_libdir}
fi
mv %{buildroot}/lib/libsym.so %{buildroot}/%{_libdir}/libsym.so.%{version}
mv %{buildroot}/lib/libkperf.so %{buildroot}/%{_libdir}/libkperf.so.%{version}
ln -s %{buildroot}/%{_libdir}/libsym.so.%{version} %{buildroot}/%{_libdir}/libsym.so
ln -s %{buildroot}/%{_libdir}/libkperf.so.%{version} %{buildroot}/%{_libdir}/libkperf.so
if [ ! -d %{buildroot}/%{_includedir}/libkperf ];then
mkdir -p %{buildroot}/%{_includedir}/libkperf
fi
mv %{buildroot}/include/symbol.h %{buildroot}/%{_includedir}/libkperf/
mv %{buildroot}/include/pmu.h %{buildroot}/%{_includedir}/libkperf/
mv %{buildroot}/include/pcerrc.h %{buildroot}/%{_includedir}/libkperf/
%check
%files
%license LICENSE
%{_libdir}/libkperf.so.%{version} %attr(755,root,root)
%{_libdir}/libsym.so.%{version} %attr(755,root,root)
%files devel
%license LICENSE
%{_libdir}/libkperf.so %attr(755,root,root)
%{_libdir}/libsym.so %attr(755,root,root)
%{_includedir}/libkperf/symbol.h %attr(644,root,root)
%{_includedir}/libkperf/pmu.h %attr(644,root,root)
%{_includedir}/libkperf/pcerrc.h %attr(644,root,root)
%files debuginfo
%{_libdir}/libkperf.so %attr(755,root,root)
%{_libdir}/libsym.so %attr(755,root,root)
%changelog
* Tue Nov 19 2024 echo <2220386943@qq.com> - 1.2-2
- update version to 1.2-2
- support new create thread
- description of supplementary documents
- support event grouping
- add the mangleName in symbol.h
* Fri Aug 9 2024 echo <2220386943@qq.com> - 1.1-1
- Package init