Re: [PATCH bpf-next v2 1/6] kallsyms: Add KALLSYMS_QUERY ioctl to /proc/kallsyms
From: David Laight
Date: Wed Nov 04 2026 - 09:25:02 EST
On Tue, 3 Nov 2026 17:14:26 -0800
Samuel Wu <wusamuel@xxxxxxxxxx> wrote:
> On Fri, Oct 30, 2026 at 3:02 AM David Laight
> <david.laight.linux@xxxxxxxxx> wrote:
> >
> > On Thu, 29 Oct 2026 15:05:45 -0700
> > Samuel Wu <wusamuel@xxxxxxxxxx> wrote:
> [...]
> > > BY_NAME matches names exactly, like kallsyms_lookup_name(), so they
> > > would be different symbols at different addresses. Please correct me
> > > if I'm missing something here!
> >
> > Only that the user might really want one of the copies.
> > Sometimes there is only the copy.
>
> Good point. I'll have v3 add KALLSYMS_F_PREFIX + pos/next_pos
> pagination to cover these. A prefix query for "foo." also finds the
> copies when plain foo does not exist (expanded on this in my reply to
> Andrii's Oct 30 mail in this thread).
I'm busy rebasing my patches - they got stamped all over :-(
I should get a v3 that applies by the end of the week.
I will add a 'prefix' variant for you.
The 'next symbol matches' flag is exactly that (actually it is a
this symbol is a duplicate to avoid issues at the start of the array).
So in this case that application would always need to read
the next symbol (by name).
I think it might be more sensible (less pitfalls later on) to return
the symbol number - not that of the next one.
David