Skip to content

Commit

Permalink
feat(ebpf): add prev_comm for sched_process_exec
Browse files Browse the repository at this point in the history
  • Loading branch information
OriGlassman authored and yanivagman committed Jul 28, 2024
1 parent 6762ab7 commit ce3f1bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/ebpf/c/tracee.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1405,14 +1405,15 @@ int sched_process_exec_event_submit_tail(struct bpf_raw_tracepoint_args *ctx)
save_to_submit_buf(&p.event->args_buf, &stdin_type, sizeof(unsigned short), 12);
save_str_to_buf(&p.event->args_buf, stdin_path, 13);
save_to_submit_buf(&p.event->args_buf, &invoked_from_kernel, sizeof(int), 14);
save_str_to_buf(&p.event->args_buf, (void *) p.task_info->context.comm, 15);
if (p.config->options & OPT_EXEC_ENV) {
unsigned long env_start, env_end;
env_start = get_env_start_from_mm(mm);
env_end = get_env_end_from_mm(mm);
int envc = get_envc_from_bprm(bprm);

save_args_str_arr_to_buf(
&p.event->args_buf, (void *) env_start, (void *) env_end, envc, 15);
&p.event->args_buf, (void *) env_start, (void *) env_end, envc, 16);
}

events_perf_submit(&p, 0);
Expand Down
1 change: 1 addition & 0 deletions pkg/events/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -11229,6 +11229,7 @@ var CoreEvents = map[ID]Definition{
{Type: "umode_t", Name: "stdin_type"},
{Type: "char*", Name: "stdin_path"},
{Type: "int", Name: "invoked_from_kernel"},
{Type: "const char*", Name: "prev_comm"},
{Type: "const char**", Name: "env"},
},
},
Expand Down

0 comments on commit ce3f1bb

Please sign in to comment.