kern/: refactor eBPF kernel code — extract headers, normalize style#955
Draft
kern/: refactor eBPF kernel code — extract headers, normalize style#955
Conversation
…e unused variables Co-authored-by: cfc4n <709947+cfc4n@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor eBPF kernel code in ./kern/ directory
kern/: refactor eBPF kernel code — extract headers, normalize style
Mar 15, 2026
✅ E2E Test Results: PASSEDTest Run: #23113892002 Tests Executed:
✅ All e2e tests passed successfully! The TLS capture functionality is working correctly. Automated e2e test results for commit 97e54e6 |
This file contains hidden or 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
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.
Refactor the
./kern/eBPF C code to separate declarations from implementations, eliminate dead code, and normalize style.bpf/*,boringssl*_kern.c,gnutls*_kern.c, andopenssl*_kern.care untouched.Changes
New
kern/nspr.h— extracts structs, BPF maps, and helper functions out ofnspr_kern.cinto a dedicated header, matching the pattern ofopenssl.h/gnutls.h. Renames genericssl_*symbols tonspr_*to avoid collision with OpenSSL's identically-named types:go_argument.h— all three helper functions (go_get_argument_by_reg,go_get_argument_by_stack,go_get_argument) changed from plain non-staticdefinitions tostatic __always_inline, preventing multiple-definition errors if included in multiple translation units and following eBPF inline conventions.zsh_kern.c— added the missing Apache 2.0 license header present in every other*_kern.cfile.Dead code removal — removed unused
uid/current_uid_gidvariable declarations (the corresponding structs have nouidfield) from:nspr_kern.c(all 4 probe functions)mysqld_kern.c(all 4 probe functions)openssl.h(kretprobe_connect,probe_SSL_set_fd)bash_kern.c(uretprobe_bash_retval)🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.