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 ++; } } }