-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: send logs to userspace + revamp (#14)
Update bpf_printk statements to be also sent to userspace so they can be logged alongside events. All log lines are considered errors and should be checked (unless running a debug eBPF binary). Revamps the CO-RE reads that were performed in the eBPF code to use slimmer types and to use BPF helper macros for readability. Adds more tests as well as ebpf benchmarks.
- Loading branch information
1 parent
3bccbf9
commit cbef761
Showing
34 changed files
with
3,483 additions
and
1,222 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
bpf/bpf_core_read.h linguist-vendored | ||
bpf/bpf_helper_defs.h linguist-vendored | ||
bpf/bpf_helpers.h linguist-vendored | ||
bpf/handler-bpfeb.o linguist-generated | ||
bpf/handler-bpfel.o linguist-generated | ||
bpf/vmlinux.h linguist-vendored | ||
bpf/bpf_core_read.h linguist-generated=true | ||
bpf/bpf_helper_defs.h linguist-generated=true | ||
bpf/bpf_helpers.h linguist-generated=true | ||
bpf/handler-bpfeb.o linguist-generated=true | ||
bpf/handler-bpfel.o linguist-generated=true | ||
bpf/vmlinux.h linguist-generated=true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,15 +29,15 @@ concurrency: | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
jobs: | ||
test-go: | ||
name: "test/go" | ||
test-go-enterprise: | ||
name: "test/go-enterprise" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: "^1.20.7" | ||
go-version: "^1.21.9" | ||
|
||
- name: Echo Go Cache Paths | ||
id: go-cache-paths | ||
|
@@ -57,59 +57,5 @@ jobs: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | ||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Install gotestsum | ||
uses: jaxxstorm/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
repo: gotestyourself/gotestsum | ||
tag: v1.10.1 | ||
|
||
- name: Test | ||
shell: bash | ||
run: | | ||
set +e | ||
gotestsum \ | ||
--junitfile="gotests.xml" \ | ||
--jsonfile="gotestsum.json" \ | ||
--packages="./..." \ | ||
--debug \ | ||
-- \ | ||
-exec sudo \ | ||
-parallel=8 \ | ||
-timeout=5m \ | ||
-short \ | ||
-failfast \ | ||
-covermode=atomic \ | ||
-coverprofile="gotests.coverage" \ | ||
-coverpkg=./... | ||
ret=$? | ||
set -e | ||
if ((ret)); then | ||
# Eternalize test timeout logs because "re-run failed" erases | ||
# artifacts and gotestsum doesn't always capture it: | ||
# https://github.com/gotestyourself/gotestsum/issues/292 | ||
# Multiple test packages could've failed, each one may or may | ||
# not run into the edge case. PS. Don't summon ShellCheck here. | ||
for testWithStack in $(grep 'panic: test timed out' gotestsum.json | grep -E -o '("Test":[^,}]*)'); do | ||
if [ -n "$testWithStack" ] && grep -q "${testWithStack}.*PASS" gotestsum.json; then | ||
echo "Conditions met for gotestsum stack trace missing bug, outputting panic trace:" | ||
grep -A 999999 "${testWithStack}.*panic: test timed out" gotestsum.json | ||
fi | ||
done | ||
fi | ||
exit $ret | ||
- uses: actions/upload-artifact@v3 | ||
if: success() || failure() | ||
with: | ||
name: gotestsum-debug.json | ||
path: ./gotestsum.json | ||
retention-days: 7 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: success() || failure() | ||
with: | ||
name: gotests.xml | ||
path: ./gotests.xml | ||
retention-days: 30 | ||
run: make test/go-enterprise |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,5 @@ build | |
*.tfplan | ||
*.lock.hcl | ||
.terraform/ | ||
|
||
/exectrace |
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
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
Oops, something went wrong.