[1/2] Add flavor-specific log codegen callback#486
Open
yaakov-stein wants to merge 4 commits intofacebook:mainfrom
Open
[1/2] Add flavor-specific log codegen callback#486yaakov-stein wants to merge 4 commits intofacebook:mainfrom
yaakov-stein wants to merge 4 commits intofacebook:mainfrom
Conversation
Claude review was cancelled — see workflow run for details. |
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
86913cd to
219c17e
Compare
219c17e to
527d9cd
Compare
527d9cd to
6fa1882
Compare
6fa1882 to
e014ec7
Compare
e014ec7 to
5b8142a
Compare
This was referenced Mar 29, 2026
CGROUP_SOCK_ADDR Logging] Add flavor-specific log codegen callback5b8142a to
af4ef14
Compare
qdeslandes
requested changes
Mar 30, 2026
af4ef14 to
9ecc187
Compare
9ecc187 to
1ac5fdd
Compare
1ac5fdd to
91afd74
Compare
| #define static_assert _Static_assert | ||
| #endif | ||
|
|
||
| #include <linux/in6.h> |
There was a problem hiding this comment.
Claude: suggestion: <linux/in6.h> is needed only for sizeof(struct in6_addr) in struct bf_log_sock_addr, which has no producers or consumers yet (part 2/2). It widens the include set for all BPF stubs and all files that include runtime.h. Consider using __u8 saddr[16] / __u8 daddr[16] instead to avoid pulling in the header.
Also, <linux/in6.h> and <asm/types.h> are both system headers but are separated by a blank line, breaking the include-group convention from the style guide.
qdeslandes
previously approved these changes
Apr 1, 2026
91afd74 to
e840d57
Compare
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.
Restructure bf_log as a tagged union with packet and socket address variants, discriminated by bf_log_type.
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.
e840d57 to
5cc7d36
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.
Gave
stack-pra try, but it doesn't allow for multi-commit PR's :(Stack:
CGROUP_SOCK_ADDRLogging Infrastructure #491Summary
The main goal here is to add a callback that gives flavors the ability to more finely control the logging process. This will enable us to easily use a new
CGROUP_SOCK_ADDRelf-stub.Notes
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.