refactor: cleanup the TLS ebpf functions#27
Merged
Merged
Conversation
Signed-off-by: Keming <kemingyang@tensorchord.ai>
There was a problem hiding this comment.
Pull request overview
This PR refactors the TLS-related eBPF probe implementations (OpenSSL + BoringSSL) by moving shared call/event emission logic into a common header and by splitting out dedicated write entry probes so read/write attach points map to the correct programs.
Changes:
- Introduces shared
call_info/call_info_exstructs and helper functions (new_call_info*,emit_ssl_events) intls/ssl_common.hand uses them from both OpenSSL and BoringSSL eBPF programs. - Adds missing write entry probes (OpenSSL + BoringSSL) and updates generated bpf2go bindings accordingly.
- Fixes probe attachment wiring and improves attach failure logging fields (notably for OpenSSL, and adds probe naming for BoringSSL).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tls/ssl_common.h | Adds shared call-info structs and reusable helpers for populating call info and emitting ringbuf events. |
| tls/ssl.bpf.c | Uses common helpers; adds ssl_write_entry / ssl_write_ex_entry programs and refactors event emission. |
| tls/boring.bpf.c | Uses common helpers; adds boring_ssl_write_entry program and refactors event emission. |
| tls/openssl.go | Corrects program-to-symbol mapping for SSL_write / SSL_write_ex and improves warning log fields. |
| tls/boring.go | Attaches distinct read/write entry programs and improves naming/log context for attached probes. |
| tls/ssl_x86_bpfel.go | Regenerates bindings to include new programs and updated call_info_ex layout. |
| tls/ssl_arm64_bpfel.go | Regenerates bindings to include new programs and updated call_info_ex layout. |
| tls/boring_x86_bpfel.go | Regenerates bindings to include new programs and updated program constants/Close() list. |
| tls/boring_arm64_bpfel.go | Regenerates bindings to include new programs and updated program constants/Close() list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Keming <kemingyang@tensorchord.ai>
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.
No description provided.