BPF List
 help / color / mirror / Atom feed
From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Quentin Monnet <qmo@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: Alan Maguire <alan.maguire@oracle.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	Jiri Olsa <jolsa@kernel.org>, Song Liu <song@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	sched-ext@lists.linux.dev
Subject: Re: [PATCH bpf-next v2 1/6] libbpf: Separate interfaces shared with in-tree tools
Date: Mon, 23 Nov 2026 10:44:46 -0700	[thread overview]
Message-ID: <faecfef3-ac9f-41be-8bc3-83a66572066a@linux.dev> (raw)
In-Reply-To: <adf5a84b-5d80-4c02-91f5-12def2c37304@kernel.org>

On 2026-11-23 7:55 a.m., Quentin Monnet wrote:
> 2026-11-20 17:33 UTC-0700 ~ Ihor Solodrai <ihor.solodrai@linux.dev>
>> resolve_btfids links libbpf statically and uses its BTF header
>> accessor, field iterator and SHA-256 helper. libbpf_internal.h
>> also defines logging macros and poisons kernel integer typedefs,
>> so resolve_btfids wraps the hash helper in a separate source file.
>>
>> Move the shared declarations to libbpf_tools.h and use them
>> directly in resolve_btfids. The header is for in-tree tools and
>> stays uninstalled. No shared-library symbols change.
> 
> 
> Hi Ihor, the change in bpftool's Makefile looks OK and I understand the
> motivation for libbpf_tools.h for resolve_btfids. But I find it a bit
> confusing to move away from libbpf_internal.h only partially for
> bpftool, and to have a split dependency on both libbpf_internal.h and
> libbpf_tools.h. Have you considered moving the other objects that
> bpftool requires from libbpf_internal.h to libbpf_tools.h as well?

Hi Quentin, thank you for taking a look.

I haven't considered that, and it seems like a good idea to me.

The way I thought about this is that in practice libbpf has at least
three levels of (userspace, non-BPF) API:
   - public API defined in the symbols map
   - internal API, shared helpers and such
   - API for the in-tree users, that doesn't make sense to make
     public

I felt like the last one needs a header to reduce the amount of
copy-paste. I don't like "libbpf_tools.h", it gives me "10k loc
utils file" vibes, but I couldn't come up with a better name. Open
to suggestions.

I need to look into bots' feedback, and I expect there will be a v3,
so I'll see what bpftool parts can be moved to the new header as well.

Thanks!

> 
> Thanks,
> Quentin


  reply	other threads:[~2026-11-23 17:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21  0:33 [PATCH bpf-next v2 0/6] libbpf: Support kernel-side kfunc variants Ihor Solodrai
2026-11-21  0:33 ` [PATCH bpf-next v2 1/6] libbpf: Separate interfaces shared with in-tree tools Ihor Solodrai
2026-11-23 14:55   ` Quentin Monnet
2026-11-23 17:44     ` Ihor Solodrai [this message]
2026-11-21  0:33 ` [PATCH bpf-next v2 2/6] sched_ext: Prefer ___v2 kfunc names in compat.bpf.h Ihor Solodrai
2026-11-21  1:13   ` bot+bpf-ci
2026-11-21  0:34 ` [PATCH bpf-next v2 3/6] libbpf: Resolve kfunc variants by prototype Ihor Solodrai
2026-11-21  1:14   ` bot+bpf-ci
2026-11-21  0:34 ` [PATCH bpf-next v2 4/6] selftests/bpf: Test kfunc variant selection " Ihor Solodrai
2026-11-21  0:34 ` [PATCH bpf-next v2 5/6] resolve_btfids: Reject ambiguous kfunc variants Ihor Solodrai
2026-11-21  0:34 ` [PATCH bpf-next v2 6/6] docs/bpf: Describe how to change a kfunc's prototype Ihor Solodrai
2026-11-21  0:58   ` bot+bpf-ci

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=faecfef3-ac9f-41be-8bc3-83a66572066a@linux.dev \
    --to=ihor.solodrai@linux.dev \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=qmo@kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=song@kernel.org \
    --cc=tj@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox