代码拉取完成,页面将自动刷新
%define __os_install_post %{nil}
%define gopher_state_dir %{_rundir}/gala_gopher
%define without_baseinfo 0
%define without_virt 0
%define without_flamegraph 0
%define without_l7 0
%define without_tcp 0
%define without_socket 0
%define without_io 0
%define without_proc 0
%define without_jvm 0
%define without_postgre_sli 0
%define without_opengauss_sli 0
%define without_nginx 1
%define without_tprofiling 0
%define without_kafka 1
%define without_hw 1
%define without_ksli 0
%define without_container 0
%define without_sermant 1
%define without_sli 0
%define without_flowtracer 1
%define disable_report_event 0
%define disable_kafka_channel 0
%define disable_flamegraph_svg 0
%define disable_l4_toa 1
Summary: Intelligent ops toolkit for openEuler
Name: gala-gopher
Version: 2.0.2
Release: 4
License: Mulan PSL v2
URL: https://gitee.com/openeuler/gala-gopher
Source: %{name}-%{version}.tar.gz
BuildRoot: %{_builddir}/%{name}-%{version}
BuildRequires: systemd cmake gcc-c++ elfutils-devel clang llvm bpftool >= 6.8
BuildRequires: libconfig-devel libevent-devel openssl-devel libbpf-devel >= 2:0.8 uthash-devel
BuildRequires: jsoncpp-devel git libstdc++-devel
# for DT
#BuildRequires: CUnit-devel
%if !0%{?disable_kafka_channel}
BuildRequires: librdkafka-devel
%endif
%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: jsoncpp-devel java-1.8.0-openjdk-devel
%endif
Requires: bash gawk procps-ng glibc elfutils libbpf >= 2:0.8
Requires: libconfig libevent iproute jsoncpp libstdc++
%if !0%{?disable_kafka_channel}
Requires: librdkafka
%endif
%if !0%{?without_baseinfo}
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}
%if !0%{?disable_flamegraph_svg}
Requires: flamegraph
%endif
Requires: libcurl
%endif
%if !0%{?without_opengauss_sli}
Requires: python3-psycopg2 python3-yaml net-tools
%endif
%if !0%{?without_container}
Requires: cadvisor python3-requests util-linux
%endif
%if !0%{?without_postgre_sli}
Requires: iproute
%endif
%if !0%{?without_l7}
Requires: jsoncpp conntrack-tools
%endif
%if !0%{?without_tprofiling}
Requires: lsof
%endif
Patch1: fix-restart-thread-block-by-resetting-probe-pid.patch
Patch2: fix-service-failed-when-cmd-server-thread-starts-lat.patch
Patch3: add-error-log-of-mismatch-between-metric-data-and-me.patch
Patch4: Simplify-the-error-handling-process-by-using-goto-st.patch
Patch5: fix-OOB-write-when-getting-proc-cmdline.patch
Patch6: fix-Memory-leak.patch
Patch7: Found-a-exit-path-has-missing-return-statement.patch
Patch8: fix-restart-gopher-failed-for-check-gopher-pid-multi.patch
Patch9: fix-run-sig-hander-core-for-probe-mng-create-later.patch
Patch10: ipc.py-fix-incompatible-struct-definition-of-Snooper.patch
Patch11: fix-prog-load-failure-due-to-loops-in-toa-code.patch
Patch12: add-log-level-info-to-logs-of-main-process.patch
Patch13: fix-potential-nullptr-dereference-in-libevent-openss.patch
Patch14: ipc-reset-probe_flags-to-0-when-restarting-probes.patch
Patch15: tcpprobe-do-not-flush-snooped-procs-to-avoid-deletin.patch
Patch16: tcpprobe-poll-from-last-buffer-to-adapt-for-pinned-p.patch
Patch17: tcpprobe-reset-sk-link-state-when-tcp-link-was-delet.patch
Patch18: fix-buffer-overflow-in-sscanf.patch
Patch19: fix-buffer-overflow-and-ret-value-of-sscanf.patch
Patch20: snooper-enlarge-channel-map-and-shorten-poll-timeout.patch
Patch21: system_infos-fix-oob-of-arrays-and-double-free.patch
Patch22: tcpprobe-report-all-metrics-of-a-tracker-in-one-outp.patch
Patch23: tcpprobe-remove-superfluous-buffer__open-to-reduce-m.patch
Patch24: Refactor-to-reduce-memory-usage-of-metric-record.patch
Patch25: bugfix-path-parsing-error-when-gala-gopher-running-i.patch
Patch26: fix-strdup-relative-error.patch
Patch27: tcpprobe-fix-incorret-struct-type-of-tracepoint-even.patch
Patch28: simplify-dissection-of-toa-and-make-it-valid-on-olde.patch
Patch29: PFM_OPT-tcpprobe-reduce-the-scanning-times-of-tracke.patch
Patch30: PFM_OPT-imdb-optimize-the-type-of-record-value-and-a.patch
Patch31: fix-UAF-of-probe-bin-after-parsing-invalid-config.patch
Patch32: remove-extra-strlen-and-snprintf-when-writing-metric.patch
Patch33: PFM_OPT-tcpprobe-merge-win-sockbuf-rtt-rate-subprobe.patch
Patch34: fix-home-check.patch
Patch35: keep-consuming-output-of-extend-probes-when-failed-t.patch
Patch36: snooper-optimize-the-size-of-proc-event.patch
Patch37: snooper-fix-opposite-judgment-logic-of-container-inf.patch
Patch38: snooper-use-file-op-to-read-proc-comm-and-stat-inste.patch
Patch39: avoid-conflict-of-kprobe-between-tcp_link-and-tcp_rx.patch
Patch40: snooper-fix-incorrect-flags-when-resending-ipc-msg.patch
Patch41: fix-extra-length-of-task-comm.patch
Patch42: snooper-refix-incorrect-flags-when-resending-ipc-msg.patch
Patch43: Fix-some-resource-leak-and-oob-issues.patch
Patch44: epprobe-adapt-hook-point-of-req_drops-according-to-k.patch
Patch45: tcpprobe-fix-inaccurate-notack_bytes.patch
%description
gala-gopher is a low-overhead eBPF-based probes framework
%prep
%autosetup -n %{name}-%{version} -p1
sed -i "s/openEuler-linux/%{_vendor}-linux/" src/probes/extends/ebpf.probe/src/mk/var.mk
%build
BUILD_OPTS=(
-DENABLE_BASEINFO=%[0%{?without_baseinfo}?0:1]
-DENABLE_VIRT=%[0%{?without_virt}?0:1]
-DENABLE_FLAMEGRAPH=%[0%{?without_flamegraph}?0:1]
-DENABLE_L7=%[0%{?without_l7}?0:1]
-DENABLE_TCP=%[0%{?without_tcp}?0:1]
-DENABLE_SOCKET=%[0%{?without_socket}?0:1]
-DENABLE_IO=%[0%{?without_io}?0:1]
-DENABLE_PROC=%[0%{?without_proc}?0:1]
-DENABLE_JVM=%[0%{?without_jvm}?0:1]
-DENABLE_POSTGRE_SLI=%[0%{?without_postgre_sli}?0:1]
-DENABLE_OPENGAUSS_SLI=%[0%{?without_opengauss_sli}?0:1]
-DENABLE_NGINX=%[0%{?without_nginx}?0:1]
-DENABLE_TPROFILING=%[0%{?without_tprofiling}?0:1]
-DENABLE_KAFKA=%[0%{?without_kafka}?0:1]
-DENABLE_HW=%[0%{?without_hw}?0:1]
-DENABLE_KSLI=%[0%{?without_ksli}?0:1]
-DENABLE_CONTAINER=%[0%{?without_cadvisor}?0:1]
-DENABLE_SERMANT=%[0%{?without_sermant}?0:1]
-DENABLE_SLI=%[0%{?without_sli}?0:1]
-DENABLE_FLOWTRACER=%[0%{?without_flowtracer}?0:1]
-DENABLE_REPORT_EVENT=%[0%{?disable_report_event}?0:1]
-DKAFKA_CHANNEL=%[0%{?disable_kafka_channel}?0:1]
-DFLAMEGRAPH_SVG=%[0%{?disable_flamegraph_svg}?0:1]
-DL4_TOA=%[0%{?disable_l4_toa}?0:1]
)
pushd build
export PATH=$PATH:/usr/lib64/llvm12/bin
sh build.sh --debug "${BUILD_OPTS[@]}"
popd
%check
# pushd test
# sh test_modules.sh "${BUILD_OPTS[@]}"
# popd
%install
install -d %{buildroot}/etc/gala-gopher
install -d %{buildroot}/opt/gala-gopher
install -d %{buildroot}%{_bindir}
install -d %{buildroot}/usr/libexec/gala-gopher/
mkdir -p %{buildroot}/usr/lib/systemd/system
install -m 0600 service/gala-gopher.service %{buildroot}/usr/lib/systemd/system/gala-gopher.service
install -d %{buildroot}/%{gopher_state_dir}
install -d %{buildroot}/var/log/gala-gopher
pushd build
sh install.sh %{buildroot}%{_bindir} %{buildroot}/opt/gala-gopher %{buildroot}/etc/gala-gopher %{buildroot}/usr/libexec/gala-gopher/ %{buildroot}/opt/gala-gopher
popd
%pre
%post
%systemd_post gala-gopher.service
%preun
%systemd_preun gala-gopher.service
%postun
if [ $1 -eq 0 ]; then
rm -rf /sys/fs/bpf/gala-gopher > /dev/null
rm -rf /opt/gala-gopher > /dev/null
fi
%systemd_postun_with_restart gala-gopher.service
%files
%attr(0750,root,root) %dir /var/log/gala-gopher
%attr(0750,root,root) %dir %{gopher_state_dir}
%attr(0750,root,root) %dir /opt/gala-gopher
%attr(0550,root,root) %dir /opt/gala-gopher/extend_probes
%attr(0750,root,root) %dir /opt/gala-gopher/meta
%attr(0750,root,root) %dir /opt/gala-gopher/btf
%attr(0550,root,root) %dir /opt/gala-gopher/lib
%attr(0550,root,root) %{_bindir}/*
%attr(0550,root,root) /opt/gala-gopher/extend_probes/*
%attr(0640,root,root) /opt/gala-gopher/meta/*
#%attr(0640,root,root) /opt/gala-gopher/btf/*
%attr(0550,root,root) /opt/gala-gopher/lib/*
%attr(0640,root,root) %config(noreplace) /etc/gala-gopher/probes.init
%attr(0640,root,root) %config(noreplace) /etc/gala-gopher/*.conf
%attr(0640,root,root) %config(noreplace) /etc/gala-gopher/extend_probes/*.conf
%attr(0600,root,root) /usr/lib/systemd/system/gala-gopher.service
%attr(0550,root,root) /usr/libexec/gala-gopher/init_probes.sh
%attr(0550,root,root) /usr/libexec/gala-gopher/start_pre.sh
%changelog
* Fri Nov 28 2025 Chenzhen <chenzhen126@huawei.com> - 2.0.2-4
- fix restart thread block by resetting probe pid
fix service failed when cmd server thread starts late
fix OOB write when getting proc cmdline
fix restart gopher failed for check gopher pid multi times
fix run sig hander core for probe mng create later
fix potential nullptr dereference in libevent openssl cb
ipc: reset probe_flags to 0 when restarting probes
tcpprobe: do not flush snooped procs to avoid deleting tcp link by accident
fix buffer overflow in sscanf
fix buffer overflow and ret value of sscanf
snooper: enlarge channel map and shorten poll timeout to ease event loss
system_infos: fix oob of arrays and double free
Refactor to reduce memory usage of metric record
bugfix: path parsing error when gala-gopher running in container
fix strdup relative error
tcpprobe: fix incorret struct type of tracepoint event
fix UAF of probe bin after parsing invalid config
snooper: fix opposite judgment logic of container info
* Thu Jul 24 2025 Haitao Peng <htpengc@isoftstone.com> - 2.0.2-3
- Modify openEuler to %{_vendor}
* Mon Dec 30 2024 wocow <niuqianqian@huawei.com> - 2.0.2-2
- add container name as snooper conf
* Wed Aug 21 2024 wocow <niuqianqian@huawei.com> - 2.0.2-1
- Update to 2.0.2-1
* Wed Apr 24 2024 Tangxin Xie <xietangxin@huawei.com> - 2.0.0-1
- Update to 2.0.1
* Fri Mar 8 2024 Zhen Chen <chenzhen126@huawei.com> - 1.0.2-4
- fix command injection in ioprobe
* Fri Jun 9 2023 Tangxin Xie <xietangxin@huawei.com> - 1.0.2-3
- fix httpprobe find libssl path
Fix segmentation fault of gala-gopher cmd
fix prepare_dependence
bugfix:The log time is not the local time
fix: fix fd leakage problem
cadvisor_probe:convert container_id type to bytes
adapt block_rq_issue tracepoint args in kernel-5.10
modify desc from chinese to english
bugfix: fix gala-gopher -h print err
fix: change license software name
fix: fix install error
bugfix: zombie task.
fix:add default data of event conf
fix access violation
* Fri Apr 7 2023 Tangxin Xie <xietangxin@huawei.com> - 1.0.2-2
- bugfix add check whether cadvisor is installed
bugfix fix system_proc collect data err
change return type of uprobe from void to int
Fix for popen cannot get stderr
fix modify unit of some metrics to second
refactor modify jvmprobe to support pod
stackprobe fix inaccurate call stack count add samp
add python3-libconf and python3-request deps
* Fri Mar 3 2023 Tangxin Xie <xietangxin@huawei.com> - 1.0.2-1
- update to 1.0.2
* Wed Feb 22 2023 Tangxin Xie <xietangxin@huawei.com> - 1.0.1-5
- fix testcase compile and run errs
* Tue Jan 31 2023 Zhen Chen <chenzhen126@huawei.com> - 1.0.1-4
- add net-tools and ethtool to Requires
* Sun Jan 29 2023 Zhen Chen <chenzhen126@huawei.com> - 1.0.1-3
- specify libbpf version in BuildRequires and add some Requires
* 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
* Mon Dec 12 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.1-1
- Update to 1.0.1
* Mon Dec 12 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-12
- remove debug_package %{nil} to strip files and provide debug packages
* Tue Dec 6 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-11
- add %config(noreplace) to conf files of extend_probes
* Tue Dec 6 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-10
- simplify vmlinux.h management with different kernel versions
* Wed Nov 30 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-9
- fix java.probe build error caused by a typo in build.sh
Only check the installation of dep when building ebpf.probes
Remove unused BuildRequires and add java-1.8.0-openjdk-devel
* Mon Nov 28 2022 wo_cow <niuqianqian@huawei.com> - 1.0.0-8
- fix issues raised during 22.03 test
* Thu Nov 17 2022 wo_cow <niuqianqian@huawei.com> - 1.0.0-7
- resolve patch conflict
* Thu Nov 17 2022 wo_cow <niuqianqian@huawei.com> - 1.0.0-6
- adapt libbpf v0.8
* Thu Nov 17 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-5
- add flamegraph-stackcollapse to Requires
* 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
* Mon Nov 14 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-3
- fix pgsliprobe
* Mon Nov 14 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-2
- add vmlinux for 22.03-LTS & 22.03-LTS-SP1
* Mon Nov 14 2022 Zhen Chen <chenzhen126@huawei.com> - 1.0.0-1
- Package init
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。