Skip to content

Conversation

@fntlnz
Copy link
Contributor

@fntlnz fntlnz commented Feb 4, 2021

One of the biggest struggle for sysdig's users is that they have to have kernel headers

What does this mean?

We will have three different ways to compile our BPF probe.

make bpf

This is the usual bpf probe we are all used to, but now uses libbpf instead of our old definitions taken from the kernel.

This target still depends on the kernel headers.

make bpf-btf

This is our bpf probe but compiled for including the BPF type format.

This target does not depend on kernel headers. It is likely that probes compiled with this target
will be compatible across kernels on the same version but with different patches.

This is the recommended target for > 5.8 kernels

make bpf-btf-core

This is the same as make bpf-btf but the generated probe will also be using CO-RE

This target does not depend on kernel headers, compiled probes are compile once run everywhere.

It's unlikely that our probe will be 100% working with this target in most cases.

Using this target is not recommended yet because our probe and the kernel require more work for it to be compatible but it's good to have the scaffolding done.

Signed-off-by: Lorenzo Fontana lo@linux.com

fntlnz added 13 commits February 3, 2021 14:35
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
vmlinux.h

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
relocations for reads.

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
We can use libbpf + BTF without necessarily using the CO-RE
definitions to read structure fields.

This is necessary so that we can still compile without kernel headers
even if when we don't compile CO-RE.

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
@fntlnz fntlnz force-pushed the driver/libbpf-porting branch from 882fcf2 to b3c6be7 Compare February 5, 2021 17:41
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
…, assertions and checks

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
@fntlnz
Copy link
Contributor Author

fntlnz commented Feb 17, 2021

I'm closing this. Will reopen against https://github.com/falcosecurity/libs/

@fntlnz fntlnz closed this Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants