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

feat: wrapper creation for libbpf_probe_bpf_helper #446

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

rscampos
Copy link
Collaborator

@rscampos rscampos commented Jul 1, 2024

Create the wrapper BPFFuncTypeIsSupported around libbpf_probe_bpf_helper in order to check if bpf helper is available.

It's necessary to give the bpf type and the function ID in order to know if it's supported.

@rscampos rscampos requested a review from geyslan July 1, 2024 21:44
@rscampos rscampos self-assigned this Jul 1, 2024
@rscampos rscampos force-pushed the feat_probe_func_support branch from 4299289 to 558440f Compare July 1, 2024 21:47
@geyslan
Copy link
Member

geyslan commented Jul 1, 2024

With this PR #445 isn't completely true.

libbpfgo.go Outdated
@@ -96,6 +98,15 @@ func BPFMapTypeIsSupported(mapType MapType) (bool, error) {
return supportedC == 1, nil
}

func BPFFuncTypeIsSupported(progType BPFProgType, funcId helpers.BPFFunc) (bool, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

For clarity, I suggest renaming to BPFHelperIsSupported

Copy link
Member

Choose a reason for hiding this comment

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

+1

geyslan
geyslan previously approved these changes Jul 2, 2024
Copy link
Member

@geyslan geyslan left a comment

Choose a reason for hiding this comment

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

helpers_test.go Show resolved Hide resolved
@rscampos rscampos force-pushed the feat_probe_func_support branch from 558440f to 866aefe Compare July 2, 2024 12:47
@rscampos rscampos requested a review from geyslan July 2, 2024 13:52
@rscampos rscampos merged commit 73f0dea into aquasecurity:main Jul 2, 2024
17 checks passed
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.

3 participants