Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tetragon: update bpf makefile #3159

Merged
merged 11 commits into from
Nov 29, 2024
Merged

tetragon: update bpf makefile #3159

merged 11 commits into from
Nov 29, 2024

Conversation

olsajiri
Copy link
Contributor

@olsajiri olsajiri commented Nov 24, 2024

bpf makefile changes, hopefully making it more readable

@olsajiri olsajiri added the release-note/minor This PR introduces a minor user-visible change label Nov 24, 2024
@olsajiri olsajiri force-pushed the pr/olsajiri/variants branch 8 times, most recently from 4051f63 to b9e03b6 Compare November 26, 2024 14:32
Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit f351925
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/67472386515c550008fdb518
😎 Deploy Preview https://deploy-preview-3159--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Let's keep them together.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
There's no reason for the .ll step, we can compile
directly to the object file.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
It's taken care of by including $(DEPS) files.

All objects are by default handled by 'objs/%.o' target, plus we
need to have specific rule when the object needs extra flags.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
It's more readable.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
@olsajiri olsajiri force-pushed the pr/olsajiri/variants branch 4 times, most recently from a5c31ae to 4b8a7e4 Compare November 27, 2024 17:42
@olsajiri olsajiri marked this pull request as ready for review November 27, 2024 19:36
@olsajiri olsajiri requested a review from a team as a code owner November 27, 2024 19:36
@olsajiri olsajiri requested a review from kevsecurity November 27, 2024 19:36
@olsajiri olsajiri changed the title Pr/olsajiri/variants tetragon: update bpf makefile Nov 27, 2024
@olsajiri olsajiri requested review from kkourt and jrfastab November 28, 2024 08:18
@olsajiri olsajiri marked this pull request as draft November 28, 2024 08:32
We can generate variant compilation in DEFINE_VARIANT macro.
Specific CFLAGS are defined via CFLAGS_<VARIANT> variable.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
We can have just single rule for object and dependency files
and provide specific CFLAGS based on object name, like:

  CFLAGS_bpf_enforcer.o = -D__BPF_OVERRIDE_RETURN

This way it's more readable what flags are used for object.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
@olsajiri olsajiri force-pushed the pr/olsajiri/variants branch from 4b8a7e4 to 90c0937 Compare November 28, 2024 09:04
We need special rules only for multi k/u probes,
the rest can be caught by generic rule.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
To put some order to objects.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
We already have them, let's use them.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Trying to explain the bpf obejcts build in nutshell.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
@olsajiri olsajiri force-pushed the pr/olsajiri/variants branch from 90c0937 to 3ac9b07 Compare November 28, 2024 09:07
@olsajiri olsajiri marked this pull request as ready for review November 28, 2024 09:58
Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup! Left a comment below, but otherwise LGTM!

bpf/Makefile Show resolved Hide resolved
@olsajiri olsajiri force-pushed the pr/olsajiri/variants branch from d604053 to 655d608 Compare November 28, 2024 23:45
Allowing to build llvm IR objects with:

  $ make -C bpf objs/bpf_generic_kprobe_v61.ll

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
@olsajiri olsajiri force-pushed the pr/olsajiri/variants branch from 655d608 to 6c3b77c Compare November 28, 2024 23:52
Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@olsajiri olsajiri merged commit 32eb721 into main Nov 29, 2024
42 checks passed
@olsajiri olsajiri deleted the pr/olsajiri/variants branch November 29, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants