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

Per CPU map needed API and selftest #156

Merged
merged 5 commits into from Jun 27, 2022

Conversation

grantseltzer
Copy link
Contributor

No description provided.

libbpfgo.go Outdated
@@ -630,6 +638,15 @@ func (b *BPFMap) GetValue(key unsafe.Pointer) ([]byte, error) {
return value, nil
}

func (b *BPFMap) GetValue2(key unsafe.Pointer, value *[]byte) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to have a better name than GetValue2? And also adding a documentation to explain the need of the additional method would be awesome!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hahaha yes, I forgot that I pushed it with that name. I'll update it, thanks for your reviews @kakkoyun !

libbpfgo.go Outdated Show resolved Hide resolved
@grantseltzer
Copy link
Contributor Author

libbpf just merged high level apis for accessing maps, which includes built in API for reading from per-cpu maps. This should be changed over to use that API (though it hasn't been released yet)

@grantseltzer
Copy link
Contributor Author

grantseltzer commented Jun 20, 2022

libbpf just merged high level apis for accessing maps, which includes built in API for reading from per-cpu maps. This should be changed over to use that API (though it hasn't been released yet)

These have been release in v0.8, I will update this PR accordingly! I have updated this PR accordingly.

#175 must be merged first though.

Signed-off-by: grantseltzer <grantseltzer@gmail.com>
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
slice for the map lookup to read into

Signed-off-by: grantseltzer <grantseltzer@gmail.com>
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
Copy link
Contributor

@rafaeldtinoco rafaeldtinoco left a comment

Choose a reason for hiding this comment

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

LGTM. Make sure to squash needed commits and dont duplicate "Signed off by" lines in git log! Thanks!

@grantseltzer grantseltzer merged commit 649bcf3 into aquasecurity:main Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants