Re: [RFC PATCH v3 3/3] btf: Reuse libbpf code for BTF type sorting verification and binary search

From: Alexei Starovoitov

Date: Mon Oct 27 2025 - 15:56:14 EST


On Mon, Oct 27, 2025 at 6:54 AM Donglin Peng <dolinux.peng@xxxxxxxxx> wrote:
>
> +
> +/*
> + * btf_sort.c is included directly to avoid function call overhead
> + * when accessing BTF private data, as this file is shared between
> + * libbpf and kernel and may be called frequently (especially when
> + * funcgraph-args or func-args tracing options are enabled).
> + */
> +#include "../../tools/lib/bpf/btf_sort.c"

function call overhead? I don't believe it's measurable.

Don't do it on libbpf side either.

pw-bot: cr