public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Eduard Zingerman <eddyz87@gmail.com>
Cc: dwarves@vger.kernel.org, arnaldo.melo@gmail.com,
	bpf@vger.kernel.org, kernel-team@fb.com, ast@kernel.org,
	daniel@iogearbox.net, andrii@kernel.org, yonghong.song@linux.dev,
	martin.lau@linux.dev
Subject: Re: [PATCH dwarves v1] pahole: generate "bpf_fastcall" decl tags for eligible kfuncs
Date: Mon, 9 Dec 2024 16:30:37 -0300	[thread overview]
Message-ID: <Z1dFXVFYmQ-nHSVO@x1> (raw)
In-Reply-To: <20240916091921.2929615-1-eddyz87@gmail.com>

On Mon, Sep 16, 2024 at 02:19:21AM -0700, Eduard Zingerman wrote:
> For kfuncs marked with KF_FASTCALL flag generate the following pair of
> decl tags:
> 
>     $ bpftool btf dump file vmlinux
>     ...
>     [A] FUNC 'bpf_rdonly_cast' type_id=...
>     ...
>     [B] DECL_TAG 'bpf_kfunc' type_id=A component_idx=-1
>     [C] DECL_TAG 'bpf_fastcall' type_id=A component_idx=-1

While testing slab cache BPF iterators I noticed:

⬢ [acme@toolbox perf-tools-next]$ pahole bpf_iter__kmem_cache
WARNING: still unsuported BTF_KIND_DECL_TAG(bpf_fastcall) for bpf_cast_to_kern_ctx already with attribute (bpf_kfunc), ignoring
WARNING: still unsuported BTF_KIND_DECL_TAG(bpf_fastcall) for bpf_rdonly_cast already with attribute (bpf_kfunc), ignoring
struct bpf_iter__kmem_cache {
	union {
		struct bpf_iter_meta * meta;             /*     0     8 */
	};                                               /*     0     8 */
	union {
		struct kmem_cache * s;                   /*     8     8 */
	};                                               /*     8     8 */

	/* size: 16, cachelines: 1, members: 2 */
	/* last cacheline: 16 bytes */
};

⬢ [acme@toolbox perf-tools-next]$

Next time adding a feature in the BTF encoder, please consider adding
the support for the BTF loader and the pretty printer, so that we can
capture that info and produce compileable output that has those tags.

I'll do it when I get some free time.

- Arnaldo

  parent reply	other threads:[~2024-12-09 19:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16  9:19 [PATCH dwarves v1] pahole: generate "bpf_fastcall" decl tags for eligible kfuncs Eduard Zingerman
2024-09-16  9:24 ` Eduard Zingerman
2024-09-16 10:16 ` Alan Maguire
2024-09-17  4:40   ` Eduard Zingerman
2024-09-17  8:21     ` Alan Maguire
2024-09-27 21:52 ` Andrii Nakryiko
2024-09-30 14:44   ` Arnaldo Carvalho de Melo
2024-12-09 19:30 ` Arnaldo Carvalho de Melo [this message]
2024-12-09 20:05   ` Eduard Zingerman

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=Z1dFXVFYmQ-nHSVO@x1 \
    --to=acme@kernel.org \
    --cc=andrii@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dwarves@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@linux.dev \
    --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