Re: [PATCH v1 2/3] perf trace: Collect augmented data using BPF

From: Arnaldo Carvalho de Melo
Date: Fri Aug 09 2024 - 09:22:11 EST


On Thu, Aug 01, 2024 at 03:49:38AM +0800, Howard Chu wrote:
> Add task filtering in BPF to avoid collecting useless data.

The above feature should have been on a separate patch, if it is needed
at all, see below.

> SEC("tp/raw_syscalls/sys_enter")
> int sys_enter(struct syscall_enter_args *args)
> {
> @@ -389,6 +501,9 @@ int sys_enter(struct syscall_enter_args *args)
> if (pid_filter__has(&pids_filtered, getpid()))
> return 0;
>
> + if (filter_pid && not_in_filter(getpid()))
> + return 0;
> +

Why do we have two wais of filtering pids? pids_filtered and that
volatile, etc?

- Arnaldo