Skip to content

Commit

Permalink
chore: remove OPT_PROCESS_INFO
Browse files Browse the repository at this point in the history
OPT_PROCESS_INFO is not used anymore and can't be selected by the user.
Remove old code that still uses it.
  • Loading branch information
yanivagman committed Apr 15, 2024
1 parent 576cf4d commit ebe62b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
9 changes: 4 additions & 5 deletions pkg/ebpf/c/common/consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@
#define OPT_CAPTURE_STACK_TRACES (1 << 3)
#define OPT_CAPTURE_MODULES (1 << 4)
#define OPT_CGROUP_V1 (1 << 5)
#define OPT_PROCESS_INFO (1 << 6)
#define OPT_TRANSLATE_FD_FILEPATH (1 << 7)
#define OPT_CAPTURE_BPF (1 << 8)
#define OPT_CAPTURE_FILES_READ (1 << 9)
#define OPT_FORK_PROCTREE (1 << 10)
#define OPT_TRANSLATE_FD_FILEPATH (1 << 6)
#define OPT_CAPTURE_BPF (1 << 7)
#define OPT_CAPTURE_FILES_READ (1 << 8)
#define OPT_FORK_PROCTREE (1 << 9)

#define STDIN 0
#define STDOUT 1
Expand Down
7 changes: 3 additions & 4 deletions pkg/ebpf/c/tracee.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ int tracepoint__sched__sched_process_fork(struct bpf_raw_tracepoint_args *ctx)

// Submit the event

if (should_submit(SCHED_PROCESS_FORK, p.event) || p.config->options & OPT_PROCESS_INFO) {
if (should_submit(SCHED_PROCESS_FORK, p.event)) {
// Parent information.
u64 parent_start_time = get_task_start_time(parent);
int parent_tid = get_task_host_pid(parent);
Expand Down Expand Up @@ -1248,8 +1248,7 @@ int tracepoint__sched__sched_process_exec(struct bpf_raw_tracepoint_args *ctx)

proc_info->follow_in_scopes = p.event->context.matched_policies; // follow task for matched scopes

if (!should_submit(SCHED_PROCESS_EXEC, p.event) &&
(p.config->options & OPT_PROCESS_INFO) != OPT_PROCESS_INFO)
if (!should_submit(SCHED_PROCESS_EXEC, p.event))
return 0;

// Note: From v5.9+, there are two interesting fields in bprm that could be added:
Expand Down Expand Up @@ -1373,7 +1372,7 @@ int tracepoint__sched__sched_process_exit(struct bpf_raw_tracepoint_args *ctx)

long exit_code = get_task_exit_code(p.event->task);

if (should_submit(SCHED_PROCESS_EXIT, p.event) || p.config->options & OPT_PROCESS_INFO) {
if (should_submit(SCHED_PROCESS_EXIT, p.event)) {
save_to_submit_buf(&p.event->args_buf, (void *) &exit_code, sizeof(long), 0);
save_to_submit_buf(&p.event->args_buf, (void *) &group_dead, sizeof(bool), 1);

Expand Down
1 change: 0 additions & 1 deletion pkg/ebpf/tracee.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,6 @@ const (
optStackAddresses
optCaptureModules
optCgroupV1
optProcessInfo
optTranslateFDFilePath
optCaptureBpf
optCaptureFileRead
Expand Down

0 comments on commit ebe62b4

Please sign in to comment.