Copilot commented on code in PR #209:
URL: https://github.com/apache/skywalking-rover/pull/209#discussion_r3479838094
##########
bpf/include/protocol_analyzer.h:
##########
@@ -178,7 +178,7 @@ static __inline __u32 infer_http2_message(const char* buf,
size_t count) {
return CONNECTION_MESSAGE_TYPE_UNKNOWN;
}
-static __inline __u32 analyze_protocol(char *buf, __u32 count, __u8
*protocol_ref) {
+static __noinline __u32 analyze_protocol(char *buf, __u32 count, __u8
*protocol_ref) {
Review Comment:
`protocol_analyzer.h` uses the new `__noinline` macro, but this header
doesn’t include `api.h` (where the PR defines `__noinline`). It is currently
included by `socket_data.h` *before* `queue.h` (which includes `api.h`), so
whether this compiles depends on toolchain/kernel headers defining `__noinline`
externally. Making the no-inline attribute self-contained here avoids a fragile
include-order dependency.
##########
bpf/include/socket_reader.h:
##########
@@ -30,7 +30,7 @@ struct {
__uint(max_entries, 1);
} socket_buffer_reader_map SEC(".maps");
-static __inline struct socket_buffer_reader_t* read_socket_data(char* buf,
struct iovec *iovec, __u32 bytes_count) {
+static __noinline struct socket_buffer_reader_t* read_socket_data(char* buf,
struct iovec *iovec, __u32 bytes_count) {
Review Comment:
`socket_reader.h` now uses `__noinline` and also allocates `struct iovec
iov;` inside `read_socket_data()`, but the header only includes
`socket_opts.h`. This makes the header depend on being included *after* `api.h`
for both `__noinline` and the `struct iovec` definition, which is brittle and
can break compilation if include order changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]