bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BPF CO-RE clarification] Use CO-RE on older kernel versions.
@ 2021-01-06 18:02 Vamsi Kodavanty
  2021-01-06 23:55 ` Andrii Nakryiko
  0 siblings, 1 reply; 20+ messages in thread
From: Vamsi Kodavanty @ 2021-01-06 18:02 UTC (permalink / raw)
  To: bpf

Had a few questions on CO-RE dependencies and usage. From what I read
CO-RE needs a supported kernel version and be compiled with

I also understand there are three pieces to enable CO-RE
functionality. (1) The BTF format. For efficient/compressed kernel
symbol table. (2) clang changes to emit the BTF relocations. (3)
`libbpf` changes to locate a BTF file and fix-up relocations. Once
these 3 steps are done the resulting byte code is no different from
non-CO-RE byte code.

Given this I am hoping the knowledgeable folks on this mailer correct
and guide me if I am stating something incorrectly.

(1) Is the kernel support requirement ONLY for the purposes of
generating and exposing the BTF file information on
`/sys/kernel/btf/vmlinux`? So that the eBPF CO-RE applications
`libbpf` can find the BTF information at a standard location?.

(2) If the answer to the above question is YES. Could the below
mechanism be used so that it works on all kernels whether they support
the `CONFIG_DEBUG_INFO_BTF` flag or not?.
       (a) Extract BTF generation process outside of the kernel build.
Use this to generate the equivalent BTF file for it.
       (b) Make changes to `libbpf` to look for BTF not only at the
standard locations but also at a user specified location. The BTF file
generated in (a) can be presented here.

This should provide us a way to enable CO-RE functionality on older
kernel versions as well. I tried to make the above changes and tried
against a 4.14 kernel and it did not work. Either I am not doing
something right or my assumptions are wrong.

Thanks in advance for your time. And I hope someone here can guide me
in the right direction.


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-03-19  4:44 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 18:02 [BPF CO-RE clarification] Use CO-RE on older kernel versions Vamsi Kodavanty
2021-01-06 23:55 ` Andrii Nakryiko
2021-01-07 18:12   ` Vamsi Kodavanty
2021-01-07 18:52     ` Andrii Nakryiko
2021-01-07 22:45       ` Vamsi Kodavanty
2021-01-07 23:32         ` Andrii Nakryiko
2021-01-08  0:16           ` Vamsi Kodavanty
2021-01-08  1:31             ` Vamsi Kodavanty
2021-03-03 18:14               ` Rafael David Tinoco
2021-03-04  7:05                 ` Andrii Nakryiko
2021-03-04 13:10                   ` Arnaldo Carvalho de Melo
2021-03-05  6:32                   ` Rafael David Tinoco
     [not found]                     ` <67E3C788-2835-4793-8A9C-51C5D807C294@ubuntu.com>
2021-03-10  6:00                       ` Fwd: " Rafael David Tinoco
2021-03-10 19:19                       ` Andrii Nakryiko
2021-03-10 22:45                         ` Rafael David Tinoco
2021-03-12 18:36                           ` Andrii Nakryiko
2021-03-17  4:39                             ` Rafael David Tinoco
2021-03-17 14:31                               ` Rafael David Tinoco
2021-03-19  4:36                                 ` Andrii Nakryiko
2021-03-19  4:42                                   ` Rafael David Tinoco

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).