From 16423d15c467530dafae68357611d83ab388c066 Mon Sep 17 00:00:00 2001 From: weli-l <1289113577@qq.com> Date: Tue, 5 Aug 2025 19:49:42 +0800 Subject: [PATCH] fix ebpf do not filter process Signed-off-by: weli-l <1289113577@qq.com> --- systrace/src/os/bpf_comm.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/systrace/src/os/bpf_comm.h b/systrace/src/os/bpf_comm.h index 0fbe65a..d1c1a02 100644 --- a/systrace/src/os/bpf_comm.h +++ b/systrace/src/os/bpf_comm.h @@ -274,16 +274,14 @@ static __always_inline int get_npu_id(struct task_struct *task) // 匹配内核dev线程 char comm[16] = {}; bpf_core_read_str(comm, sizeof(comm), &task->comm); - // bpf_get_current_comm(&comm, sizeof(comm)); rank = bpf_map_lookup_elem(&kernel_filter_map, comm); if (rank) { - bpf_printk("is kernel thread:%s, pid is %lu", comm, pid); return *rank; } // 匹配ACL线程 const char target[] = "acl_thread"; - if (strcase_match(comm, target, MAX_COMM_LEN)) { + if (!strcase_match(comm, target, MAX_COMM_LEN)) { u32 tgid = BPF_CORE_READ(task, tgid); rank = bpf_map_lookup_elem(&proc_filter_map, &tgid); if (rank) { -- Gitee