From 28126eebbd70abed71e305acb1041ece1ff6fdf8 Mon Sep 17 00:00:00 2001 From: joshua_hu Date: Tue, 18 Feb 2025 17:12:56 +0800 Subject: [PATCH] update perf-prof for OCS --- packages/perf-prof.spec | 56 ++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/packages/perf-prof.spec b/packages/perf-prof.spec index 7ca9624..cc7d0ab 100644 --- a/packages/perf-prof.spec +++ b/packages/perf-prof.spec @@ -1,37 +1,31 @@ -%define release 1%{?dist} %define TRACEEVENT_DIR /usr/lib64/%{name}-traceevent %define PLUGINS_DIR %{TRACEEVENT_DIR}/plugins %define has_btf %(test -f /sys/kernel/btf/vmlinux && echo 1 || echo 0) - %undefine _disable_source_fetch %define debug_package %{nil} Name: perf-prof -Version: %{version} -Release: %{release} +Version: 1.4.4 +Release: 1%{?dist} License: GPL2 Group: Unspecified Summary: Profiling based on perf_event Distribution: OpenCloudOS Vendor: Tencent URL: https://github.com/OpenCloudOS -BuildArch: x86_64 ExclusiveArch: x86_64 -Requires: elfutils-libelf -Requires: glibc -Requires: xz-libs +Requires: elfutils-libelf,glibc,xz-libs +BuildRequires: elfutils-libelf-devel,xz-devel,gcc -BuildRequires: elfutils-libelf-devel -BuildRequires: xz-devel %if %{has_btf} -BuildRequires: llvm, clang -BuildRequires: bpftool +BuildRequires: clang,llvm,bpftool %endif + # source files -Source: https://github.com/OpenCloudOS/perf-prof/archive/refs/tags/%{version}.tar.gz +Source0: %{name}-%{version}.tar.gz %description @@ -49,23 +43,45 @@ fi strip -g %{name} %install +# basic dirs rm -rf %{buildroot} -mkdir -p %{buildroot}/usr/bin/ %{buildroot}%{PLUGINS_DIR} %{buildroot}/etc/bash_completion.d/ %{buildroot}/usr/share/doc/%{name} -install -m 0755 -o root -g root %{name} %{buildroot}/usr/bin/ -install -m 0755 -o root -g root flamegraph.pl %{buildroot}/usr/bin/ -install -m 0755 -o root -g root trace2heatmap.pl %{buildroot}/usr/bin/ -install -m 0755 -o root -g root lib/traceevent/plugins/*.so %{buildroot}%{PLUGINS_DIR} +mkdir -p -m755 %{buildroot}/usr/bin/ %{buildroot}%{PLUGINS_DIR} %{buildroot}/etc/bash_completion.d/ + +# binary +install -m 0755 %{name} %{buildroot}/usr/bin/ +install -m 0755 flamegraph.pl %{buildroot}/usr/bin/ +install -m 0755 trace2heatmap.pl %{buildroot}/usr/bin/ +install -m 0755 lib/traceevent/plugins/*.so %{buildroot}%{PLUGINS_DIR} cp packages/%{name} %{buildroot}/etc/bash_completion.d/ + +# doc +mkdir -p %{buildroot}/usr/share/doc/%{name} cp 'docs/perf-prof User Guide.pdf' %{buildroot}/usr/share/doc/%{name} %files /usr/bin/%{name} /usr/bin/flamegraph.pl /usr/bin/trace2heatmap.pl -%{TRACEEVENT_DIR} %{PLUGINS_DIR} /etc/bash_completion.d/%{name} /usr/share/doc/%{name} - %changelog +* Tue Feb 18 2025 Joshua Hu - 1.4.4-1 +- [Type] other +- [DESC] fix build error + +* Fri Feb 14 2025 Joshua Hu - 1.4.2-1 +- [Type] other +- [DESC] fix make error & add support for ebpf + +* Thu Feb 13 2025 Joshua Hu - 1.4.1-1 +- init in ocs + +* Sun Feb 6 2022 Duanery +- Supports multiple types of stack processing and flame graph. + +* Sun Jan 23 2022 Builder +- first version +- split-lock, irq-off, profile, task-state, watchdog, kmemleak, kvm-exit, mpdelay. +- Kernel stack support, user stack support -- Gitee