-
Notifications
You must be signed in to change notification settings - Fork 71
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
Bump libbpfgo + add regression tests #381
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ran: ``` $ go get github.com/aquasecurity/libbpfgo@80f44303d40f3e65702de30d4976ada883e79fe2 ``` Changes from the version we have until this pinned revision: aquasecurity/libbpfgo@v0.2.5-libbpf-0.7.0...80f4430
javierhonduco
force-pushed
the
bump-libbpfgo
branch
3 times, most recently
from
May 3, 2022 14:53
b591f07
to
817340d
Compare
kakkoyun
reviewed
May 3, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing PR! Thanks for adding the tests 👍
I have added a couple of suggestions.
To ensure that the libbpfgo invariants hold true. Adding these tests will also help us with library upgrades, as well as configuration changes in the way libbpf deals with errors, etc. **Test plan**: ``` $ make test_profiler sudo -E GOOS=linux GOARCH=arm64 CC=clang CGO_CFLAGS="-I /home/vagrant/work/parca-agent/dist/libbpf/usr/include" CGO_LDFLAGS="/home/vagrant/work/parca-agent/dist/libbpf/libbpf.a" go test -v github.com/parca-dev/parca-agent/pkg/profiler === RUN TestDeleteNonExistentKeyReturnsEnoent --- PASS: TestDeleteNonExistentKeyReturnsEnoent (0.00s) === RUN TestDeleteExistentKey --- PASS: TestDeleteExistentKey (0.00s) === RUN TestGetValueAndDeleteBatchWithEmptyMap --- PASS: TestGetValueAndDeleteBatchWithEmptyMap (0.00s) === RUN TestGetValueAndDeleteBatchFewerElementsThanCount --- PASS: TestGetValueAndDeleteBatchFewerElementsThanCount (0.00s) === RUN TestGetValueAndDeleteBatchExactElements --- PASS: TestGetValueAndDeleteBatchExactElements (0.00s) PASS ok github.com/parca-dev/parca-agent/pkg/profiler (cached) ``` With ASAN: ``` $ make test_profiler ENABLE_ASAN=yes sudo -E GOOS=linux GOARCH=arm64 CC=clang CGO_CFLAGS="-I /home/vagrant/work/parca-agent/dist/libbpf/usr/include" CGO_LDFLAGS="/home/vagrant/work/parca-agent/dist/libbpf/libbpf.a" go test -v github.com/parca-dev/parca-agent/pkg/profiler -asan === RUN TestDeleteNonExistentKeyReturnsEnoent --- PASS: TestDeleteNonExistentKeyReturnsEnoent (0.00s) === RUN TestDeleteExistentKey --- PASS: TestDeleteExistentKey (0.00s) === RUN TestGetValueAndDeleteBatchWithEmptyMap --- PASS: TestGetValueAndDeleteBatchWithEmptyMap (0.00s) === RUN TestGetValueAndDeleteBatchFewerElementsThanCount --- PASS: TestGetValueAndDeleteBatchFewerElementsThanCount (0.00s) === RUN TestGetValueAndDeleteBatchExactElements --- PASS: TestGetValueAndDeleteBatchExactElements (0.00s) PASS ok github.com/parca-dev/parca-agent/pkg/profiler 0.047s ```
javierhonduco
force-pushed
the
bump-libbpfgo
branch
from
May 3, 2022 15:15
817340d
to
ee705fb
Compare
kakkoyun
approved these changes
May 4, 2022
javierhonduco
pushed a commit
to javierhonduco/parca-agent
that referenced
this pull request
May 5, 2022
This PR is based off [@kakkoyun's work](parca-dev#326) to use libbpf(go)'s batch APIs. **Context** The main issue we found while working with this API was that they were erroring with `EPERM`. After some debugging, we realised that libbpf wasn't handle with errors in the way we expected. The debugging write-up and more context can be found [here](aquasecurity/libbpfgo#159), and the fix is in [this PR](aquasecurity/libbpfgo#157). After landing these changes upstream, we pointed to the updated libbpfgo version, as well as added some [regression tests](parca-dev#381) to ensure that libbpfgo behaves as expected, and to make it easier in the future to write further compatibility tests. Note: the rest of the batch APIs error handling is still unfixed. Tracking in aquasecurity/libbpfgo#162.
javierhonduco
added a commit
to javierhonduco/parca-agent
that referenced
this pull request
May 5, 2022
This PR is based off [@kakkoyun's work](parca-dev#326) to use libbpf(go)'s batch APIs. **Context** The main issue we found while working with this API was that they were erroring with `EPERM`. After some debugging, we realised that libbpf wasn't handle with errors in the way we expected. The debugging write-up and more context can be found [here](aquasecurity/libbpfgo#159), and the fix is in [this PR](aquasecurity/libbpfgo#157). After landing these changes upstream, we pointed to the updated libbpfgo version, as well as added some [regression tests](parca-dev#381) to ensure that libbpfgo behaves as expected, and to make it easier in the future to write further compatibility tests. Note: the rest of the batch APIs error handling is still unfixed. Tracking in aquasecurity/libbpfgo#162.
javierhonduco
added a commit
to javierhonduco/parca-agent
that referenced
this pull request
May 5, 2022
This PR is based off [@kakkoyun's work](parca-dev#326) to use libbpf(go)'s batch APIs. **Context** The main issue we found while working with this API was that they were erroring with `EPERM`. After some debugging, we realised that libbpf wasn't handle with errors in the way we expected. The debugging write-up and more context can be found [here](aquasecurity/libbpfgo#159), and the fix is in [this PR](aquasecurity/libbpfgo#157). After landing these changes upstream, we pointed to the updated libbpfgo version, as well as added some [regression tests](parca-dev#381) to ensure that libbpfgo behaves as expected, and to make it easier in the future to write further compatibility tests. Note: the rest of the batch APIs error handling is still unfixed. Tracking in aquasecurity/libbpfgo#162.
javierhonduco
added a commit
to javierhonduco/parca-agent
that referenced
this pull request
May 5, 2022
This PR is based off [@kakkoyun's work](parca-dev#326) to use libbpf(go)'s batch APIs. **Context** The main issue we found while working with this API was that they were erroring with `EPERM`. After some debugging, we realised that libbpf wasn't handle with errors in the way we expected. The debugging write-up and more context can be found [here](aquasecurity/libbpfgo#159), and the fix is in [this PR](aquasecurity/libbpfgo#157). After landing these changes upstream, we pointed to the updated libbpfgo version, as well as added some [regression tests](parca-dev#381) to ensure that libbpfgo behaves as expected, and to make it easier in the future to write further compatibility tests. Note: the rest of the batch APIs error handling is still unfixed. Tracking in aquasecurity/libbpfgo#162.
javierhonduco
added a commit
to javierhonduco/parca-agent
that referenced
this pull request
May 5, 2022
This PR is based off [@kakkoyun's work](parca-dev#326) to use libbpf(go)'s batch APIs. **Context** The main issue we found while working with this API was that they were erroring with `EPERM`. After some debugging, we realised that libbpf wasn't handling errors in the way we expected. The debugging write-up and more context can be found [here](aquasecurity/libbpfgo#159), and the fix is in [this PR](aquasecurity/libbpfgo#157). After landing these changes upstream, we pointed to the updated libbpfgo version, as well as added some [regression tests](parca-dev#381) to ensure that libbpfgo behaves as expected, and to make it easier in the future to write further compatibility tests. Note: the rest of the batch APIs error handling is still unfixed. Tracking in aquasecurity/libbpfgo#162.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bump libbpfgo:
Ran:
Changes from the version we have until this pinned revision: aquasecurity/libbpfgo@v0.2.5-libbpf-0.7.0...80f4430.
This fixes a number of issues that were affecting us, including:
Add libbpfgo map tests:
To ensure that the libbpfgo invariants hold true. Adding these tests
will also help us with library upgrades, as well as configuration
changes in the way libbpf deals with errors, etc.
Test plan:
With ASAN: