Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
xhb committed Apr 29, 2024
1 parent f41c918 commit 11f1b6c
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++;
}
}
}
Expand Down

0 comments on commit 11f1b6c

Please sign in to comment.