dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Martin KaFai Lau <kafai@fb.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Jiri Olsa <jolsa@kernel.org>,
	dwarves@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	bpf <bpf@vger.kernel.org>, Kernel Team <kernel-team@fb.com>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: Re: [PATCH dwarves] btf: Generate btf for functions in the .BTF_ids section
Date: Sun, 2 May 2021 00:23:52 +0200	[thread overview]
Message-ID: <YI3U+Ffh9O1VFsOW@krava> (raw)
In-Reply-To: <20210501001653.x3b4rk4vk4iqv3n7@kafai-mbp.dhcp.thefacebook.com>

On Fri, Apr 30, 2021 at 05:16:53PM -0700, Martin KaFai Lau wrote:
> On Tue, Apr 27, 2021 at 01:38:20PM +0200, Jiri Olsa wrote:
> > On Mon, Apr 26, 2021 at 04:26:11PM -0700, Andrii Nakryiko wrote:
> > > On Fri, Apr 23, 2021 at 2:37 PM Martin KaFai Lau <kafai@fb.com> wrote:
> > > >
> > > > BTF is currently generated for functions that are in ftrace list
> > > > or extern.
> > > >
> > > > A recent use case also needs BTF generated for functions included in
> > > > allowlist.  In particular, the kernel
> > > > commit e78aea8b2170 ("bpf: tcp: Put some tcp cong functions in allowlist for bpf-tcp-cc")
> > > > allows bpf program to directly call a few tcp cc kernel functions.  Those
> > > > functions are specified under an ELF section .BTF_ids.  The symbols
> > > > in this ELF section is like __BTF_ID__func__<kernel_func>__[digit]+.
> > > > For example, __BTF_ID__func__cubictcp_init__1.  Those kernel
> > > > functions are currently allowed only if CONFIG_DYNAMIC_FTRACE is
> > > > set to ensure they are in the ftrace list but this kconfig dependency
> > > > is unnecessary.
> > > >
> > > > pahole can generate BTF for those kernel functions if it knows they
> > > > are in the allowlist.  This patch is to capture those symbols
> > > > in the .BTF_ids section and generate BTF for them.
> > > >
> > > > Cc: Andrii Nakryiko <andrii@kernel.org>
> > > > Signed-off-by: Martin KaFai Lau <kafai@fb.com>
> > > > ---
> > > 
> > > I wonder if we just record all functions how bad that would be. Jiri,
> > > do you remember from the time you were experimenting with static
> > > functions how much more functions we'd be recording if we didn't do
> > > ftrace filtering?
> > 
> > hum, I can't find that.. but should be just matter of removing
> > that is_ftrace_func check
> In my kconfig, by ignoring is_ftrace_func(),
> number of FUNC: 40643 vs 46225
> 
> I would say skip the ftrace filtering instead of my current patch.  Thoughts?
> 

I tested on arm and got 25022 vs 55812 ;-)
and of course it fixes the compilation issue with cubictcp_state

I checked the pahole changelog and the original idea was to have only
traceable functions in BTF, but we need more than that now, so I'm ok
to skip the ftrace filter

jirka


  reply	other threads:[~2021-05-01 22:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 21:37 [PATCH dwarves] btf: Generate btf for functions in the .BTF_ids section Martin KaFai Lau
2021-04-26 23:26 ` Andrii Nakryiko
2021-04-27 11:38   ` Jiri Olsa
2021-04-27 12:34     ` Arnaldo Carvalho de Melo
2021-04-27 12:43       ` Jiri Olsa
2021-04-27 20:38       ` Andrii Nakryiko
2021-04-28 13:10         ` Arnaldo Carvalho de Melo
2021-04-28 19:45           ` Andrii Nakryiko
2021-04-28 22:05             ` Arnaldo Carvalho de Melo
2021-05-01  0:16     ` Martin KaFai Lau
2021-05-01 22:23       ` Jiri Olsa [this message]
2021-04-27 11:42 ` Jiri Olsa
2021-04-27 18:20   ` Martin KaFai Lau

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=YI3U+Ffh9O1VFsOW@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=jolsa@kernel.org \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.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).