diff --git a/0001-fix-syscall-waitpid-not-exist-in-aarch64-arch.patch b/0001-fix-syscall-waitpid-not-exist-in-aarch64-arch.patch new file mode 100644 index 0000000000000000000000000000000000000000..408822ac0f26bb4bbbdb4f6062e31188363bfbb8 --- /dev/null +++ b/0001-fix-syscall-waitpid-not-exist-in-aarch64-arch.patch @@ -0,0 +1,55 @@ +From bae51740d2459bb4df647b89c8fd42a639536e7c Mon Sep 17 00:00:00 2001 +From: algorithmofdish +Date: Fri, 15 Sep 2023 14:46:04 +0800 +Subject: [PATCH] fix: syscall 'waitpid' not exist in aarch64 arch + +--- + .../extends/ebpf.probe/src/tprofilingprobe/syscall_sched.bpf.c | 3 ++- + src/probes/extends/ebpf.probe/src/tprofilingprobe/tprofiling.c | 2 ++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/probes/extends/ebpf.probe/src/tprofilingprobe/syscall_sched.bpf.c b/src/probes/extends/ebpf.probe/src/tprofilingprobe/syscall_sched.bpf.c +index 86b063d..daf493a 100644 +--- a/src/probes/extends/ebpf.probe/src/tprofilingprobe/syscall_sched.bpf.c ++++ b/src/probes/extends/ebpf.probe/src/tprofilingprobe/syscall_sched.bpf.c +@@ -54,6 +54,7 @@ SET_SYSCALL_META(wait4) + scm->flag = SYSCALL_FLAG_STACK; + } + ++#if defined(__TARGET_ARCH_x86) + SET_SYSCALL_PARAMS(waitpid) { return; } + + SET_SYSCALL_META(waitpid) +@@ -61,6 +62,7 @@ SET_SYSCALL_META(waitpid) + scm->nr = SYSCALL_WAITPID_ID; + scm->flag = SYSCALL_FLAG_STACK; + } ++#endif + + SET_SYSCALL_PARAMS(select) { return; } + +@@ -118,7 +120,6 @@ KPROBE_SYSCALL(__arm64_sys_, sched_yield) + KPROBE_SYSCALL(__arm64_sys_, nanosleep) + KPROBE_SYSCALL(__arm64_sys_, clock_nanosleep) + KPROBE_SYSCALL(__arm64_sys_, wait4) +-KPROBE_SYSCALL(__arm64_sys_, waitpid) + KPROBE_SYSCALL(__arm64_sys_, select) + KPROBE_SYSCALL(__arm64_sys_, pselect6) + KPROBE_SYSCALL(__arm64_sys_, poll) +diff --git a/src/probes/extends/ebpf.probe/src/tprofilingprobe/tprofiling.c b/src/probes/extends/ebpf.probe/src/tprofilingprobe/tprofiling.c +index 3a19483..4402425 100644 +--- a/src/probes/extends/ebpf.probe/src/tprofilingprobe/tprofiling.c ++++ b/src/probes/extends/ebpf.probe/src/tprofilingprobe/tprofiling.c +@@ -58,7 +58,9 @@ static syscall_meta_t g_syscall_metas[] = { + {SYSCALL_NANOSLEEP_ID, SYSCALL_NANOSLEEP_NAME, SYSCALL_FLAG_STACK, PROFILE_EVT_TYPE_SCHED}, + {SYSCALL_CLOCK_NANOSLEEP_ID, SYSCALL_CLOCK_NANOSLEEP_NAME, SYSCALL_FLAG_STACK, PROFILE_EVT_TYPE_SCHED}, + {SYSCALL_WAIT4_ID, SYSCALL_WAIT4_NAME, SYSCALL_FLAG_STACK, PROFILE_EVT_TYPE_SCHED}, ++#if defined(__TARGET_ARCH_x86) + {SYSCALL_WAITPID_ID, SYSCALL_WAITPID_NAME, SYSCALL_FLAG_STACK, PROFILE_EVT_TYPE_SCHED}, ++#endif + {SYSCALL_SELECT_ID, SYSCALL_SELECT_NAME, SYSCALL_FLAG_STACK, PROFILE_EVT_TYPE_SCHED}, + {SYSCALL_PSELECT6_ID, SYSCALL_PSELECT6_NAME, SYSCALL_FLAG_STACK, PROFILE_EVT_TYPE_SCHED}, + {SYSCALL_POLL_ID, SYSCALL_POLL_NAME, SYSCALL_FLAG_STACK, PROFILE_EVT_TYPE_SCHED}, +-- +2.21.0.windows.1 + diff --git a/gala-gopher.spec b/gala-gopher.spec index bc3f023e572c2debaee0a62778c18755dcb5d640..6fd776e95f73479d892efa00ce919288a10c66bc 100644 --- a/gala-gopher.spec +++ b/gala-gopher.spec @@ -27,7 +27,7 @@ Summary: Intelligent ops toolkit for openEuler Name: gala-gopher Version: 2.0.0 -Release: 1 +Release: 2 License: Mulan PSL v2 URL: https://gitee.com/openeuler/gala-gopher Source: %{name}-%{version}.tar.gz @@ -83,6 +83,8 @@ Requires: cjson conntrack-tools Requires: lsof %endif +Patch1: 0001-fix-syscall-waitpid-not-exist-in-aarch64-arch.patch + %description gala-gopher is a low-overhead eBPF-based probes framework @@ -144,6 +146,9 @@ fi %attr(0700,root,root) /usr/libexec/gala-gopher/init_probes.sh %changelog +* Fri Sep 15 2023 algorithmofdish - 2.0.0-2 +- fix: syscall 'waitpid' not exist in aarch64 arch + * Wed Aug 23 2023 Tangxin Xie - 2.0.0-1 - update to 2.0.0