Skip to content

Commit

Permalink
cleanup(driver-modern-bpf): add event type to ringbuf__reserve_space …
Browse files Browse the repository at this point in the history
…and auxmap__submit_event

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
  • Loading branch information
incertum committed Apr 13, 2023
1 parent ec62899 commit 6a2917d
Show file tree
Hide file tree
Showing 152 changed files with 297 additions and 297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int BPF_PROG(pf_kernel,
}

struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, PAGE_FAULT_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, PAGE_FAULT_SIZE, PPME_PAGE_FAULT_E))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int BPF_PROG(pf_user,
}

struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, PAGE_FAULT_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, PAGE_FAULT_SIZE, PPME_PAGE_FAULT_E))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int BPF_PROG(t1_sched_p_exec,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, 0);
return 0;
}
#endif /* CAPTURE_SCHED_PROC_EXEC */
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int BPF_PROG(sched_proc_exit,
}

struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, PROC_EXIT_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, PROC_EXIT_SIZE, PPME_PROCEXIT_1_E))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ int BPF_PROG(t2_sched_p_fork,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, 0);
return 0;
}
#endif /* CAPTURE_SCHED_PROC_EXEC */
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int BPF_PROG(sched_switch,
/// TODO: we could avoid switches from kernel threads to kernel threads (?).

struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, SCHED_SWITCH_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, SCHED_SWITCH_SIZE, PPME_SCHEDSWITCH_6_E))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int BPF_PROG(signal_deliver,
}

struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, SIGNAL_DELIVER_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, SIGNAL_DELIVER_SIZE, PPME_SIGNALDELIVER_E))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SEC("tp_btf/sys_enter")
int BPF_PROG(t1_drop_e)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, DROP_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, DROP_E_SIZE, PPME_DROP_E))
{
return 0;
}
Expand All @@ -38,7 +38,7 @@ SEC("tp_btf/sys_exit")
int BPF_PROG(t1_drop_x)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, DROP_X_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, DROP_X_SIZE, PPME_DROP_X))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(accept_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, ACCEPT_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, ACCEPT_E_SIZE, PPME_SOCKET_ACCEPT_5_E))
{
return 0;
}
Expand Down Expand Up @@ -114,7 +114,7 @@ int BPF_PROG(accept_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SOCKET_ACCEPT_5_X);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(accept4_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, ACCEPT4_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, ACCEPT4_E_SIZE, PPME_SOCKET_ACCEPT4_6_E))
{
return 0;
}
Expand Down Expand Up @@ -118,7 +118,7 @@ int BPF_PROG(accept4_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SOCKET_ACCEPT4_6_X);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(access_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, ACCESS_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, ACCESS_E_SIZE, PPME_SYSCALL_ACCESS_E))
{
return 0;
}
Expand Down Expand Up @@ -66,7 +66,7 @@ int BPF_PROG(access_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SYSCALL_ACCESS_X);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(bind_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, BIND_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, BIND_E_SIZE, PPME_SOCKET_BIND_E))
{
return 0;
}
Expand Down Expand Up @@ -79,7 +79,7 @@ int BPF_PROG(bind_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SOCKET_BIND_X);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int BPF_PROG(bpf_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, BPF_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, BPF_E_SIZE, PPME_SYSCALL_BPF_2_E))
{
return 0;
}
Expand Down Expand Up @@ -45,7 +45,7 @@ int BPF_PROG(bpf_x,
long ret)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, BPF_X_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, BPF_X_SIZE, PPME_SYSCALL_BPF_2_X))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int BPF_PROG(brk_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, BRK_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, BRK_E_SIZE, PPME_SYSCALL_BRK_4_E))
{
return 0;
}
Expand Down Expand Up @@ -45,7 +45,7 @@ int BPF_PROG(brk_x,
long ret)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, BRK_X_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, BRK_X_SIZE, PPME_SYSCALL_BRK_4_X))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int BPF_PROG(capset_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CAPSET_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CAPSET_E_SIZE, PPME_SYSCALL_CAPSET_E))
{
return 0;
}
Expand Down Expand Up @@ -43,7 +43,7 @@ int BPF_PROG(capset_x,
long ret)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CAPSET_X_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CAPSET_X_SIZE, PPME_SYSCALL_CAPSET_X))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(chdir_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CHDIR_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CHDIR_E_SIZE, PPME_SYSCALL_CHDIR_E))
{
return 0;
}
Expand Down Expand Up @@ -64,7 +64,7 @@ int BPF_PROG(chdir_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SYSCALL_CHDIR_X);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(chmod_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CHMOD_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CHMOD_E_SIZE, PPME_SYSCALL_CHMOD_E))
{
return 0;
}
Expand Down Expand Up @@ -68,7 +68,7 @@ int BPF_PROG(chmod_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SYSCALL_CHMOD_X);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(chown_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CHOWN_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CHOWN_E_SIZE, PPME_SYSCALL_CHOWN_E))
{
return 0;
}
Expand Down Expand Up @@ -72,7 +72,7 @@ int BPF_PROG(chown_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SYSCALL_CHOWN_X);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(chroot_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CHROOT_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CHROOT_E_SIZE, PPME_SYSCALL_CHROOT_E))
{
return 0;
}
Expand Down Expand Up @@ -64,7 +64,7 @@ int BPF_PROG(chroot_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SYSCALL_CHROOT_X);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(clone_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CLONE_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CLONE_E_SIZE, PPME_SYSCALL_CLONE_20_E))
{
return 0;
}
Expand Down Expand Up @@ -253,7 +253,7 @@ int BPF_PROG(t2_clone_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SYSCALL_CLONE_20_X);
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int BPF_PROG(clone3_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CLONE3_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CLONE3_E_SIZE, PPME_SYSCALL_CLONE3_E))
{
return 0;
}
Expand Down Expand Up @@ -250,7 +250,7 @@ int BPF_PROG(t2_clone3_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SYSCALL_CLONE3_X);
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int BPF_PROG(close_e,
}

struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CLOSE_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CLOSE_E_SIZE, PPME_SYSCALL_CLOSE_E))
{
return 0;
}
Expand Down Expand Up @@ -84,7 +84,7 @@ int BPF_PROG(close_x,
}

struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, CLOSE_X_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, CLOSE_X_SIZE, PPME_SYSCALL_CLOSE_X))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int BPF_PROG(connect_e,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SOCKET_CONNECT_E);

return 0;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ int BPF_PROG(connect_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SOCKET_CONNECT_X);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int BPF_PROG(copy_file_range_e,
long id)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, COPY_FILE_RANGE_E_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, COPY_FILE_RANGE_E_SIZE, PPME_SYSCALL_COPY_FILE_RANGE_E))
{
return 0;
}
Expand Down Expand Up @@ -53,7 +53,7 @@ int BPF_PROG(copy_file_range_x,
long ret)
{
struct ringbuf_struct ringbuf;
if(!ringbuf__reserve_space(&ringbuf, ctx, COPY_FILE_RANGE_X_SIZE))
if(!ringbuf__reserve_space(&ringbuf, ctx, COPY_FILE_RANGE_X_SIZE, PPME_SYSCALL_COPY_FILE_RANGE_X))
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int BPF_PROG(creat_e,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SYSCALL_CREAT_E);

return 0;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ int BPF_PROG(creat_x,

auxmap__finalize_event_header(auxmap);

auxmap__submit_event(auxmap, ctx);
auxmap__submit_event(auxmap, ctx, PPME_SYSCALL_CREAT_X);

return 0;
}
Expand Down
Loading

0 comments on commit 6a2917d

Please sign in to comment.