2022-11-14 17:08:32 +08:00
|
|
|
%define __os_install_post %{nil}
|
2022-11-13 15:07:08 +08:00
|
|
|
|
2023-08-23 09:05:45 +08:00
|
|
|
%define vmlinux_ver 6.4.0-1.0.1.4.oe2309.%{_arch}
|
|
|
|
|
|
|
|
|
|
%define without_flamegraph 0
|
|
|
|
|
%define without_cadvisor 0
|
|
|
|
|
%define without_jvm 0
|
|
|
|
|
%define without_tcp 0
|
|
|
|
|
%define without_systeminfo 0
|
|
|
|
|
%define without_virt 0
|
|
|
|
|
%define without_opengauss_sli 0
|
|
|
|
|
%define without_l7 0
|
|
|
|
|
%define without_postgre_sli 0
|
|
|
|
|
%define without_redis_sli 0
|
|
|
|
|
%define without_proc 0
|
|
|
|
|
%define without_tprofiling 0
|
|
|
|
|
|
|
|
|
|
# example for tailoring probes
|
|
|
|
|
%global extend_tailor_probes %{nil}
|
|
|
|
|
%if 0%{?without_flamegraph}
|
|
|
|
|
%global extend_tailor_probes %{extend_tailor_probes}stackprobe|
|
|
|
|
|
%endif
|
|
|
|
|
%if 0%{?without_jvm}
|
|
|
|
|
%global extend_tailor_probes %{extend_tailor_probes}jvm.probe
|
|
|
|
|
%endif
|
2023-01-11 13:49:46 +08:00
|
|
|
|
2022-11-13 15:07:08 +08:00
|
|
|
Summary: Intelligent ops toolkit for openEuler
|
|
|
|
|
Name: gala-gopher
|
2023-08-23 09:05:45 +08:00
|
|
|
Version: 2.0.0
|
2023-09-15 15:26:48 +08:00
|
|
|
Release: 2
|
2022-11-13 15:07:08 +08:00
|
|
|
License: Mulan PSL v2
|
|
|
|
|
URL: https://gitee.com/openeuler/gala-gopher
|
|
|
|
|
Source: %{name}-%{version}.tar.gz
|
|
|
|
|
BuildRoot: %{_builddir}/%{name}-%{version}
|
2023-08-23 09:05:45 +08:00
|
|
|
BuildRequires: systemd cmake gcc-c++ elfutils-devel clang12 llvm
|
2022-11-13 15:07:08 +08:00
|
|
|
BuildRequires: libconfig-devel librdkafka-devel libmicrohttpd-devel
|
2023-01-28 21:04:44 +08:00
|
|
|
BuildRequires: libbpf-devel >= 2:0.3 uthash-devel log4cplus-devel
|
2023-08-23 09:05:45 +08:00
|
|
|
BuildRequires: cjson-devel gnutls-devel
|
|
|
|
|
%if !0%{?without_flamegraph}
|
|
|
|
|
BuildRequires: libcurl-devel
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_jvm}
|
|
|
|
|
BuildRequires: java-1.8.0-openjdk-devel
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_l7}
|
|
|
|
|
BuildRequires: cjson-devel java-1.8.0-openjdk-devel
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
Requires: bash glibc elfutils bpftool dmidecode libbpf >= 2:0.3
|
|
|
|
|
Requires: log4cplus librdkafka libmicrohttpd libconfig
|
|
|
|
|
Requires: iproute cjson gnutls
|
|
|
|
|
%if !0%{?without_systeminfo}
|
|
|
|
|
Requires: ethtool systemd iproute
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_virt}
|
|
|
|
|
Requires: systemd
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_tcp}
|
|
|
|
|
Requires: iproute conntrack-tools
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_proc}
|
|
|
|
|
Requires: kmod
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_flamegraph}
|
|
|
|
|
Requires: flamegraph libcurl
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_opengauss_sli}
|
|
|
|
|
Requires: python3-psycopg2 python3-yaml net-tools
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_cadvisor}
|
|
|
|
|
Requires: cadvisor python3-libconf python3-requests net-tools
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_postgre_sli}
|
|
|
|
|
Requires: iproute
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_redis_sli}
|
|
|
|
|
Requires: iproute
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_l7}
|
|
|
|
|
Requires: cjson conntrack-tools
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?without_tprofiling}
|
|
|
|
|
Requires: lsof
|
|
|
|
|
%endif
|
|
|
|
|
|
2023-09-15 15:26:48 +08:00
|
|
|
Patch1: 0001-fix-syscall-waitpid-not-exist-in-aarch64-arch.patch
|
|
|
|
|
|
2022-11-13 15:07:08 +08:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
gala-gopher is a low-overhead eBPF-based probes framework
|
|
|
|
|
|
|
|
|
|
%prep
|
2022-11-15 12:10:52 +08:00
|
|
|
%autosetup -n %{name}-%{version} -p1
|
2022-11-13 15:07:08 +08:00
|
|
|
|
2023-08-23 09:05:45 +08:00
|
|
|
|
2022-11-13 15:07:08 +08:00
|
|
|
%build
|
2023-08-23 09:05:45 +08:00
|
|
|
cat << EOF > tailor.conf
|
|
|
|
|
EXTEND_PROBES="%{extend_tailor_probes}"
|
|
|
|
|
EOF
|
|
|
|
|
|
2022-11-13 15:07:08 +08:00
|
|
|
pushd build
|
2023-08-23 09:05:45 +08:00
|
|
|
export PATH=$PATH:/usr/lib64/llvm12/bin
|
2023-01-11 13:49:46 +08:00
|
|
|
sh build.sh --release %{vmlinux_ver}
|
2022-11-13 15:07:08 +08:00
|
|
|
popd
|
|
|
|
|
|
2023-08-23 09:05:45 +08:00
|
|
|
%check
|
|
|
|
|
|
2022-11-13 15:07:08 +08:00
|
|
|
%install
|
2023-08-23 09:05:45 +08:00
|
|
|
install -d %{buildroot}/etc/gala-gopher
|
2022-11-13 15:07:08 +08:00
|
|
|
install -d %{buildroot}/opt/gala-gopher
|
|
|
|
|
install -d %{buildroot}%{_bindir}
|
2023-08-23 09:05:45 +08:00
|
|
|
install -d %{buildroot}/usr/libexec/gala-gopher/
|
2022-11-13 15:07:08 +08:00
|
|
|
mkdir -p %{buildroot}/usr/lib/systemd/system
|
|
|
|
|
install -m 0600 service/gala-gopher.service %{buildroot}/usr/lib/systemd/system/gala-gopher.service
|
|
|
|
|
pushd build
|
2023-08-23 09:05:45 +08:00
|
|
|
sh install.sh %{buildroot}%{_bindir} %{buildroot}/opt/gala-gopher %{buildroot}/etc/gala-gopher %{buildroot}/usr/libexec/gala-gopher/
|
2022-11-13 15:07:08 +08:00
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%systemd_post gala-gopher.service
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
%systemd_preun gala-gopher.service
|
|
|
|
|
|
|
|
|
|
%postun
|
2023-08-23 09:05:45 +08:00
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
|
rm -rf /sys/fs/bpf/gala-gopher > /dev/null
|
|
|
|
|
fi
|
2022-11-13 15:07:08 +08:00
|
|
|
%systemd_postun_with_restart gala-gopher.service
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%dir /opt/gala-gopher
|
|
|
|
|
%dir /opt/gala-gopher/extend_probes
|
|
|
|
|
%dir /opt/gala-gopher/meta
|
|
|
|
|
%dir /opt/gala-gopher/lib
|
|
|
|
|
%{_bindir}/*
|
|
|
|
|
/opt/gala-gopher/extend_probes/*
|
|
|
|
|
/opt/gala-gopher/meta/*
|
|
|
|
|
/opt/gala-gopher/lib/*
|
2023-08-23 09:05:45 +08:00
|
|
|
/etc/gala-gopher/res/event_multy_language.rc
|
|
|
|
|
%config(noreplace) /etc/gala-gopher/probes.init
|
|
|
|
|
%config(noreplace) /etc/gala-gopher/*.conf
|
|
|
|
|
%config(noreplace) /etc/gala-gopher/extend_probes/*.conf
|
2022-11-13 15:07:08 +08:00
|
|
|
/usr/lib/systemd/system/gala-gopher.service
|
2023-08-23 09:05:45 +08:00
|
|
|
%attr(0700,root,root) /usr/libexec/gala-gopher/init_probes.sh
|
2022-11-13 15:07:08 +08:00
|
|
|
|
|
|
|
|
%changelog
|
2023-09-15 15:26:48 +08:00
|
|
|
* Fri Sep 15 2023 algorithmofdish <hexiujun1@huawei.com> - 2.0.0-2
|
|
|
|
|
- fix: syscall 'waitpid' not exist in aarch64 arch
|
|
|
|
|
|
2023-08-23 09:05:45 +08:00
|
|
|
* Wed Aug 23 2023 Tangxin Xie <xietangxin@huawei.com> - 2.0.0-1
|
|
|
|
|
- update to 2.0.0
|
|
|
|
|
|
2023-01-31 11:45:24 +08:00
|
|
|
* Tue Jan 31 2023 Zhen Chen <chenzhen126@huawei.com> - 1.0.1-4
|
|
|
|
|
- add net-tools and ethtool to Requires
|
|
|
|
|
|
2023-01-28 21:04:44 +08:00
|
|
|
* Sun Jan 29 2023 Zhen Chen <chenzhen126@huawei.com> - 1.0.1-3
|
|
|
|
|
- specify libbpf version in BuildRequires and add some Requires
|
|
|
|
|
|
2023-01-14 06:21:55 +08:00
|
|
|
* Sat Jan 14 2023 Zhen Chen <chenzhen126@huawei.com> - 1.0.1-2
|
|
|
|
|
- fix ksliprobe get invalid args occasionally at startup
|
|
|
|
|
- fix error print when starting gala-gopher
|
|
|
|
|
- add system_uuid field to distinguish client when post to pyroscope server
|
|
|
|
|
- repair stackprobe caused cpu rush
|
|
|
|
|
- add support to pyroscope
|
|
|
|
|
- bugfix: add check if thread is 0
|
|
|
|
|
- fix stackprobe memory allocation and deallocation errors.
|
|
|
|
|
- normalize time format in flamegraph svg filename
|
|
|
|
|
|
2023-01-11 13:49:46 +08:00
|
|
|
* Mon Dec 12 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.1-1
|
|
|
|
|
- Update to 1.0.1
|
2022-11-17 21:11:40 +08:00
|
|
|
|
2022-11-17 22:12:29 +08:00
|
|
|
* Thu Nov 17 2022 wo_cow <niuqianqian@huawei.com> - 1.0.0-7
|
|
|
|
|
- resolve patch conflict
|
|
|
|
|
|
2022-11-17 21:11:40 +08:00
|
|
|
* Thu Nov 17 2022 wo_cow <niuqianqian@huawei.com> - 1.0.0-6
|
|
|
|
|
- adapt libbpf v0.8
|
|
|
|
|
|
2022-11-17 20:18:22 +08:00
|
|
|
* Thu Nov 17 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-5
|
|
|
|
|
- add flamegraph-stackcollapse to Requires
|
|
|
|
|
|
2022-11-15 12:10:52 +08:00
|
|
|
* Tue Nov 15 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-4
|
|
|
|
|
- add systemd to BuildRequires to fix install/uninstall errors
|
|
|
|
|
simplify patch application in %prep
|
|
|
|
|
|
2022-11-14 19:48:38 +08:00
|
|
|
* Mon Nov 14 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-3
|
|
|
|
|
- fix pgsliprobe
|
|
|
|
|
|
2022-11-14 17:08:32 +08:00
|
|
|
* Mon Nov 14 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-2
|
|
|
|
|
- add vmlinux for 22.03-LTS & 22.03-LTS-SP1
|
|
|
|
|
|
2022-11-13 15:07:08 +08:00
|
|
|
* Mon Nov 14 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-1
|
|
|
|
|
- Package init
|
|
|
|
|
|