[0/2][CGROUP_SOCK_ADDR Logging] Refactor Log Infrastructure#485
Open
yaakov-stein wants to merge 3 commits intofacebook:mainfrom
Open
[0/2][CGROUP_SOCK_ADDR Logging] Refactor Log Infrastructure#485yaakov-stein wants to merge 3 commits intofacebook:mainfrom
CGROUP_SOCK_ADDR Logging] Refactor Log Infrastructure#485yaakov-stein wants to merge 3 commits intofacebook:mainfrom
Conversation
Claude review of PR #485 (fe77c33)Must fix
Suggestions
Nits
|
CGROUP_SOCK_ADDR Logging] Refactor Log Infrastructure
Rename the packet logging ELF stub from `log` to `pkt_log` to establish naming symmetry with the upcoming `sock_log` stub for socket-based hooks.
2bb9a67 to
c911410
Compare
c911410 to
7aeeab0
Compare
yaakov-stein
commented
Mar 27, 2026
| /** Destination address (4 bytes for IPv4, 16 for IPv6). */ | ||
| bf_aligned(8) __u8 daddr[sizeof(struct in6_addr)]; | ||
| } sock_addr; | ||
| } payload; |
Contributor
Author
There was a problem hiding this comment.
I'd ideally have left this unnamed as there isn't much of a benefit of naming it and it now requires ->payload.pkt/sock_addr, but doxygen requires unions to be named :(
7aeeab0 to
4a18e6d
Compare
4a18e6d to
4c82f48
Compare
Add a bf_log_type discriminator and restructure bf_log as a tagged union with packet and socket variants. Packet-specific fields (pkt_size, headers, l2hdr/l3hdr/l4hdr) move into the pkt variant. The sock variant (pid, comm) is defined but not yet populated. The struct sizes to the larger packet variant, so total size is unchanged for ring buffer reservations.
4c82f48 to
fe77c33
Compare
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.
Summary
Refactor the logging infrastructure to prepare for non-packet log types:
pkt_logto distinguish it from future non-packet stubsbf_logas a tagged union withpktandsock_addrvariantsbf_pkthdrtobf_log_optsince the enum will hold non-header optionsNo functional change (besides the
bf_log_typeenum helper methods).