diff --git a/bpf/http2_grpc.h b/bpf/http2_grpc.h index cbafd2224..8e7fc3b8d 100644 --- a/bpf/http2_grpc.h +++ b/bpf/http2_grpc.h @@ -8,10 +8,6 @@ #define HTTP2_GRPC_PREFACE "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" -#define FRAME_HEADER_LEN 9 - -#define FLAG_DATA_END_STREAM 0x1 - typedef enum { FrameData = 0x0, FrameHeaders = 0x1, @@ -33,10 +29,14 @@ typedef struct frame_header { u32 stream_id : 31; } __attribute__((packed)) frame_header_t; +enum { k_flag_data_end_stream = 0x1, k_frame_header_len = 9 }; + +_Static_assert(sizeof(frame_header_t) == k_frame_header_len, "frame_header_t size mismatch"); + static __always_inline u8 read_http2_grpc_frame_header(frame_header_t *frame, const unsigned char *p, u32 len) { - if (len < FRAME_HEADER_LEN) { + if (len < k_frame_header_len) { return 0; } @@ -61,7 +61,7 @@ static __always_inline u8 is_settings_frame(unsigned char *p, u32 len) { return frame.type == FrameSettings && !frame.stream_id; } -static __always_inline u8 is_headers_frame(frame_header_t *frame) { +static __always_inline u8 is_headers_frame(const frame_header_t *frame) { return frame->type == FrameHeaders && frame->stream_id; } @@ -87,20 +87,20 @@ static __always_inline u8 is_http2_or_grpc(unsigned char *p, u32 len) { return has_preface(p, len) || is_settings_frame(p, len); } -static __always_inline u8 http_grpc_stream_ended(frame_header_t *frame) { +static __always_inline u8 http_grpc_stream_ended(const frame_header_t *frame) { return is_headers_frame(frame) && - ((frame->flags & FLAG_DATA_END_STREAM) == FLAG_DATA_END_STREAM); + ((frame->flags & k_flag_data_end_stream) == k_flag_data_end_stream); } -static __always_inline u8 is_invalid_frame(frame_header_t *frame) { +static __always_inline u8 is_invalid_frame(const frame_header_t *frame) { return frame->length == 0 && frame->type == FrameData; } -static __always_inline u8 is_data_frame(frame_header_t *frame) { +static __always_inline u8 is_data_frame(const frame_header_t *frame) { return frame->length && frame->type == FrameData; } -static __always_inline u8 is_flags_only_frame(frame_header_t *frame) { +static __always_inline u8 is_flags_only_frame(const frame_header_t *frame) { return frame->length <= 2; } diff --git a/bpf/k_tracer_defs.h b/bpf/k_tracer_defs.h index 867c10706..23865479e 100644 --- a/bpf/k_tracer_defs.h +++ b/bpf/k_tracer_defs.h @@ -4,6 +4,7 @@ #include "vmlinux.h" #include "bpf_helpers.h" #include "http_types.h" +#include "k_tracer_tailcall.h" #include "ringbuf.h" #include "pid.h" #include "trace_common.h" @@ -25,13 +26,6 @@ typedef struct recv_args { u8 iovec_ctx[sizeof(iovec_iter_ctx)]; } recv_args_t; -struct bpf_map_def SEC("maps") jump_table = { - .type = BPF_MAP_TYPE_PROG_ARRAY, - .key_size = sizeof(__u32), - .value_size = sizeof(__u32), - .max_entries = 8, -}; - struct { __uint(type, BPF_MAP_TYPE_LRU_HASH); __type(key, egress_key_t); @@ -40,16 +34,12 @@ struct { __uint(pinning, BEYLA_PIN_INTERNAL); } msg_buffers SEC(".maps"); -#define TAIL_PROTOCOL_HTTP 0 -#define TAIL_PROTOCOL_HTTP2 1 -#define TAIL_PROTOCOL_TCP 2 - static __always_inline void handle_buf_with_args(void *ctx, call_protocol_args_t *args) { bpf_dbg_printk( "buf=[%s], pid=%d, len=%d", args->small_buf, args->pid_conn.pid, args->bytes_len); if (is_http(args->small_buf, MIN_HTTP_SIZE, &args->packet_type)) { - bpf_tail_call(ctx, &jump_table, TAIL_PROTOCOL_HTTP); + bpf_tail_call(ctx, &jump_table, k_tail_protocol_http); } else if (is_http2_or_grpc(args->small_buf, MIN_HTTP2_SIZE)) { bpf_dbg_printk("Found HTTP2 or gRPC connection"); u8 is_ssl = args->ssl; @@ -57,7 +47,7 @@ static __always_inline void handle_buf_with_args(void *ctx, call_protocol_args_t } else { u8 *h2g = bpf_map_lookup_elem(&ongoing_http2_connections, &args->pid_conn); if (h2g && *h2g == args->ssl) { - bpf_tail_call(ctx, &jump_table, TAIL_PROTOCOL_HTTP2); + bpf_tail_call(ctx, &jump_table, k_tail_protocol_http2); } else { // large request tracking http_info_t *info = bpf_map_lookup_elem(&ongoing_http, &args->pid_conn); @@ -70,7 +60,7 @@ static __always_inline void handle_buf_with_args(void *ctx, call_protocol_args_t // Essentially, when a packet is extended by our sock_msg program and // passed down another service, the receiving side may reassemble the // packets into one buffer or not. If they are reassembled, then the - // call to bpf_tail_call(ctx, &jump_table, TAIL_PROTOCOL_HTTP); will + // call to bpf_tail_call(ctx, &jump_table, k_tail_protocol_http); will // scan for the incoming 'Traceparent' header. If they are not reassembled // we'll see something like this: // [before the injected header],[70 bytes for 'Traceparent...'],[the rest]. @@ -109,7 +99,7 @@ static __always_inline void handle_buf_with_args(void *ctx, call_protocol_args_t // we are processing SSL request. HTTP2 is already checked in handle_buf_with_connection. http_info_t *http_info = bpf_map_lookup_elem(&ongoing_http, &args->pid_conn); if (!http_info) { - bpf_tail_call(ctx, &jump_table, TAIL_PROTOCOL_TCP); + bpf_tail_call(ctx, &jump_table, k_tail_protocol_tcp); } } } diff --git a/bpf/k_tracer_tailcall.h b/bpf/k_tracer_tailcall.h new file mode 100644 index 000000000..c77306bd1 --- /dev/null +++ b/bpf/k_tracer_tailcall.h @@ -0,0 +1,23 @@ +#ifndef K_TRACER_TAILCALL_H +#define K_TRACER_TAILCALL_H + +#include "vmlinux.h" +#include "bpf_helpers.h" + +struct bpf_map_def SEC("maps") jump_table = { + .type = BPF_MAP_TYPE_PROG_ARRAY, + .key_size = sizeof(__u32), + .value_size = sizeof(__u32), + .max_entries = 8, +}; + +enum { + k_tail_protocol_http = 0, + k_tail_protocol_http2 = 1, + k_tail_protocol_tcp = 2, + k_tail_protocol_http2_grpc_frames = 3, + k_tail_protocol_http2_grpc_handle_start_frame = 4, + k_tail_protocol_http2_grpc_handle_end_frame = 5, +}; + +#endif diff --git a/bpf/protocol_http.h b/bpf/protocol_http.h index a559a676e..2ba6807ae 100644 --- a/bpf/protocol_http.h +++ b/bpf/protocol_http.h @@ -307,7 +307,7 @@ static __always_inline void handle_http_response(unsigned char *small_buf, bpf_map_delete_elem(&active_ssl_connections, pid_conn); } -// TAIL_PROTOCOL_HTTP +// k_tail_protocol_http SEC("kprobe/http") int protocol_http(void *ctx) { call_protocol_args_t *args = protocol_args(); diff --git a/bpf/protocol_http2.h b/bpf/protocol_http2.h index 57969cd53..692b22e1c 100644 --- a/bpf/protocol_http2.h +++ b/bpf/protocol_http2.h @@ -3,11 +3,12 @@ #include "vmlinux.h" #include "bpf_helpers.h" -#include "http_types.h" -#include "ringbuf.h" -#include "protocol_common.h" #include "http2_grpc.h" +#include "http_types.h" +#include "k_tracer_tailcall.h" #include "pin_internal.h" +#include "protocol_common.h" +#include "ringbuf.h" struct { __uint(type, BPF_MAP_TYPE_LRU_HASH); @@ -24,6 +25,30 @@ struct { __uint(pinning, BEYLA_PIN_INTERNAL); } ongoing_http2_grpc SEC(".maps"); +typedef struct grpc_frames_ctx { + http2_grpc_request_t prev_info; + u8 has_prev_info; + + int pos; //FIXME should be size_t equivalent + int saved_buf_pos; + u32 saved_stream_id; + + u8 found_data_frame; + u8 iterations; + u8 terminate_search; + + http2_conn_stream_t stream; + + call_protocol_args_t args; +} grpc_frames_ctx_t; + +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __type(key, int); + __type(value, grpc_frames_ctx_t); + __uint(max_entries, 1); +} grpc_frames_ctx_mem SEC(".maps"); + // We want to be able to collect larger amount of data for the grpc/http headers struct { __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); @@ -32,6 +57,11 @@ struct { __uint(max_entries, 1); } http2_info_mem SEC(".maps"); +static __always_inline grpc_frames_ctx_t *grpc_ctx() { + int zero = 0; + return bpf_map_lookup_elem(&grpc_frames_ctx_mem, &zero); +} + static __always_inline http2_grpc_request_t *empty_http2_info() { int zero = 0; http2_grpc_request_t *value = bpf_map_lookup_elem(&http2_info_mem, &zero); @@ -95,113 +125,222 @@ http2_grpc_end(http2_conn_stream_t *stream, http2_grpc_request_t *prev_info, voi bpf_map_delete_elem(&ongoing_http2_grpc, stream); } -static __always_inline void process_http2_grpc_frames(pid_connection_info_t *pid_conn, - void *u_buf, - int bytes_len, - u8 direction, - u8 ssl, - u16 orig_dport) { - int pos = 0; - u8 found_start_frame = 0; - u8 found_end_frame = 0; - - http2_grpc_request_t *prev_info = 0; - u32 saved_stream_id = 0; - int saved_buf_pos = 0; - u8 found_data_frame = 0; - http2_conn_stream_t stream = {0}; - stream.pid_conn = *pid_conn; - - unsigned char frame_buf[FRAME_HEADER_LEN]; - frame_header_t frame = {0}; - - for (int i = 0; i < 8; i++) { - if (pos >= bytes_len) { +static __always_inline frame_header_t next_frame(const grpc_frames_ctx_t *g_ctx) { + // read next frame + const void *offset = (u8 *)g_ctx->args.u_buf + g_ctx->pos; + + frame_header_t header; + + if (bpf_probe_read(&header, sizeof(header), offset) != 0) { + bpf_dbg_printk("failed to read frame header"); + return header; // the caller will deal with an invalid header + } + + if (header.length == 0 || header.type > FrameContinuation) { + return header; // the caller will deal with an invalid header + } + + header.length = bpf_ntohl(header.length << 8); + header.stream_id = bpf_ntohl(header.stream_id << 1); + + //bpf_dbg_printk("http2 frame type = %u, len = %u", header.type, header.length); + //bpf_dbg_printk("http2 frame stream_id = %u, flags = %u", header.stream_id, header.flags); + + return header; +} + +static __always_inline void update_prev_info(grpc_frames_ctx_t *g_ctx) { + if (g_ctx->has_prev_info) { + return; + } + + const http2_grpc_request_t *prev_info = + bpf_map_lookup_elem(&ongoing_http2_grpc, &g_ctx->stream); + + if (prev_info) { + g_ctx->prev_info = *prev_info; + g_ctx->has_prev_info = 1; + } +} + +static __always_inline int +handle_headers_frame(void *ctx, grpc_frames_ctx_t *g_ctx, const frame_header_t *frame) { + g_ctx->stream.stream_id = frame->stream_id; + + // if we don't have prev_info, try looking it up... + update_prev_info(g_ctx); + + if (g_ctx->has_prev_info) { + g_ctx->saved_stream_id = g_ctx->stream.stream_id; + g_ctx->saved_buf_pos = g_ctx->pos; + + if (http_grpc_stream_ended(frame)) { + bpf_tail_call(ctx, &jump_table, k_tail_protocol_http2_grpc_handle_end_frame); + return 0; // normally unrechable + } + } else { + // Not starting new grpc request, found end frame in a start, likely + // just terminating prev connection + if (!(is_flags_only_frame(frame) && http_grpc_stream_ended(frame))) { + bpf_tail_call(ctx, &jump_table, k_tail_protocol_http2_grpc_handle_start_frame); + return 0; // normally unrechable + } + } + + return 1; +} + +static __always_inline void handle_data_frame(void *ctx, grpc_frames_ctx_t *g_ctx) { + if (!g_ctx->has_prev_info || !g_ctx->saved_stream_id) { + // we haven't found anything useful... + return; + } + + const u8 type = g_ctx->prev_info.type; + const u8 direction = g_ctx->args.direction; + + if (g_ctx->found_data_frame || ((type == EVENT_HTTP_REQUEST) && (direction == TCP_SEND)) || + ((type == EVENT_HTTP_CLIENT) && (direction == TCP_RECV))) { + + g_ctx->stream.pid_conn = g_ctx->args.pid_conn; + g_ctx->stream.stream_id = g_ctx->saved_stream_id; + + bpf_tail_call(ctx, &jump_table, k_tail_protocol_http2_grpc_handle_end_frame); + } +} + +// k_tail_protocol_http2_grpc_handle_start_frame +SEC("kprobe/http2") +int protocol_http2_grpc_handle_start_frame(void *ctx) { + (void)ctx; + + grpc_frames_ctx_t *g_ctx = grpc_ctx(); + + if (!g_ctx) { + return 0; + } + + const call_protocol_args_t *args = &g_ctx->args; + + void *offset = (u8 *)args->u_buf + g_ctx->pos; + + http2_grpc_start( + &g_ctx->stream, offset, args->bytes_len, args->direction, args->ssl, args->orig_dport); + + return 0; +} + +// k_tail_protocol_http2_grpc_handle_end_frame +SEC("kprobe/http2") +int protocol_http2_grpc_handle_end_frame(void *ctx) { + (void)ctx; + + grpc_frames_ctx_t *g_ctx = grpc_ctx(); + + if (!g_ctx) { + return 0; + } + + const u8 req_type = request_type_by_direction(g_ctx->args.direction, PACKET_TYPE_RESPONSE); + + if (req_type == g_ctx->prev_info.type) { + u32 buf_pos = g_ctx->saved_buf_pos; + + bpf_clamp_umax(buf_pos, IO_VEC_MAX_LEN); + + void *offset = (u8 *)g_ctx->args.u_buf + buf_pos; + http2_grpc_end(&g_ctx->stream, &g_ctx->prev_info, offset); + + bpf_map_delete_elem(&active_ssl_connections, &g_ctx->args.pid_conn); + } else { + bpf_dbg_printk("grpc request/response mismatch, req_type %d, prev_info->type %d", + req_type, + g_ctx->prev_info.type); + bpf_map_delete_elem(&ongoing_http2_grpc, &g_ctx->stream); + } + + return 0; +} + +// k_tail_protocol_http2_grpc_frames +// this function scans a raw buffer and tries to find GRPC frames on it +// (represented by 'frame_header_t'). We care about 3 kinds of frames: start +// frames, end frames and data frames. Start and end frames are used as anchor +// points to determine the lifespan of a GRPC connection, and the data frames +// are used as a fallback mechanism in case those are found. We use that +// information to evaluate whether the parsed data is potentially a GRPC +// frame, and if so, we ship it to userspace for further processing. +SEC("kprobe/http2") +int protocol_http2_grpc_frames(void *ctx) { + const u8 k_max_loop_iterations = 4; // the maximum number of the for loop iterations + const u8 k_loop_count = 3; // the number of times we will retry the loop + const u8 k_iterations = k_max_loop_iterations * k_loop_count; + + grpc_frames_ctx_t *g_ctx = grpc_ctx(); + + if (!g_ctx) { + return 0; + } + + // this loop will effectively run for k_iterations, split between the + // unrolled for loop and the tail call (see comment after the loop) + for (u8 i = 0; i < k_max_loop_iterations; ++i) { + g_ctx->iterations++; + + if (g_ctx->pos >= g_ctx->args.bytes_len) { break; } - bpf_probe_read(&frame_buf, FRAME_HEADER_LEN, (void *)((u8 *)u_buf + pos)); - read_http2_grpc_frame_header(&frame, frame_buf, FRAME_HEADER_LEN); - //bpf_dbg_printk("http2 frame type = %d, len = %d, stream_id = %d, flags = %d", frame.type, frame.length, frame.stream_id, frame.flags); - - if (is_headers_frame(&frame)) { - stream.stream_id = frame.stream_id; - if (!prev_info) { - prev_info = bpf_map_lookup_elem(&ongoing_http2_grpc, &stream); - } - - if (prev_info) { - saved_stream_id = stream.stream_id; - saved_buf_pos = pos; - if (http_grpc_stream_ended(&frame)) { - found_end_frame = 1; - break; - } - } else { - // Not starting new grpc request, found end frame in a start, likely just terminating prev connection - if (!(is_flags_only_frame(&frame) && http_grpc_stream_ended(&frame))) { - found_start_frame = 1; - break; - } - } + const frame_header_t frame = next_frame(g_ctx); + + // if handle_headers_frame returns 0, it means bpf_tail_call has + // failed and something is very wrong, so we just bail... + if (is_headers_frame(&frame) && !handle_headers_frame(ctx, g_ctx, &frame)) { + //bpf_dbg_printk("http2 bpf_tail_call failed"); + return 0; } if (is_data_frame(&frame)) { - found_data_frame = 1; + g_ctx->found_data_frame = 1; } if (is_invalid_frame(&frame)) { + g_ctx->terminate_search = 1; //bpf_dbg_printk("Invalid frame, terminating search"); break; } - if (frame.length + FRAME_HEADER_LEN >= bytes_len) { + if (frame.length + k_frame_header_len >= g_ctx->args.bytes_len) { + g_ctx->terminate_search = 1; //bpf_dbg_printk("Frame length bigger than bytes len"); break; } - if (pos < (bytes_len - (frame.length + FRAME_HEADER_LEN))) { - pos += (frame.length + FRAME_HEADER_LEN); - //bpf_dbg_printk("New buf read pos = %d", pos); + if (g_ctx->pos < (g_ctx->args.bytes_len - (frame.length + k_frame_header_len))) { + g_ctx->pos += (frame.length + k_frame_header_len); + //bpf_dbg_printk("New buf read g_ctx.pos = %d", g_ctx->pos); } } - if (found_start_frame) { - http2_grpc_start( - &stream, (void *)((u8 *)u_buf + pos), bytes_len, direction, ssl, orig_dport); - } else { - // We only loop 6 times looking for the stream termination. If the data packed is large we'll miss the - // frame saying the stream closed. In that case we try this backup path. - if (!found_end_frame && prev_info && saved_stream_id) { - if (found_data_frame || - ((prev_info->type == EVENT_HTTP_REQUEST) && (direction == TCP_SEND)) || - ((prev_info->type == EVENT_HTTP_CLIENT) && (direction == TCP_RECV))) { - stream.pid_conn = *pid_conn; - stream.stream_id = saved_stream_id; - found_end_frame = 1; - } - } - if (found_end_frame) { - u8 req_type = request_type_by_direction(direction, PACKET_TYPE_RESPONSE); - if (prev_info) { - if (req_type == prev_info->type) { - u32 buf_pos = saved_buf_pos; - bpf_clamp_umax(buf_pos, IO_VEC_MAX_LEN); - http2_grpc_end(&stream, prev_info, (void *)((u8 *)u_buf + buf_pos)); - bpf_map_delete_elem(&active_ssl_connections, pid_conn); - } else { - bpf_dbg_printk( - "grpc request/response mismatch, req_type %d, prev_info->type %d", - req_type, - prev_info->type); - bpf_map_delete_elem(&ongoing_http2_grpc, &stream); - } - } - } + // this is a weird recursion - we can't loop many times above because the + // verifier will reject this program as too complex, we don't want to use + // bpf_loop() as we need to support kernels < 5.17, and finally we don't + // want to abuse bpf_tail_call as things can get slow (and limited), so we + // use this mirror-cracking hybrid approach + if (!g_ctx->terminate_search && g_ctx->iterations < k_iterations) { + bpf_tail_call(ctx, &jump_table, k_tail_protocol_http2_grpc_frames); + return 0; // unreachable, but bail safely if bpf_tail_call fails } + + // We only loop N times looking for the stream termination. If the data + // packed is large we'll miss the frame saying the stream closed. In that + // case we try this backup path, which will tail call on success. + handle_data_frame(ctx, g_ctx); + + return 0; } -// TAIL_PROTOCOL_HTTP2 +// k_tail_protocol_http2 SEC("kprobe/http2") int protocol_http2(void *ctx) { call_protocol_args_t *args = protocol_args(); @@ -210,12 +349,17 @@ int protocol_http2(void *ctx) { return 0; } - process_http2_grpc_frames(&args->pid_conn, - (void *)args->u_buf, - args->bytes_len, - args->direction, - args->ssl, - args->orig_dport); + grpc_frames_ctx_t *g_ctx = grpc_ctx(); + + if (!g_ctx) { + return 0; + } + + __builtin_memset(g_ctx, 0, sizeof(*g_ctx)); + g_ctx->args = *args; + g_ctx->stream.pid_conn = args->pid_conn; + + bpf_tail_call(ctx, &jump_table, k_tail_protocol_http2_grpc_frames); return 0; } diff --git a/bpf/protocol_tcp.h b/bpf/protocol_tcp.h index dc086136c..81a3feb54 100644 --- a/bpf/protocol_tcp.h +++ b/bpf/protocol_tcp.h @@ -172,7 +172,7 @@ static __always_inline void handle_unknown_tcp_connection(pid_connection_info_t } } -// TAIL_PROTOCOL_TCP +// k_tail_protocol_tcp SEC("kprobe/tcp") int protocol_tcp(void *ctx) { call_protocol_args_t *args = protocol_args(); diff --git a/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.go index e2e7dd9c0..bd9561870 100644 --- a/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.go @@ -36,6 +36,21 @@ type bpfEgressKeyT struct { D_port uint16 } +type bpfGrpcFramesCtxT struct { + PrevInfo bpfHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpfHttp2ConnStreamT + Args bpfCallProtocolArgsT +} + type bpfHttp2ConnStreamT struct { PidConn bpfPidConnectionInfoT StreamId uint32 @@ -253,40 +268,43 @@ type bpfSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpfProgramSpecs struct { - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` } // bpfMapSpecs contains maps before they are loaded into the kernel. @@ -309,6 +327,7 @@ type bpfMapSpecs struct { CloneMap *ebpf.MapSpec `ebpf:"clone_map"` ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -371,6 +390,7 @@ type bpfMaps struct { CloneMap *ebpf.Map `ebpf:"clone_map"` ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -416,6 +436,7 @@ func (m *bpfMaps) Close() error { m.CloneMap, m.ConnectionMetaMem, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -448,40 +469,43 @@ func (m *bpfMaps) Close() error { // // It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. type bpfPrograms struct { - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` } func (p *bpfPrograms) Close() error { @@ -507,6 +531,9 @@ func (p *bpfPrograms) Close() error { p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SocketHttpFilter, p.UprobeSslDoHandshake, diff --git a/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.o index 0942b3e58..8225c22dd 100644 --- a/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.o +++ b/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1b8e80f99ca0d4aec3d9f1b7669d81d1593e57eab17b98c45cf2496bda620304 -size 636872 +oid sha256:f380d7d7c77b20fca265c45b9de1a1521c63d4aaa2fe5ca2eb1c89aad8bc091b +size 644568 diff --git a/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.go index 5ddf548d3..f28fdbe99 100644 --- a/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.go @@ -36,6 +36,21 @@ type bpf_debugEgressKeyT struct { D_port uint16 } +type bpf_debugGrpcFramesCtxT struct { + PrevInfo bpf_debugHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpf_debugHttp2ConnStreamT + Args bpf_debugCallProtocolArgsT +} + type bpf_debugHttp2ConnStreamT struct { PidConn bpf_debugPidConnectionInfoT StreamId uint32 @@ -253,40 +268,43 @@ type bpf_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_debugProgramSpecs struct { - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` } // bpf_debugMapSpecs contains maps before they are loaded into the kernel. @@ -310,6 +328,7 @@ type bpf_debugMapSpecs struct { ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` DebugEvents *ebpf.MapSpec `ebpf:"debug_events"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -373,6 +392,7 @@ type bpf_debugMaps struct { ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` DebugEvents *ebpf.Map `ebpf:"debug_events"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -419,6 +439,7 @@ func (m *bpf_debugMaps) Close() error { m.ConnectionMetaMem, m.DebugEvents, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -451,40 +472,43 @@ func (m *bpf_debugMaps) Close() error { // // It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_debugPrograms struct { - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` } func (p *bpf_debugPrograms) Close() error { @@ -510,6 +534,9 @@ func (p *bpf_debugPrograms) Close() error { p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SocketHttpFilter, p.UprobeSslDoHandshake, diff --git a/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.o index 89ba715f2..2af9aef91 100644 --- a/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dd02b702152f5df04f3776927f5e01abc30de46b178451acb0547ad26f0c8485 -size 1074272 +oid sha256:4a931ec421a75d9778f4723961845bb28baea93cd294f2146507a69231039f37 +size 1083456 diff --git a/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.go index 954a36b8a..bd5b63c9a 100644 --- a/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.go @@ -36,6 +36,21 @@ type bpf_debugEgressKeyT struct { D_port uint16 } +type bpf_debugGrpcFramesCtxT struct { + PrevInfo bpf_debugHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpf_debugHttp2ConnStreamT + Args bpf_debugCallProtocolArgsT +} + type bpf_debugHttp2ConnStreamT struct { PidConn bpf_debugPidConnectionInfoT StreamId uint32 @@ -253,40 +268,43 @@ type bpf_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_debugProgramSpecs struct { - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` } // bpf_debugMapSpecs contains maps before they are loaded into the kernel. @@ -310,6 +328,7 @@ type bpf_debugMapSpecs struct { ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` DebugEvents *ebpf.MapSpec `ebpf:"debug_events"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -373,6 +392,7 @@ type bpf_debugMaps struct { ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` DebugEvents *ebpf.Map `ebpf:"debug_events"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -419,6 +439,7 @@ func (m *bpf_debugMaps) Close() error { m.ConnectionMetaMem, m.DebugEvents, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -451,40 +472,43 @@ func (m *bpf_debugMaps) Close() error { // // It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_debugPrograms struct { - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` } func (p *bpf_debugPrograms) Close() error { @@ -510,6 +534,9 @@ func (p *bpf_debugPrograms) Close() error { p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SocketHttpFilter, p.UprobeSslDoHandshake, diff --git a/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.o index 3fa10cd11..a2b9c910f 100644 --- a/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:41c9d1462904fbe9392ef81f372fb399c3085d7d6475197cd76c7c0552fe25ee -size 1073840 +oid sha256:ab332dee7a243751d0065016ca4300ec555a5c436c557c93215d2f96161a3473 +size 1083024 diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.go index 2b2297043..91ffba4ae 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.go @@ -36,6 +36,21 @@ type bpf_tpEgressKeyT struct { D_port uint16 } +type bpf_tpGrpcFramesCtxT struct { + PrevInfo bpf_tpHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpf_tpHttp2ConnStreamT + Args bpf_tpCallProtocolArgsT +} + type bpf_tpHttp2ConnStreamT struct { PidConn bpf_tpPidConnectionInfoT StreamId uint32 @@ -253,40 +268,43 @@ type bpf_tpSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tpProgramSpecs struct { - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` } // bpf_tpMapSpecs contains maps before they are loaded into the kernel. @@ -309,6 +327,7 @@ type bpf_tpMapSpecs struct { CloneMap *ebpf.MapSpec `ebpf:"clone_map"` ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -371,6 +390,7 @@ type bpf_tpMaps struct { CloneMap *ebpf.Map `ebpf:"clone_map"` ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -416,6 +436,7 @@ func (m *bpf_tpMaps) Close() error { m.CloneMap, m.ConnectionMetaMem, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -448,40 +469,43 @@ func (m *bpf_tpMaps) Close() error { // // It can be passed to loadBpf_tpObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tpPrograms struct { - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` } func (p *bpf_tpPrograms) Close() error { @@ -507,6 +531,9 @@ func (p *bpf_tpPrograms) Close() error { p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SocketHttpFilter, p.UprobeSslDoHandshake, diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.o index 36219046b..96979cc69 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.o +++ b/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9532e686253334ff9b887be3f1f5d7e55de14af21a12e358acb2d16f190e3d11 -size 651360 +oid sha256:c7b83fcb664d296dc1f4998e16bc8591fb20ec587438c6b6060c71fd2af82eae +size 659056 diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.go index 9e3efec9d..7064503b5 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.go @@ -36,6 +36,21 @@ type bpf_tp_debugEgressKeyT struct { D_port uint16 } +type bpf_tp_debugGrpcFramesCtxT struct { + PrevInfo bpf_tp_debugHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpf_tp_debugHttp2ConnStreamT + Args bpf_tp_debugCallProtocolArgsT +} + type bpf_tp_debugHttp2ConnStreamT struct { PidConn bpf_tp_debugPidConnectionInfoT StreamId uint32 @@ -253,40 +268,43 @@ type bpf_tp_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tp_debugProgramSpecs struct { - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` } // bpf_tp_debugMapSpecs contains maps before they are loaded into the kernel. @@ -310,6 +328,7 @@ type bpf_tp_debugMapSpecs struct { ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` DebugEvents *ebpf.MapSpec `ebpf:"debug_events"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -373,6 +392,7 @@ type bpf_tp_debugMaps struct { ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` DebugEvents *ebpf.Map `ebpf:"debug_events"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -419,6 +439,7 @@ func (m *bpf_tp_debugMaps) Close() error { m.ConnectionMetaMem, m.DebugEvents, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -451,40 +472,43 @@ func (m *bpf_tp_debugMaps) Close() error { // // It can be passed to loadBpf_tp_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tp_debugPrograms struct { - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` } func (p *bpf_tp_debugPrograms) Close() error { @@ -510,6 +534,9 @@ func (p *bpf_tp_debugPrograms) Close() error { p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SocketHttpFilter, p.UprobeSslDoHandshake, diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.o index c6667f702..79b66c476 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bbbf7c2ebccded580a43dea0e73d32a1fb65fa3cfeb6b50e8ef77d96ff47c0fe -size 1092616 +oid sha256:28baf5ef2a234634c57a7cbf06efb8627a13ee746a010c6fa28c25fdcd267d2d +size 1101792 diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.go index a0ff3f429..40bd5c538 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.go @@ -36,6 +36,21 @@ type bpf_tp_debugEgressKeyT struct { D_port uint16 } +type bpf_tp_debugGrpcFramesCtxT struct { + PrevInfo bpf_tp_debugHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpf_tp_debugHttp2ConnStreamT + Args bpf_tp_debugCallProtocolArgsT +} + type bpf_tp_debugHttp2ConnStreamT struct { PidConn bpf_tp_debugPidConnectionInfoT StreamId uint32 @@ -253,40 +268,43 @@ type bpf_tp_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tp_debugProgramSpecs struct { - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` } // bpf_tp_debugMapSpecs contains maps before they are loaded into the kernel. @@ -310,6 +328,7 @@ type bpf_tp_debugMapSpecs struct { ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` DebugEvents *ebpf.MapSpec `ebpf:"debug_events"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -373,6 +392,7 @@ type bpf_tp_debugMaps struct { ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` DebugEvents *ebpf.Map `ebpf:"debug_events"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -419,6 +439,7 @@ func (m *bpf_tp_debugMaps) Close() error { m.ConnectionMetaMem, m.DebugEvents, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -451,40 +472,43 @@ func (m *bpf_tp_debugMaps) Close() error { // // It can be passed to loadBpf_tp_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tp_debugPrograms struct { - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` } func (p *bpf_tp_debugPrograms) Close() error { @@ -510,6 +534,9 @@ func (p *bpf_tp_debugPrograms) Close() error { p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SocketHttpFilter, p.UprobeSslDoHandshake, diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.o index ded1ca2b0..a768fd6c0 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d51eee8e3a88155e11f9ce98d79d917362f7995b2ffd4a91d6cc5c174a031acb -size 1092184 +oid sha256:6c2fd1b77062c819872198220247e37d488632381318acc4c9fda510d00a2f33 +size 1101360 diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.go index ab394add2..4b59ca0eb 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.go @@ -36,6 +36,21 @@ type bpf_tpEgressKeyT struct { D_port uint16 } +type bpf_tpGrpcFramesCtxT struct { + PrevInfo bpf_tpHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpf_tpHttp2ConnStreamT + Args bpf_tpCallProtocolArgsT +} + type bpf_tpHttp2ConnStreamT struct { PidConn bpf_tpPidConnectionInfoT StreamId uint32 @@ -253,40 +268,43 @@ type bpf_tpSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tpProgramSpecs struct { - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` } // bpf_tpMapSpecs contains maps before they are loaded into the kernel. @@ -309,6 +327,7 @@ type bpf_tpMapSpecs struct { CloneMap *ebpf.MapSpec `ebpf:"clone_map"` ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -371,6 +390,7 @@ type bpf_tpMaps struct { CloneMap *ebpf.Map `ebpf:"clone_map"` ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -416,6 +436,7 @@ func (m *bpf_tpMaps) Close() error { m.CloneMap, m.ConnectionMetaMem, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -448,40 +469,43 @@ func (m *bpf_tpMaps) Close() error { // // It can be passed to loadBpf_tpObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tpPrograms struct { - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` } func (p *bpf_tpPrograms) Close() error { @@ -507,6 +531,9 @@ func (p *bpf_tpPrograms) Close() error { p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SocketHttpFilter, p.UprobeSslDoHandshake, diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.o index 7b9cd60a1..d1c6b699c 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.o +++ b/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:437c59ebff500c0ede491032b53484295a0f0058cf676a800892bb8ad921930e -size 650736 +oid sha256:833550ac375d9c0eaba85c9c3474898e0db525afb2db9fc49d6ef6785f26da71 +size 658432 diff --git a/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.go index d3d26a4cd..5fec5b485 100644 --- a/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.go @@ -36,6 +36,21 @@ type bpfEgressKeyT struct { D_port uint16 } +type bpfGrpcFramesCtxT struct { + PrevInfo bpfHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpfHttp2ConnStreamT + Args bpfCallProtocolArgsT +} + type bpfHttp2ConnStreamT struct { PidConn bpfPidConnectionInfoT StreamId uint32 @@ -253,40 +268,43 @@ type bpfSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpfProgramSpecs struct { - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.ProgramSpec `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.ProgramSpec `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.ProgramSpec `ebpf:"uretprobe_ssl_write_ex"` } // bpfMapSpecs contains maps before they are loaded into the kernel. @@ -309,6 +327,7 @@ type bpfMapSpecs struct { CloneMap *ebpf.MapSpec `ebpf:"clone_map"` ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -371,6 +390,7 @@ type bpfMaps struct { CloneMap *ebpf.Map `ebpf:"clone_map"` ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -416,6 +436,7 @@ func (m *bpfMaps) Close() error { m.CloneMap, m.ConnectionMetaMem, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -448,40 +469,43 @@ func (m *bpfMaps) Close() error { // // It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. type bpfPrograms struct { - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` - KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` - KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` - KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` - KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` - KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` - KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` - KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` - KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` - KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` - KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` - KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` - KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` - KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` - KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` - KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` - KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` - UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` - UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` - UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` - UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` - UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` - UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` - UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` - UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` - UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` - UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` - UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"` + KprobeTcpCleanupRbuf *ebpf.Program `ebpf:"kprobe_tcp_cleanup_rbuf"` + KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"` + KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"` + KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"` + KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"` + KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"` + KprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kprobe_unix_stream_recvmsg"` + KprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kprobe_unix_stream_sendmsg"` + KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"` + KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"` + KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"` + KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"` + KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"` + KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"` + KretprobeUnixStreamRecvmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_recvmsg"` + KretprobeUnixStreamSendmsg *ebpf.Program `ebpf:"kretprobe_unix_stream_sendmsg"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"` + UprobeSslDoHandshake *ebpf.Program `ebpf:"uprobe_ssl_do_handshake"` + UprobeSslRead *ebpf.Program `ebpf:"uprobe_ssl_read"` + UprobeSslReadEx *ebpf.Program `ebpf:"uprobe_ssl_read_ex"` + UprobeSslShutdown *ebpf.Program `ebpf:"uprobe_ssl_shutdown"` + UprobeSslWrite *ebpf.Program `ebpf:"uprobe_ssl_write"` + UprobeSslWriteEx *ebpf.Program `ebpf:"uprobe_ssl_write_ex"` + UretprobeSslDoHandshake *ebpf.Program `ebpf:"uretprobe_ssl_do_handshake"` + UretprobeSslRead *ebpf.Program `ebpf:"uretprobe_ssl_read"` + UretprobeSslReadEx *ebpf.Program `ebpf:"uretprobe_ssl_read_ex"` + UretprobeSslWrite *ebpf.Program `ebpf:"uretprobe_ssl_write"` + UretprobeSslWriteEx *ebpf.Program `ebpf:"uretprobe_ssl_write_ex"` } func (p *bpfPrograms) Close() error { @@ -507,6 +531,9 @@ func (p *bpfPrograms) Close() error { p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SocketHttpFilter, p.UprobeSslDoHandshake, diff --git a/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.o index 4debb673e..564434f3e 100644 --- a/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.o +++ b/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:abd5e3f90a4584a11290eedd6e35ad4b4d999d7146348b1d8047a4cdec210af9 -size 636256 +oid sha256:4ddd093fc457bd93105f26912bd9f31182531b039b8dc0c84601f15dfe1cbf07 +size 643944 diff --git a/pkg/internal/ebpf/generictracer/generictracer.go b/pkg/internal/ebpf/generictracer/generictracer.go index 2c58f2f06..0d17fecb0 100644 --- a/pkg/internal/ebpf/generictracer/generictracer.go +++ b/pkg/internal/ebpf/generictracer/generictracer.go @@ -222,6 +222,18 @@ func (p *Tracer) SetupTailCalls() { index: 2, prog: p.bpfObjects.ProtocolTcp, }, + { + index: 3, + prog: p.bpfObjects.ProtocolHttp2GrpcFrames, + }, + { + index: 4, + prog: p.bpfObjects.ProtocolHttp2GrpcHandleStartFrame, + }, + { + index: 5, + prog: p.bpfObjects.ProtocolHttp2GrpcHandleEndFrame, + }, } { err := p.bpfObjects.JumpTable.Update(uint32(tc.index), uint32(tc.prog.FD()), ebpf.UpdateAny) diff --git a/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.go b/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.go index acd8aa476..ee85b0d04 100644 --- a/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.go +++ b/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.go @@ -41,6 +41,21 @@ type bpfGoAddrKeyT struct { Addr uint64 } +type bpfGrpcFramesCtxT struct { + PrevInfo bpfHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpfHttp2ConnStreamT + Args bpfCallProtocolArgsT +} + type bpfHttp2ConnStreamT struct { PidConn bpfPidConnectionInfoT StreamId uint32 @@ -257,15 +272,18 @@ type bpfSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpfProgramSpecs struct { - AppEgress *ebpf.ProgramSpec `ebpf:"app_egress"` - AppIngress *ebpf.ProgramSpec `ebpf:"app_ingress"` - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - PacketExtender *ebpf.ProgramSpec `ebpf:"packet_extender"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SockmapTracker *ebpf.ProgramSpec `ebpf:"sockmap_tracker"` + AppEgress *ebpf.ProgramSpec `ebpf:"app_egress"` + AppIngress *ebpf.ProgramSpec `ebpf:"app_ingress"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + PacketExtender *ebpf.ProgramSpec `ebpf:"packet_extender"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SockmapTracker *ebpf.ProgramSpec `ebpf:"sockmap_tracker"` } // bpfMapSpecs contains maps before they are loaded into the kernel. @@ -284,6 +302,7 @@ type bpfMapSpecs struct { CloneMap *ebpf.MapSpec `ebpf:"clone_map"` ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -346,6 +365,7 @@ type bpfMaps struct { CloneMap *ebpf.Map `ebpf:"clone_map"` ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -391,6 +411,7 @@ func (m *bpfMaps) Close() error { m.CloneMap, m.ConnectionMetaMem, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -427,15 +448,18 @@ func (m *bpfMaps) Close() error { // // It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. type bpfPrograms struct { - AppEgress *ebpf.Program `ebpf:"app_egress"` - AppIngress *ebpf.Program `ebpf:"app_ingress"` - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - PacketExtender *ebpf.Program `ebpf:"packet_extender"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SockmapTracker *ebpf.Program `ebpf:"sockmap_tracker"` + AppEgress *ebpf.Program `ebpf:"app_egress"` + AppIngress *ebpf.Program `ebpf:"app_ingress"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + PacketExtender *ebpf.Program `ebpf:"packet_extender"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SockmapTracker *ebpf.Program `ebpf:"sockmap_tracker"` } func (p *bpfPrograms) Close() error { @@ -447,6 +471,9 @@ func (p *bpfPrograms) Close() error { p.PacketExtender, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SockmapTracker, ) diff --git a/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.o b/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.o index 09e3e91e6..a24c53bd6 100644 --- a/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.o +++ b/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b2392df988db2516a75d47a1305e30308a3f976dcd1d6bef42319486afb385e5 -size 212512 +oid sha256:94fe11f74af15938bf98b3736faeea87ada8884509a00dbb134b072c8298d17d +size 220352 diff --git a/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.go b/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.go index 0c1b823d5..da0dd836d 100644 --- a/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.go @@ -41,6 +41,21 @@ type bpf_debugGoAddrKeyT struct { Addr uint64 } +type bpf_debugGrpcFramesCtxT struct { + PrevInfo bpf_debugHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpf_debugHttp2ConnStreamT + Args bpf_debugCallProtocolArgsT +} + type bpf_debugHttp2ConnStreamT struct { PidConn bpf_debugPidConnectionInfoT StreamId uint32 @@ -257,15 +272,18 @@ type bpf_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_debugProgramSpecs struct { - AppEgress *ebpf.ProgramSpec `ebpf:"app_egress"` - AppIngress *ebpf.ProgramSpec `ebpf:"app_ingress"` - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - PacketExtender *ebpf.ProgramSpec `ebpf:"packet_extender"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SockmapTracker *ebpf.ProgramSpec `ebpf:"sockmap_tracker"` + AppEgress *ebpf.ProgramSpec `ebpf:"app_egress"` + AppIngress *ebpf.ProgramSpec `ebpf:"app_ingress"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + PacketExtender *ebpf.ProgramSpec `ebpf:"packet_extender"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SockmapTracker *ebpf.ProgramSpec `ebpf:"sockmap_tracker"` } // bpf_debugMapSpecs contains maps before they are loaded into the kernel. @@ -285,6 +303,7 @@ type bpf_debugMapSpecs struct { ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` DebugEvents *ebpf.MapSpec `ebpf:"debug_events"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -348,6 +367,7 @@ type bpf_debugMaps struct { ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` DebugEvents *ebpf.Map `ebpf:"debug_events"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -394,6 +414,7 @@ func (m *bpf_debugMaps) Close() error { m.ConnectionMetaMem, m.DebugEvents, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -430,15 +451,18 @@ func (m *bpf_debugMaps) Close() error { // // It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_debugPrograms struct { - AppEgress *ebpf.Program `ebpf:"app_egress"` - AppIngress *ebpf.Program `ebpf:"app_ingress"` - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - PacketExtender *ebpf.Program `ebpf:"packet_extender"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SockmapTracker *ebpf.Program `ebpf:"sockmap_tracker"` + AppEgress *ebpf.Program `ebpf:"app_egress"` + AppIngress *ebpf.Program `ebpf:"app_ingress"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + PacketExtender *ebpf.Program `ebpf:"packet_extender"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SockmapTracker *ebpf.Program `ebpf:"sockmap_tracker"` } func (p *bpf_debugPrograms) Close() error { @@ -450,6 +474,9 @@ func (p *bpf_debugPrograms) Close() error { p.PacketExtender, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SockmapTracker, ) diff --git a/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.o b/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.o index 4f918b5de..3f27b7693 100644 --- a/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4af7ce28ad1eacc862d0ac4e38c8debbfcbfe5526b3df6d4025d6eaebc5a6834 -size 392456 +oid sha256:b33b0864e1ccabaeac4c8a58d9f80ea90978544271f3ed18c52c40ff6e79ead8 +size 401768 diff --git a/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.go b/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.go index a020ab599..d67e2585e 100644 --- a/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.go @@ -41,6 +41,21 @@ type bpf_debugGoAddrKeyT struct { Addr uint64 } +type bpf_debugGrpcFramesCtxT struct { + PrevInfo bpf_debugHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpf_debugHttp2ConnStreamT + Args bpf_debugCallProtocolArgsT +} + type bpf_debugHttp2ConnStreamT struct { PidConn bpf_debugPidConnectionInfoT StreamId uint32 @@ -257,15 +272,18 @@ type bpf_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_debugProgramSpecs struct { - AppEgress *ebpf.ProgramSpec `ebpf:"app_egress"` - AppIngress *ebpf.ProgramSpec `ebpf:"app_ingress"` - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - PacketExtender *ebpf.ProgramSpec `ebpf:"packet_extender"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SockmapTracker *ebpf.ProgramSpec `ebpf:"sockmap_tracker"` + AppEgress *ebpf.ProgramSpec `ebpf:"app_egress"` + AppIngress *ebpf.ProgramSpec `ebpf:"app_ingress"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + PacketExtender *ebpf.ProgramSpec `ebpf:"packet_extender"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SockmapTracker *ebpf.ProgramSpec `ebpf:"sockmap_tracker"` } // bpf_debugMapSpecs contains maps before they are loaded into the kernel. @@ -285,6 +303,7 @@ type bpf_debugMapSpecs struct { ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` DebugEvents *ebpf.MapSpec `ebpf:"debug_events"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -348,6 +367,7 @@ type bpf_debugMaps struct { ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` DebugEvents *ebpf.Map `ebpf:"debug_events"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -394,6 +414,7 @@ func (m *bpf_debugMaps) Close() error { m.ConnectionMetaMem, m.DebugEvents, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -430,15 +451,18 @@ func (m *bpf_debugMaps) Close() error { // // It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_debugPrograms struct { - AppEgress *ebpf.Program `ebpf:"app_egress"` - AppIngress *ebpf.Program `ebpf:"app_ingress"` - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - PacketExtender *ebpf.Program `ebpf:"packet_extender"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SockmapTracker *ebpf.Program `ebpf:"sockmap_tracker"` + AppEgress *ebpf.Program `ebpf:"app_egress"` + AppIngress *ebpf.Program `ebpf:"app_ingress"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + PacketExtender *ebpf.Program `ebpf:"packet_extender"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SockmapTracker *ebpf.Program `ebpf:"sockmap_tracker"` } func (p *bpf_debugPrograms) Close() error { @@ -450,6 +474,9 @@ func (p *bpf_debugPrograms) Close() error { p.PacketExtender, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SockmapTracker, ) diff --git a/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.o b/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.o index d16d66b93..4d012d643 100644 --- a/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e96508fd11f4ca0a1cd8ddcc41ec38ddeb067d5894925bf376ed10173af157e -size 393768 +oid sha256:0759be44d7ca358cd54195e052f376f46317e71e355b28f4a2953be001ad08f7 +size 403080 diff --git a/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.go b/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.go index 3d57c01c2..b2d2c0dea 100644 --- a/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.go +++ b/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.go @@ -41,6 +41,21 @@ type bpfGoAddrKeyT struct { Addr uint64 } +type bpfGrpcFramesCtxT struct { + PrevInfo bpfHttp2GrpcRequestT + HasPrevInfo uint8 + _ [3]byte + Pos int32 + SavedBufPos int32 + SavedStreamId uint32 + FoundDataFrame uint8 + Iterations uint8 + TerminateSearch uint8 + _ [1]byte + Stream bpfHttp2ConnStreamT + Args bpfCallProtocolArgsT +} + type bpfHttp2ConnStreamT struct { PidConn bpfPidConnectionInfoT StreamId uint32 @@ -257,15 +272,18 @@ type bpfSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpfProgramSpecs struct { - AppEgress *ebpf.ProgramSpec `ebpf:"app_egress"` - AppIngress *ebpf.ProgramSpec `ebpf:"app_ingress"` - AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` - EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` - PacketExtender *ebpf.ProgramSpec `ebpf:"packet_extender"` - ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` - SockmapTracker *ebpf.ProgramSpec `ebpf:"sockmap_tracker"` + AppEgress *ebpf.ProgramSpec `ebpf:"app_egress"` + AppIngress *ebpf.ProgramSpec `ebpf:"app_ingress"` + AsyncReset *ebpf.ProgramSpec `ebpf:"async_reset"` + EmitAsyncInit *ebpf.ProgramSpec `ebpf:"emit_async_init"` + PacketExtender *ebpf.ProgramSpec `ebpf:"packet_extender"` + ProtocolHttp *ebpf.ProgramSpec `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.ProgramSpec `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.ProgramSpec `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.ProgramSpec `ebpf:"protocol_tcp"` + SockmapTracker *ebpf.ProgramSpec `ebpf:"sockmap_tracker"` } // bpfMapSpecs contains maps before they are loaded into the kernel. @@ -284,6 +302,7 @@ type bpfMapSpecs struct { CloneMap *ebpf.MapSpec `ebpf:"clone_map"` ConnectionMetaMem *ebpf.MapSpec `ebpf:"connection_meta_mem"` Events *ebpf.MapSpec `ebpf:"events"` + GrpcFramesCtxMem *ebpf.MapSpec `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.MapSpec `ebpf:"incoming_trace_map"` @@ -346,6 +365,7 @@ type bpfMaps struct { CloneMap *ebpf.Map `ebpf:"clone_map"` ConnectionMetaMem *ebpf.Map `ebpf:"connection_meta_mem"` Events *ebpf.Map `ebpf:"events"` + GrpcFramesCtxMem *ebpf.Map `ebpf:"grpc_frames_ctx_mem"` Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"` HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"` IncomingTraceMap *ebpf.Map `ebpf:"incoming_trace_map"` @@ -391,6 +411,7 @@ func (m *bpfMaps) Close() error { m.CloneMap, m.ConnectionMetaMem, m.Events, + m.GrpcFramesCtxMem, m.Http2InfoMem, m.HttpInfoMem, m.IncomingTraceMap, @@ -427,15 +448,18 @@ func (m *bpfMaps) Close() error { // // It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. type bpfPrograms struct { - AppEgress *ebpf.Program `ebpf:"app_egress"` - AppIngress *ebpf.Program `ebpf:"app_ingress"` - AsyncReset *ebpf.Program `ebpf:"async_reset"` - EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` - PacketExtender *ebpf.Program `ebpf:"packet_extender"` - ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` - ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` - ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` - SockmapTracker *ebpf.Program `ebpf:"sockmap_tracker"` + AppEgress *ebpf.Program `ebpf:"app_egress"` + AppIngress *ebpf.Program `ebpf:"app_ingress"` + AsyncReset *ebpf.Program `ebpf:"async_reset"` + EmitAsyncInit *ebpf.Program `ebpf:"emit_async_init"` + PacketExtender *ebpf.Program `ebpf:"packet_extender"` + ProtocolHttp *ebpf.Program `ebpf:"protocol_http"` + ProtocolHttp2 *ebpf.Program `ebpf:"protocol_http2"` + ProtocolHttp2GrpcFrames *ebpf.Program `ebpf:"protocol_http2_grpc_frames"` + ProtocolHttp2GrpcHandleEndFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_end_frame"` + ProtocolHttp2GrpcHandleStartFrame *ebpf.Program `ebpf:"protocol_http2_grpc_handle_start_frame"` + ProtocolTcp *ebpf.Program `ebpf:"protocol_tcp"` + SockmapTracker *ebpf.Program `ebpf:"sockmap_tracker"` } func (p *bpfPrograms) Close() error { @@ -447,6 +471,9 @@ func (p *bpfPrograms) Close() error { p.PacketExtender, p.ProtocolHttp, p.ProtocolHttp2, + p.ProtocolHttp2GrpcFrames, + p.ProtocolHttp2GrpcHandleEndFrame, + p.ProtocolHttp2GrpcHandleStartFrame, p.ProtocolTcp, p.SockmapTracker, ) diff --git a/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.o b/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.o index 46437de5f..1722fb5ff 100644 --- a/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.o +++ b/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a741e0120ba322ae8f8735b15e21327cba8a4973880e0077928801604923084 -size 213816 +oid sha256:1b31d396bac748c01dd272816778182f81f1a2f99402ae766c72aa53dc995309 +size 221664