netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: andrii.nakryiko@gmail.com
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, kernel-team@fb.com,
	andriin@fb.com, yamada.masahiro@socionext.com, acme@redhat.com,
	daniel@iogearbox.net, ast@fb.com, yhs@fb.com, kafai@fb.com
Subject: Re: [PATCH bpf-next] kbuild: add ability to generate BTF type info for vmlinux
Date: Tue, 02 Apr 2019 10:40:30 -0700 (PDT)	[thread overview]
Message-ID: <20190402.104030.733182526476732084.davem@davemloft.net> (raw)
In-Reply-To: <20190402164950.429597-1-andrii.nakryiko@gmail.com>

From: <andrii.nakryiko@gmail.com>
Date: Tue, 2 Apr 2019 09:49:50 -0700

> From: Andrii Nakryiko <andriin@fb.com>
> 
> This patch adds new config option to trigger generation of BTF type
> information from DWARF debuginfo for vmlinux and kernel modules through
> pahole, which in turn relies on libbpf for btf_dedup() algorithm.
> 
> The intent is to record compact type information of all types used
> inside kernel, including all the structs/unions/typedefs/etc. This
> enables BPF's compile-once-run-everywhere ([0]) approach, in which
> tracing programs that are inspecting kernel's internal data (e.g.,
> struct task_struct) can be compiled on a system running some kernel
> version, but would be possible to run on other kernel versions (and
> configurations) without recompilation, even if the layout of structs
> changed and/or some of the fields were added, removed, or renamed.
> 
> This is only possible if BPF loader can get kernel type info to adjust
> all the offsets correctly. This patch is a first time in this direction,
> making sure that BTF type info is part of Linux kernel image in
> non-loadable ELF section.
> 
> BTF deduplication ([1]) algorithm typically provides 100x savings
> compared to DWARF data, so resulting .BTF section is not big as is
> typically about 2MB in size.
> 
> [0] http://vger.kernel.org/lpc-bpf2018.html#session-2
> [1] https://facebookmicrosites.github.io/bpf/blog/2018/11/14/btf-enhancement.html
> 
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Acked-by: David S. Miller <davem@davemloft.net>

  reply	other threads:[~2019-04-02 17:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 16:49 [PATCH bpf-next] kbuild: add ability to generate BTF type info for vmlinux andrii.nakryiko
2019-04-02 17:40 ` David Miller [this message]
2019-04-02 23:00 ` Daniel Borkmann
2019-04-03  8:46 ` Jiri Olsa
2019-04-03  9:04   ` Daniel Borkmann
2019-04-03  9:12     ` Jiri Olsa
2019-04-03  9:21       ` Daniel Borkmann
2019-04-03 12:05       ` Arnaldo Carvalho de Melo
2019-04-04  0:40       ` Arnaldo Carvalho de Melo
2019-04-04  8:47         ` 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=20190402.104030.733182526476732084.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=acme@redhat.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=yamada.masahiro@socionext.com \
    --cc=yhs@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).