BPF List
 help / color / mirror / Atom feed
From: Stephen Brennan <stephen.s.brennan@oracle.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Jiri Olsa <jolsa@kernel.org>, Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Cc: dwarves@vger.kernel.org, bpf <bpf@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alan Maguire <alan.maguire@oracle.com>
Subject: Re: [PATCH dwarves 0/7] Add support for generating BTF for all variables
Date: Wed, 07 Sep 2022 12:06:57 -0700	[thread overview]
Message-ID: <87sfl3j966.fsf@oracle.com> (raw)
In-Reply-To: <CAADnVQKbK__y8GOD4LqaX0aCgT+rtC5aw54-02mSZj1-U6_mgw@mail.gmail.com>

Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:
> On Fri, Aug 26, 2022 at 11:54 AM Stephen Brennan
> <stephen.s.brennan@oracle.com> wrote:
[...]
>> Future Work
>> -----------
>>
>> If this proves acceptable, I'd like to follow-up with a kernel patch to
>> add a configuration option (default=n) for generating BTF with all
>> variables, which distributions could choose to enable or not.
>>
>> There was previous discussion[3] about leveraging split BTF or building
>> additional kernel modules to contain the extra variables. I believe with
>> this patch series, it is possible to do that. However, I'd argue that
>> simpler is better here: the advantage for using BTF is having it all
>> available in the kernel/module image. Storing extra BTF on the
>> filesystem would break that advantage, and at that point, you'd be
>> better off using a debuginfo format like CTF, which is lightweight and
>> expected to be found on the filesystem.
>
> With all or nothing approach the distros would have a hard choice
> to make whether to enable that kconfig, increase BTF and consume
> extra memory without any obvious reason or just don't do it.
> Majority probably is not going to enable it.
> So the feature will become a single vendor only and with
> inevitable bit-rot.

I'd intend to support it even if just a single distribution enabled it.
But I do see your concern.

> Whereas with split BTF and extra kernel module approach
> we can enable BTF with all global vars by default.
> The extra module will be shipped by all distros and tools
> like bpftrace might start using it.

Split BTF is currently limited to a single base BTF file. We'd need more
patches for pahole to support multiple --btf_base files: e.g.
vmlinux.btf and vmlinux-variables.btf. There's also the question of
modules: presumably we wouldn't try to have "$MODULE" and
"$MODULE-btf-extra" modules due to the added complexity. I doubt the
space savings would be worth it.

I can look into these concerns, but if possible I would like to proceed
with this series, as it is a separate concern from the exact mechanism
by which we include extra BTF into the kernel.

Thanks,
Stephen

  reply	other threads:[~2022-09-07 19:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 18:49 [PATCH dwarves 0/7] Add support for generating BTF for all variables Stephen Brennan
2022-08-26 18:49 ` [PATCH dwarves 1/7] dutil: return ELF section name when looked up by index Stephen Brennan
2022-08-26 18:49 ` [PATCH dwarves 2/7] btf_encoder: Rename percpu structures to variables Stephen Brennan
2022-08-26 18:49 ` [PATCH dwarves 3/7] btf_encoder: cache all ELF section info Stephen Brennan
2022-08-26 18:49 ` [PATCH dwarves 4/7] btf_encoder: make the variable array dynamic Stephen Brennan
2022-08-26 18:49 ` [PATCH dwarves 5/7] btf_encoder: record ELF section for collected variables Stephen Brennan
2022-08-26 18:49 ` [PATCH dwarves 6/7] btf_encoder: collect all variables Stephen Brennan
2022-08-26 18:49 ` [PATCH dwarves 7/7] btf_encoder: allow encoding " Stephen Brennan
2022-08-30 15:14 ` [PATCH dwarves 0/7] Add support for generating BTF for " Alexei Starovoitov
2022-09-07 19:06   ` Stephen Brennan [this message]
2022-09-07 19:27     ` Alexei Starovoitov
2022-09-07 21:54       ` Stephen Brennan
2022-09-08 20:35         ` Alexei Starovoitov
2022-09-09 19:31           ` Stephen Brennan
2022-09-23 23:38             ` Andrii Nakryiko

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=87sfl3j966.fsf@oracle.com \
    --to=stephen.s.brennan@oracle.com \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dwarves@vger.kernel.org \
    --cc=jolsa@kernel.org \
    /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