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

Add BTFIDLink to support fentry/fexit/fmod_ret/tp_raw/lsm BPF programs #460

Merged
merged 1 commit into from
Nov 1, 2021
Merged

Add BTFIDLink to support fentry/fexit/fmod_ret/tp_raw/lsm BPF programs #460

merged 1 commit into from
Nov 1, 2021

Conversation

mehrdadrad
Copy link
Contributor

The attachBTFID links Tracing/LSM BPF programs which they attach to a btf_id.

@ti-mo ti-mo requested review from lmb and ti-mo October 26, 2021 09:11
link/btf_id.go Outdated
var _ Link = (*BTFIDLink)(nil)

// BTFIDLink is a program attached to a btf_id.
type BTFIDLink struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's better to unexport this and return Link instead of *BTFIDLink below. Rationale:

  • BTFIDLink doesn't expose user accessible methods, so returning Link is fine.
  • We can later change functions to return a concrete type without breaking callers.
  • This means we don't have to commit to the name yet, and we don't have to commit to using the same type for LSM and Trace programs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f2db4e6

@lmb
Copy link
Collaborator

lmb commented Oct 29, 2021

Please rebase on master to make CI run against 5.14. Thanks!

@mehrdadrad
Copy link
Contributor Author

@lmb I recompiled kernel 5.14.14 with adding the below to the config and the tests passed at my local vm through run-tests.sh 5.14 ./link

CONFIG_DYNAMIC_FTRACE=y
CONFIG_STACK_TRACER=y

@lmb lmb merged commit 35f5e51 into cilium:master Nov 1, 2021
@lmb
Copy link
Collaborator

lmb commented Nov 1, 2021

Thanks!

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.

None yet

2 participants