bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Daniel Xu <dxu@dxuuu.xyz>,
	acme@kernel.org, jolsa@kernel.org,  quentin@isovalent.com,
	alan.maguire@oracle.com
Cc: andrii.nakryiko@gmail.com, ast@kernel.org, daniel@iogearbox.net,
	 bpf@vger.kernel.org
Subject: Re: [PATCH dwarves v8 3/3] pahole: Inject kfunc decl tags into BTF
Date: Fri, 26 Apr 2024 13:55:03 -0700	[thread overview]
Message-ID: <89ea76fb441617adff7913e150047a1b0a181123.camel@gmail.com> (raw)
In-Reply-To: <c046da5cec91dec15958c894d9a9cb7d7091659c.camel@gmail.com>

On Fri, 2024-04-26 at 12:47 -0700, Eduard Zingerman wrote:
> On Thu, 2024-04-25 at 18:28 -0600, Daniel Xu wrote:
> > This commit teaches pahole to parse symbols in .BTF_ids section in
> > vmlinux and discover exported kfuncs. Pahole then takes the list of
> > kfuncs and injects a BTF_KIND_DECL_TAG for each kfunc.
> > 
> > Example of encoding:
> > 
> >         $ bpftool btf dump file .tmp_vmlinux.btf | rg "DECL_TAG 'bpf_kfunc'" | wc -l
> >         121
> > 
> >         $ bpftool btf dump file .tmp_vmlinux.btf | rg 56337
> >         [56337] FUNC 'bpf_ct_change_timeout' type_id=56336 linkage=static
> >         [127861] DECL_TAG 'bpf_kfunc' type_id=56337 component_idx=-1
> > 
> > This enables downstream users and tools to dynamically discover which
> > kfuncs are available on a system by parsing vmlinux or module BTF, both
> > available in /sys/kernel/btf.
> > 
> > This feature is enabled with --btf_features=decl_tag,decl_tag_kfuncs.
> 
> I tried to double-check results produced by this patch and found that
> decl_tag for one kfunc is missing, namely, the following function:
> 
> [66020] FUNC 'update_socket_protocol' type_id=66018 linkage=static
> 
> And it is present in symbols table (15 is a number of the .BTF_ids section):
> 
> 60433: ffffffff8293a7fc     4 OBJECT  LOCAL  DEFAULT   15 __BTF_ID__func__update_socket_protocol__78624
> 
> Interestingly, this is the last symbol printed for the section.
> I'll try to debug this issue.

Nevermind, the 'update_socket_protocol' is not a kfunc, just a member of set8.
Sorry for the noise.

  reply	other threads:[~2024-04-26 20:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  0:28 [PATCH dwarves v8 0/3] pahole: Inject kfunc decl tags into BTF Daniel Xu
2024-04-26  0:28 ` [PATCH dwarves v8 1/3] pahole: Save input filename separate from output Daniel Xu
2024-04-26  0:28 ` [PATCH dwarves v8 2/3] pahole: Add --btf_feature=decl_tag_kfuncs feature Daniel Xu
2024-04-26  0:28 ` [PATCH dwarves v8 3/3] pahole: Inject kfunc decl tags into BTF Daniel Xu
2024-04-26 19:47   ` Eduard Zingerman
2024-04-26 20:55     ` Eduard Zingerman [this message]
2024-04-26 23:47   ` Eduard Zingerman
2024-04-29 22:38     ` Daniel Xu
2024-04-26  9:08 ` [PATCH dwarves v8 0/3] " Jiri Olsa

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=89ea76fb441617adff7913e150047a1b0a181123.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dxu@dxuuu.xyz \
    --cc=jolsa@kernel.org \
    --cc=quentin@isovalent.com \
    /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;
as well as URLs for NNTP newsgroup(s).