[DTrace-devel] [PATCH v2 1/6] bpf: separate bvar implementation into separate functions

Eugene Loh eugene.loh at oracle.com
Tue Jan 28 23:29:43 UTC 2025


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>

If there is some quantification or other characterization of the benefit 
that could be added to the commit message, that would be nice.

And...

On 1/28/25 01:31, Kris Van Hees wrote:
> The handling of builtin variables was done with a single big function
> that therefore got linked into every single BPF program (twice if the
> builtin variable might raise a fault).  Providing separate functions
> for most builtin variables reduces BPF program size significantly.
>
> This also reduces pressure on the BPF verifies.
>
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
>
> diff --git a/bpf/get_bvar.c b/bpf/get_bvar.c
> @@ -19,18 +19,21 @@
>   # define noinline	__attribute__((noinline))
>   #endif
>   
> -extern struct bpf_map_def cpuinfo;
> -extern struct bpf_map_def probes;
> -extern struct bpf_map_def state;
> -extern struct bpf_map_def usdt_names;
> -
> -extern uint64_t PC;
> -extern uint64_t STBSZ;
> -extern uint64_t STKSIZ;
> -extern uint64_t BOOTTM;
> +extern struct bpf_map_def	cpuinfo;
> +extern struct bpf_map_def	probes;
> +extern struct bpf_map_def	state;
> +extern struct bpf_map_def	usdt_names;
> +
> +extern uint64_t	BOOTTM;
> +extern uint64_t	NPROBES;
> +extern uint64_t	PC;
> +extern uint64_t	STBSZ;
> +extern uint64_t	STKSIZ;
>   extern uint64_t STACK_OFF;
> -extern uint64_t STACK_SKIP;
> -extern uint64_t NPROBES;
> +extern uint64_t	STACK_SKIP;
> +extern uint64_t	TASK_COMM;
> +extern uint64_t	TASK_REAL_PARENT;
> +extern uint64_t	TASK_TGID;

Did you intend to change the indentation on STACK_OFF as well?



More information about the DTrace-devel mailing list