[1/2][CGROUP_SOCK_ADDR Logging] Add flavor-specific log codegen callback#486
Open
yaakov-stein wants to merge 5 commits intofacebook:mainfrom
Open
[1/2][CGROUP_SOCK_ADDR Logging] Add flavor-specific log codegen callback#486yaakov-stein wants to merge 5 commits intofacebook:mainfrom
CGROUP_SOCK_ADDR Logging] Add flavor-specific log codegen callback#486yaakov-stein wants to merge 5 commits intofacebook:mainfrom
Conversation
Claude review of PR #486 (e014ec7)
Must fix
Suggestions
Nits
|
CGROUP_SOCK_ADDR Logging] Extract log codegen callback
CGROUP_SOCK_ADDR Logging] Extract log codegen callbackCGROUP_SOCK_ADDR Logging] Add flavor-specific log codegen callback
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.
86913cd to
219c17e
Compare
219c17e to
527d9cd
Compare
527d9cd to
6fa1882
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.
Move packet.c/h from cgen/matcher/ to cgen/ and rename bf_matcher_generate_packet() to bf_packet_gen_inline_matcher(). This file provides shared codegen utilities for all packet-based flavors, not a matcher implementation, and will host additional shared packet codegen like bf_packet_gen_inline_log() in subsequent commits.
6fa1882 to
e014ec7
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.
Relies on #485 - gave
stack-pra try, but it doesn't allow for multi-commit PR's :(Summary
Move log codegen into a per-flavor callback so each flavor controls its own register setup and ELF stub selection:
cgen/matcher/packet.{c,h}tocgen/packet.{c,h}. It was a mistake to put this here in the first place as packet-based flavors can share more than matcher codegen. We correct the placement now.gen_inline_logtobf_flavor_ops, withbf_packet_gen_inline_log()as the shared implementation for all packet flavors.