95 lines
2.7 KiB
RPMSpec
95 lines
2.7 KiB
RPMSpec
Name: oeAware-collector
|
|
Version: v1.0.0
|
|
Release: 4
|
|
Summary: %{name} provides low-overhead metrics collection capabilities, including microarchitecture, system, and kernel information.
|
|
License: MulanPSL2
|
|
URL: https://gitee.com/openeuler/%{name}
|
|
Source0: %{name}-%{version}.tar.gz
|
|
Patch1: 0001-fix-log-while-not-supporting-pmu-uncore.patch
|
|
Patch2: 0002-remove-pmu.h-and-pcerrc.h.patch
|
|
|
|
%global libkperf_name libkperf
|
|
%global libkperf_tagver v1.0.1
|
|
%global libkperf_source https://gitee.com/openeuler/libkperf.git
|
|
|
|
BuildRequires: cmake gcc-c++
|
|
BuildRequires: numactl-devel
|
|
BuildRequires: git
|
|
BuildRequires: libboundscheck
|
|
Provides: %{name}
|
|
|
|
ExclusiveArch: aarch64 x86_64
|
|
|
|
%description
|
|
%{name} provides low-overhead metrics collection capabilities, including microarchitecture, system, and kernel information.
|
|
|
|
%prep
|
|
%autosetup -p1 -n %{name}-%{version}
|
|
%ifarch aarch64
|
|
cd ./pmu/
|
|
git clone --recurse-submodules %{libkperf_source}
|
|
cd %{libkperf_name}
|
|
git checkout %{libkperf_tagver}
|
|
cd ..
|
|
mv %{libkperf_name}/ %{libkperf_name}-%{libkperf_tagver}/
|
|
cd ..
|
|
%endif
|
|
|
|
|
|
%build
|
|
# build libkperf.so
|
|
%ifarch aarch64
|
|
cd %{_builddir}/%{name}-%{version}/pmu/
|
|
mkdir -p ./3rdlib/
|
|
sh ./%{libkperf_name}-%{libkperf_tagver}/build.sh
|
|
cp -r %{libkperf_name}-%{libkperf_tagver}/output/* ./3rdlib/
|
|
%endif
|
|
|
|
# build libpmu.so
|
|
%ifarch aarch64
|
|
cd %{_builddir}/%{name}-%{version}/pmu/
|
|
mkdir build
|
|
cd build
|
|
cmake .. -DLIB_KPERF_LIBPATH=%{_builddir}/%{name}-%{version}/pmu/3rdlib/bin/ \
|
|
-DLIB_KPERF_INCPATH=%{_builddir}/%{name}-%{version}/pmu/3rdlib/include/ \
|
|
-DCMAKE_SKIP_RPATH=TRUE -WITH_DEBUG=TRUE
|
|
make
|
|
%endif
|
|
|
|
# build libthread_collector.so
|
|
cd %{_builddir}/%{name}-%{version}/thread_collector/
|
|
mkdir build
|
|
cd build
|
|
cmake .. -DCMAKE_BUILD_TYPE=Debug
|
|
make
|
|
|
|
|
|
%install
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/oeAware-plugin/collector/
|
|
%ifarch aarch64
|
|
install -b -m740 ./pmu/3rdlib/bin/*.so ${RPM_BUILD_ROOT}%{_libdir}
|
|
install -b -m740 ./pmu/build/libpmu.so ${RPM_BUILD_ROOT}%{_libdir}/oeAware-plugin/collector/
|
|
%endif
|
|
install -b -m740 ./thread_collector/build/libthread_collector.so ${RPM_BUILD_ROOT}%{_libdir}/oeAware-plugin/collector/
|
|
|
|
%files
|
|
%defattr (-, root, root)
|
|
%ifarch aarch64
|
|
%attr(0440, root, root) %{_libdir}/libkperf.so
|
|
%attr(0440, root, root) %{_libdir}/libsym.so
|
|
%endif
|
|
%attr(0440, root, root) %{_libdir}/oeAware-plugin/collector/*.so
|
|
|
|
%changelog
|
|
* Tue Apr 30 2024 zhoukaiqi <zhoukaiqi@huawei.com> - v1.0.0-4
|
|
- remove pmu.h and pcerrc.h
|
|
|
|
* Mon Apr 29 2024 zhoukaiqi <zhoukaiqi@huawei.com> - v1.0.0-3
|
|
- fix log while not supporting pmu uncore
|
|
|
|
* Thu Apr 18 2024 liuchanggeng <liuchanggeng@huawei.com> - v1.0.0-2
|
|
- add debug package
|
|
|
|
* Wed Apr 17 2024 liuchanggeng <liuchanggeng@huawei.com> - v1.0.0-1
|
|
- Package init
|