From 11f1b6ca6ad0fbf3148a2f60fb14890950847153 Mon Sep 17 00:00:00 2001 From: xhb Date: Mon, 29 Apr 2024 10:53:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CPU_Subsystem/eBPF_proc_image/bpf/syscall_image.bpf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/bpf/syscall_image.bpf.c b/eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/bpf/syscall_image.bpf.c index 68d8f29d5..f432e3c8b 100644 --- a/eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/bpf/syscall_image.bpf.c +++ b/eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/bpf/syscall_image.bpf.c @@ -78,16 +78,14 @@ int sys_enter(struct trace_event_raw_sys_enter *args) syscall_seq->enter_time = current_time; if(syscall_seq->count == 0){ if((sc_ctrl->target_tgid==-1 && (sc_ctrl->target_pid==-1 || pid==sc_ctrl->target_pid)) || (sc_ctrl->target_tgid!=-1 && tgid == sc_ctrl->target_tgid)){ - syscall_seq->record_syscall[syscall_seq->count] = (int)args->id; + syscall_seq->record_syscall[syscall_seq->count++] = (int)args->id; } - syscall_seq->count ++; }else if (syscall_seq->count <= MAX_SYSCALL_COUNT-1 && syscall_seq->count > 0 && syscall_seq->record_syscall+syscall_seq->count <= syscall_seq->record_syscall+(MAX_SYSCALL_COUNT-1)){ if((sc_ctrl->target_tgid==-1 && (sc_ctrl->target_pid==-1 || pid==sc_ctrl->target_pid)) || (sc_ctrl->target_tgid!=-1 && tgid == sc_ctrl->target_tgid)){ - syscall_seq->record_syscall[syscall_seq->count] = (int)args->id; + syscall_seq->record_syscall[syscall_seq->count++] = (int)args->id; } - syscall_seq->count ++; } } }