diff --git a/bpf/go_grpc.c b/bpf/go_grpc.c index 537d6b646..aecc9be02 100644 --- a/bpf/go_grpc.c +++ b/bpf/go_grpc.c @@ -134,17 +134,15 @@ int uprobe_server_handleStream_return(struct pt_regs *ctx) { grpc_srv_func_invocation_t *invocation = bpf_map_lookup_elem(&ongoing_grpc_server_requests, &goroutine_addr); - bpf_map_delete_elem(&ongoing_grpc_server_requests, &goroutine_addr); if (invocation == NULL) { bpf_dbg_printk("can't read grpc invocation metadata"); - return 0; + goto done; } u16 *status = bpf_map_lookup_elem(&ongoing_grpc_request_status, &goroutine_addr); - bpf_map_delete_elem(&ongoing_grpc_request_status, &goroutine_addr); if (status == NULL) { bpf_dbg_printk("can't read grpc invocation status"); - return 0; + goto done; } void *stream_ptr = (void *)invocation->stream; @@ -153,7 +151,7 @@ int uprobe_server_handleStream_return(struct pt_regs *ctx) { http_request_trace *trace = bpf_ringbuf_reserve(&events, sizeof(http_request_trace), 0); if (!trace) { bpf_dbg_printk("can't reserve space in the ringbuffer"); - return 0; + goto done; } task_pid(&trace->pid); trace->type = EVENT_GRPC_REQUEST; @@ -172,7 +170,7 @@ int uprobe_server_handleStream_return(struct pt_regs *ctx) { if (!read_go_str("grpc method", stream_ptr, grpc_stream_method_ptr_pos, &trace->path, sizeof(trace->path))) { bpf_printk("can't read grpc transport.Stream.Method"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } void *st_ptr = 0; @@ -203,7 +201,7 @@ int uprobe_server_handleStream_return(struct pt_regs *ctx) { if (!read_go_byte_arr("grpc peer ptr", peer_ptr, tcp_addr_ip_ptr_pos, &trace->remote_addr, &remote_addr_len, sizeof(trace->remote_addr))) { bpf_printk("can't read grpc peer ptr"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } trace->remote_addr_len = remote_addr_len; } @@ -217,7 +215,7 @@ int uprobe_server_handleStream_return(struct pt_regs *ctx) { if (!read_go_byte_arr("grpc host ptr", host_ptr, tcp_addr_ip_ptr_pos, &trace->host, &host_len, sizeof(trace->host))) { bpf_printk("can't read grpc host ptr"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } trace->host_len = host_len; @@ -234,6 +232,10 @@ int uprobe_server_handleStream_return(struct pt_regs *ctx) { // submit the completed trace via ringbuffer bpf_ringbuf_submit(trace, get_flags()); +done: + bpf_map_delete_elem(&ongoing_grpc_server_requests, &goroutine_addr); + bpf_map_delete_elem(&ongoing_grpc_request_status, &goroutine_addr); + return 0; } @@ -348,17 +350,16 @@ int uprobe_ClientConn_Invoke_return(struct pt_regs *ctx) { grpc_client_func_invocation_t *invocation = bpf_map_lookup_elem(&ongoing_grpc_client_requests, &goroutine_addr); - bpf_map_delete_elem(&ongoing_grpc_client_requests, &goroutine_addr); if (invocation == NULL) { bpf_dbg_printk("can't read grpc client invocation metadata"); - return 0; + goto done; } http_request_trace *trace = bpf_ringbuf_reserve(&events, sizeof(http_request_trace), 0); if (!trace) { bpf_dbg_printk("can't reserve space in the ringbuffer"); - return 0; + goto done; } task_pid(&trace->pid); @@ -381,14 +382,14 @@ int uprobe_ClientConn_Invoke_return(struct pt_regs *ctx) { if (!read_go_str_n("method", method_ptr, (u64)method_len, &trace->path, sizeof(trace->path))) { bpf_printk("can't read grpc client method"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } // Get the host information of the remote if (!read_go_str("host", cc_ptr, grpc_client_target_ptr_pos, &trace->host, sizeof(trace->host))) { bpf_printk("can't read http Request.Host"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } trace->tp = invocation->tp; @@ -398,6 +399,8 @@ int uprobe_ClientConn_Invoke_return(struct pt_regs *ctx) { // submit the completed trace via ringbuffer bpf_ringbuf_submit(trace, get_flags()); +done: + bpf_map_delete_elem(&ongoing_grpc_client_requests, &goroutine_addr); return 0; } @@ -550,6 +553,7 @@ int uprobe_hpack_Encoder_WriteField(struct pt_regs *ctx) { if (val_len <= 0) { bpf_dbg_printk("Encoded traceparent value too large or empty"); + bpf_map_delete_elem(&ongoing_grpc_header_writes, &goroutine_addr); return 0; } diff --git a/bpf/go_nethttp.c b/bpf/go_nethttp.c index 99f4f4316..08e506dfb 100644 --- a/bpf/go_nethttp.c +++ b/bpf/go_nethttp.c @@ -24,10 +24,18 @@ typedef struct http_func_invocation { u64 start_monotime_ns; - u64 req_ptr; tp_info_t tp; } http_func_invocation_t; +typedef struct http_client_data { + u8 method[METHOD_MAX_LEN]; + u8 path[PATH_MAX_LEN]; + u8 host[HOST_LEN]; + s64 content_length; + + pid_info pid; +} http_client_data_t; + struct { __uint(type, BPF_MAP_TYPE_HASH); __type(key, void *); // key: pointer to the request goroutine @@ -35,6 +43,13 @@ struct { __uint(max_entries, MAX_CONCURRENT_REQUESTS); } ongoing_http_client_requests SEC(".maps"); +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __type(key, void *); // key: pointer to the request goroutine + __type(value, http_client_data_t); + __uint(max_entries, MAX_CONCURRENT_REQUESTS); +} ongoing_http_client_requests_data SEC(".maps"); + struct { __uint(type, BPF_MAP_TYPE_HASH); __type(key, void *); // key: pointer to the request goroutine @@ -57,7 +72,6 @@ int uprobe_ServeHTTP(struct pt_regs *ctx) { http_func_invocation_t invocation = { .start_monotime_ns = bpf_ktime_get_ns(), - .req_ptr = (u64)req, .tp = {0} }; @@ -106,13 +120,11 @@ static __always_inline int writeHeaderHelper(struct pt_regs *ctx, u64 req_offset http_func_invocation_t *invocation = bpf_map_lookup_elem(&ongoing_http_server_requests, &goroutine_addr); - bpf_map_delete_elem(&ongoing_http_server_requests, &goroutine_addr); if (invocation == NULL) { void *parent_go = (void *)find_parent_goroutine(goroutine_addr); if (parent_go) { bpf_dbg_printk("found parent goroutine for header [%llx]", parent_go); invocation = bpf_map_lookup_elem(&ongoing_http_server_requests, &parent_go); - bpf_map_delete_elem(&ongoing_http_server_requests, &parent_go); goroutine_addr = parent_go; } if (!invocation) { @@ -124,7 +136,7 @@ static __always_inline int writeHeaderHelper(struct pt_regs *ctx, u64 req_offset http_request_trace *trace = bpf_ringbuf_reserve(&events, sizeof(http_request_trace), 0); if (!trace) { bpf_dbg_printk("can't reserve space in the ringbuffer"); - return 0; + goto done; } task_pid(&trace->pid); @@ -150,28 +162,28 @@ static __always_inline int writeHeaderHelper(struct pt_regs *ctx, u64 req_offset if (!req_ptr) { bpf_printk("can't find req inside the response value"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } // Get method from Request.Method if (!read_go_str("method", req_ptr, method_ptr_pos, &trace->method, sizeof(trace->method))) { bpf_printk("can't read http Request.Method"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } // Get the remote peer information from Request.RemoteAddr if (!read_go_str("remote_addr", req_ptr, remoteaddr_ptr_pos, &trace->remote_addr, sizeof(trace->remote_addr))) { bpf_printk("can't read http Request.RemoteAddr"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } // Get the host information the remote supplied if (!read_go_str("host", req_ptr, host_ptr_pos, &trace->host, sizeof(trace->host))) { bpf_printk("can't read http Request.Host"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } // Get path from Request.URL @@ -181,7 +193,7 @@ static __always_inline int writeHeaderHelper(struct pt_regs *ctx, u64 req_offset if (!url_ptr || !read_go_str("path", url_ptr, path_ptr_pos, &trace->path, sizeof(trace->path))) { bpf_printk("can't read http Request.URL.Path"); bpf_ringbuf_discard(trace, 0); - return 0; + goto done; } bpf_probe_read(&trace->content_length, sizeof(trace->content_length), (void *)(req_ptr + content_length_ptr_pos)); @@ -193,6 +205,8 @@ static __always_inline int writeHeaderHelper(struct pt_regs *ctx, u64 req_offset // submit the completed trace via ringbuffer bpf_ringbuf_submit(trace, get_flags()); +done: + bpf_map_delete_elem(&ongoing_http_server_requests, &goroutine_addr); return 0; } @@ -203,7 +217,7 @@ int uprobe_WriteHeader(struct pt_regs *ctx) { #ifndef NO_HEADER_PROPAGATION struct { - __uint(type, BPF_MAP_TYPE_HASH); + __uint(type, BPF_MAP_TYPE_LRU_HASH); __type(key, void *); // key: pointer to the request header map __type(value, u64); // the goroutine of the transport request __uint(max_entries, MAX_CONCURRENT_REQUESTS); @@ -222,17 +236,43 @@ static __always_inline void roundTripStartHelper(struct pt_regs *ctx) { http_func_invocation_t invocation = { .start_monotime_ns = bpf_ktime_get_ns(), - .req_ptr = (u64)req, .tp = {0} }; __attribute__((__unused__)) u8 existing_tp = client_trace_parent(goroutine_addr, &invocation.tp, (void*)(req + req_header_ptr_pos)); + http_client_data_t trace = {0}; + + // Get method from Request.Method + if (!read_go_str("method", req, method_ptr_pos, &trace.method, sizeof(trace.method))) { + bpf_printk("can't read http Request.Method"); + return; + } + + // Get the host information of the remote + if (!read_go_str("host", req, host_ptr_pos, &trace.host, sizeof(trace.host))) { + bpf_printk("can't read http Request.Host"); + return; + } + + bpf_probe_read(&trace.content_length, sizeof(trace.content_length), (void *)(req + content_length_ptr_pos)); + + // Get path from Request.URL + void *url_ptr = 0; + bpf_probe_read(&url_ptr, sizeof(url_ptr), (void *)(req + url_ptr_pos)); + + if (!url_ptr || !read_go_str("path", url_ptr, path_ptr_pos, &trace.path, sizeof(trace.path))) { + bpf_printk("can't read http Request.URL.Path"); + return; + } + // Write event if (bpf_map_update_elem(&ongoing_http_client_requests, &goroutine_addr, &invocation, BPF_ANY)) { bpf_dbg_printk("can't update http client map element"); } + bpf_map_update_elem(&ongoing_http_client_requests_data, &goroutine_addr, &trace, BPF_ANY); + #ifndef NO_HEADER_PROPAGATION if (!existing_tp) { void *headers_ptr = 0; @@ -261,16 +301,21 @@ int uprobe_roundTripReturn(struct pt_regs *ctx) { http_func_invocation_t *invocation = bpf_map_lookup_elem(&ongoing_http_client_requests, &goroutine_addr); - bpf_map_delete_elem(&ongoing_http_client_requests, &goroutine_addr); if (invocation == NULL) { bpf_dbg_printk("can't read http invocation metadata"); - return 0; + goto done; + } + + http_client_data_t *data = bpf_map_lookup_elem(&ongoing_http_client_requests_data, &goroutine_addr); + if (data == NULL) { + bpf_dbg_printk("can't read http client invocation data"); + goto done; } http_request_trace *trace = bpf_ringbuf_reserve(&events, sizeof(http_request_trace), 0); if (!trace) { bpf_dbg_printk("can't reserve space in the ringbuffer"); - return 0; + goto done; } task_pid(&trace->pid); @@ -279,40 +324,18 @@ int uprobe_roundTripReturn(struct pt_regs *ctx) { trace->go_start_monotime_ns = invocation->start_monotime_ns; trace->end_monotime_ns = bpf_ktime_get_ns(); - // Read arguments from the original set of registers + // Copy the values read on request start + __builtin_memcpy(trace->method, data->method, sizeof(trace->method)); + __builtin_memcpy(trace->host, data->host, sizeof(trace->host)); + __builtin_memcpy(trace->path, data->path, sizeof(trace->path)); + trace->content_length = data->content_length; // Get request/response struct - void *req_ptr = (void *)invocation->req_ptr; - void *resp_ptr = (void *)GO_PARAM1(ctx); - - // Get method from Request.Method - if (!read_go_str("method", req_ptr, method_ptr_pos, &trace->method, sizeof(trace->method))) { - bpf_printk("can't read http Request.Method"); - bpf_ringbuf_discard(trace, 0); - return 0; - } - - // Get the host information of the remote - if (!read_go_str("host", req_ptr, host_ptr_pos, &trace->host, sizeof(trace->host))) { - bpf_printk("can't read http Request.Host"); - bpf_ringbuf_discard(trace, 0); - return 0; - } - - // Get path from Request.URL - void *url_ptr = 0; - bpf_probe_read(&url_ptr, sizeof(url_ptr), (void *)(req_ptr + url_ptr_pos)); - if (!url_ptr || !read_go_str("path", url_ptr, path_ptr_pos, &trace->path, sizeof(trace->path))) { - bpf_printk("can't read http Request.URL.Path"); - bpf_ringbuf_discard(trace, 0); - return 0; - } + void *resp_ptr = (void *)GO_PARAM1(ctx); trace->tp = invocation->tp; - bpf_probe_read(&trace->content_length, sizeof(trace->content_length), (void *)(req_ptr + content_length_ptr_pos)); - bpf_probe_read(&trace->status, sizeof(trace->status), (void *)(resp_ptr + status_code_ptr_pos)); bpf_dbg_printk("status %d, offset %d, resp_ptr %lx", trace->status, status_code_ptr_pos, (u64)resp_ptr); @@ -320,6 +343,9 @@ int uprobe_roundTripReturn(struct pt_regs *ctx) { // submit the completed trace via ringbuffer bpf_ringbuf_submit(trace, get_flags()); +done: + bpf_map_delete_elem(&ongoing_http_client_requests, &goroutine_addr); + bpf_map_delete_elem(&ongoing_http_client_requests_data, &goroutine_addr); return 0; } @@ -346,7 +372,7 @@ int uprobe_writeSubset(struct pt_regs *ctx) { http_func_invocation_t *func_inv = bpf_map_lookup_elem(&ongoing_http_client_requests, &parent_goaddr); if (!func_inv) { bpf_dbg_printk("Can't find client request for goroutine %llx", parent_goaddr); - return 0; + goto done; } unsigned char buf[TRACEPARENT_LEN]; @@ -356,7 +382,7 @@ int uprobe_writeSubset(struct pt_regs *ctx) { void *buf_ptr = 0; bpf_probe_read(&buf_ptr, sizeof(buf_ptr), (void *)(io_writer_addr + io_writer_buf_ptr_pos)); if (!buf_ptr) { - return 0; + goto done; } s64 size = 0; @@ -379,6 +405,8 @@ int uprobe_writeSubset(struct pt_regs *ctx) { bpf_probe_write_user((void *)(io_writer_addr + io_writer_n_pos), &len, sizeof(len)); } +done: + bpf_map_delete_elem(&header_req_map, &header_addr); return 0; } #else @@ -456,7 +484,6 @@ int uprobe_http2FramerWriteHeaders(struct pt_regs *ctx) { u32 stream_lookup = (u32)stream_id; void **go_ptr = bpf_map_lookup_elem(&http2_req_map, &stream_lookup); - bpf_map_delete_elem(&http2_req_map, &stream_lookup); if (go_ptr) { void *go_addr = *go_ptr; @@ -477,6 +504,7 @@ int uprobe_http2FramerWriteHeaders(struct pt_regs *ctx) { } } + bpf_map_delete_elem(&http2_req_map, &stream_lookup); return 0; } #else @@ -496,7 +524,6 @@ int uprobe_http2FramerWriteHeaders_returns(struct pt_regs *ctx) { void *goroutine_addr = GOROUTINE_PTR(ctx); framer_func_invocation_t *f_info = bpf_map_lookup_elem(&framer_invocation_map, &goroutine_addr); - bpf_map_delete_elem(&framer_invocation_map, &goroutine_addr); if (f_info) { void *w_ptr = 0; @@ -564,6 +591,7 @@ int uprobe_http2FramerWriteHeaders_returns(struct pt_regs *ctx) { } } + bpf_map_delete_elem(&framer_invocation_map, &goroutine_addr); return 0; } #else diff --git a/bpf/go_runtime.c b/bpf/go_runtime.c index d87ae64a6..7b376aa5e 100644 --- a/bpf/go_runtime.c +++ b/bpf/go_runtime.c @@ -52,10 +52,9 @@ int uprobe_proc_newproc1_ret(struct pt_regs *ctx) { // Lookup the newproc1 invocation metadata new_func_invocation_t *invocation = bpf_map_lookup_elem(&newproc1, &creator_goroutine); - bpf_map_delete_elem(&newproc1, &creator_goroutine); if (invocation == NULL) { bpf_dbg_printk("can't read newproc1 invocation metadata"); - return 0; + goto done; } // The parent goroutine is the second argument of newproc1 @@ -75,6 +74,9 @@ int uprobe_proc_newproc1_ret(struct pt_regs *ctx) { bpf_dbg_printk("can't update active goroutine"); } +done: + bpf_map_delete_elem(&newproc1, &creator_goroutine); + return 0; } diff --git a/bpf/go_sql.c b/bpf/go_sql.c index 792416a0a..f9ac1caa9 100644 --- a/bpf/go_sql.c +++ b/bpf/go_sql.c @@ -76,8 +76,7 @@ int uprobe_queryDCReturn(struct pt_regs *ctx) { bpf_dbg_printk("Request not found for this goroutine"); return 0; } - bpf_map_delete_elem(&ongoing_sql_queries, &goroutine_addr); - + sql_request_trace *trace = bpf_ringbuf_reserve(&events, sizeof(sql_request_trace), 0); if (trace) { task_pid(&trace->pid); @@ -100,5 +99,7 @@ int uprobe_queryDCReturn(struct pt_regs *ctx) { } else { bpf_dbg_printk("can't reserve space in the ringbuffer"); } + + bpf_map_delete_elem(&ongoing_sql_queries, &goroutine_addr); return 0; } \ No newline at end of file diff --git a/bpf/http_sock.c b/bpf/http_sock.c index 748cc705c..10b51bb84 100644 --- a/bpf/http_sock.c +++ b/bpf/http_sock.c @@ -13,7 +13,7 @@ char __license[] SEC("license") = "Dual MIT/GPL"; // Temporary tracking of accept arguments struct { - __uint(type, BPF_MAP_TYPE_HASH); + __uint(type, BPF_MAP_TYPE_LRU_HASH); __uint(max_entries, MAX_CONCURRENT_REQUESTS); __type(key, u64); __type(value, sock_args_t); @@ -21,7 +21,7 @@ struct { // Temporary tracking of connect arguments struct { - __uint(type, BPF_MAP_TYPE_HASH); + __uint(type, BPF_MAP_TYPE_LRU_HASH); __uint(max_entries, MAX_CONCURRENT_REQUESTS); __type(key, u64); __type(value, sock_args_t); @@ -34,7 +34,7 @@ typedef struct recv_args { } recv_args_t; struct { - __uint(type, BPF_MAP_TYPE_HASH); + __uint(type, BPF_MAP_TYPE_LRU_HASH); __uint(max_entries, MAX_CONCURRENT_REQUESTS); __type(key, u64); __type(value, recv_args_t); @@ -299,10 +299,9 @@ int BPF_KRETPROBE(kretprobe_tcp_recvmsg, int copied_len) { } recv_args_t *args = bpf_map_lookup_elem(&active_recv_args, &id); - bpf_map_delete_elem(&active_recv_args, &id); if (!args || (copied_len <= 0)) { - return 0; + goto done; } bpf_dbg_printk("=== tcp_recvmsg ret id=%d sock=%llx copied_len %d ===", id, args->sock_ptr, copied_len); @@ -320,6 +319,9 @@ int BPF_KRETPROBE(kretprobe_tcp_recvmsg, int copied_len) { handle_buf_with_connection(&info, (void *)args->iovec_ptr, copied_len, 0); } +done: + bpf_map_delete_elem(&active_recv_args, &id); + return 0; } diff --git a/bpf/http_sock.h b/bpf/http_sock.h index 7ae5e9432..a9f2fce55 100644 --- a/bpf/http_sock.h +++ b/bpf/http_sock.h @@ -292,15 +292,12 @@ static __always_inline void handle_buf_with_connection(pid_connection_info_t *pi if (!info) { bpf_dbg_printk("No info, pid =%d?, looking for fallback...", pid_conn->pid); info = bpf_map_lookup_elem(&ongoing_http_fallback, &pid_conn->conn); - bpf_map_delete_elem(&ongoing_http_fallback, &pid_conn->conn); if (!info) { bpf_dbg_printk("No fallback either, giving up"); //dbg_print_http_connection_info(&pid_conn->conn); // commented out since GitHub CI doesn't like this call return; } - } else { - bpf_map_delete_elem(&ongoing_http_fallback, &pid_conn->conn); - } + } bpf_dbg_printk("=== http_buffer_event len=%d pid=%d still_reading=%d ===", bytes_len, pid_from_pid_tgid(bpf_get_current_pid_tgid()), still_reading(info)); @@ -339,7 +336,9 @@ static __always_inline void handle_buf_with_connection(pid_connection_info_t *pi handle_http_response(small_buf, pid_conn, info, bytes_len); } else if (still_reading(info)) { info->len += bytes_len; - } + } + + bpf_map_delete_elem(&ongoing_http_fallback, &pid_conn->conn); } } diff --git a/bpf/http_ssl.c b/bpf/http_ssl.c index dc841042e..ec215678e 100644 --- a/bpf/http_ssl.c +++ b/bpf/http_ssl.c @@ -78,9 +78,9 @@ int BPF_URETPROBE(uretprobe_ssl_read, int ret) { bpf_dbg_printk("=== uretprobe SSL_read id=%d ===", id); ssl_args_t *args = bpf_map_lookup_elem(&active_ssl_read_args, &id); - bpf_map_delete_elem(&active_ssl_read_args, &id); handle_ssl_buf(id, args, ret); + bpf_map_delete_elem(&active_ssl_read_args, &id); return 0; } @@ -116,16 +116,17 @@ int BPF_URETPROBE(uretprobe_ssl_read_ex, int ret) { bpf_dbg_printk("=== uretprobe SSL_read_ex id=%d ===", id); ssl_args_t *args = bpf_map_lookup_elem(&active_ssl_read_args, &id); - bpf_map_delete_elem(&active_ssl_read_args, &id); if (ret != 1 || !args || !args->len_ptr) { - return 0; + goto done; } size_t read_len = 0; bpf_probe_read(&read_len, sizeof(read_len), (void *)args->len_ptr); handle_ssl_buf(id, args, read_len); +done: + bpf_map_delete_elem(&active_ssl_read_args, &id); return 0; } @@ -163,9 +164,9 @@ int BPF_URETPROBE(uretprobe_ssl_write, int ret) { bpf_dbg_printk("=== uretprobe SSL_write id=%d ===", id); ssl_args_t *args = bpf_map_lookup_elem(&active_ssl_write_args, &id); - bpf_map_delete_elem(&active_ssl_write_args, &id); handle_ssl_buf(id, args, ret); + bpf_map_delete_elem(&active_ssl_write_args, &id); return 0; } @@ -200,16 +201,17 @@ int BPF_URETPROBE(uretprobe_ssl_write_ex, int ret) { bpf_dbg_printk("=== uretprobe SSL_write_ex id=%d ===", id); ssl_args_t *args = bpf_map_lookup_elem(&active_ssl_write_args, &id); - bpf_map_delete_elem(&active_ssl_write_args, &id); if (ret != 1 || !args || !args->len_ptr) { - return 0; + goto done; } size_t wrote_len = 0; bpf_probe_read(&wrote_len, sizeof(wrote_len), (void *)args->len_ptr); handle_ssl_buf(id, args, wrote_len); +done: + bpf_map_delete_elem(&active_ssl_write_args, &id); return 0; } diff --git a/bpf/http_trace.h b/bpf/http_trace.h index 741b40b9c..cad7c0bbf 100644 --- a/bpf/http_trace.h +++ b/bpf/http_trace.h @@ -20,7 +20,7 @@ #define PATH_MAX_LEN 100 #define METHOD_MAX_LEN 7 // Longest method: OPTIONS #define REMOTE_ADDR_MAX_LEN 50 // We need 48: 39(ip v6 max) + 1(: separator) + 7(port length max value 65535) + 1(null terminator) -#define HOST_LEN 256 // can be a fully qualified DNS name +#define HOST_LEN 64 // can be a fully qualified DNS name #define TRACEPARENT_LEN 55 #define SQL_MAX_LEN 500 diff --git a/pkg/internal/ebpf/common/bpf_bpfel_arm64.go b/pkg/internal/ebpf/common/bpf_bpfel_arm64.go index 9e5a90916..1f9de470f 100644 --- a/pkg/internal/ebpf/common/bpf_bpfel_arm64.go +++ b/pkg/internal/ebpf/common/bpf_bpfel_arm64.go @@ -38,7 +38,7 @@ type bpfHttpRequestTrace struct { Status uint16 RemoteAddr [50]uint8 RemoteAddrLen uint64 - Host [256]uint8 + Host [64]uint8 HostLen uint64 HostPort uint32 ContentLength int64 diff --git a/pkg/internal/ebpf/common/bpf_bpfel_arm64.o b/pkg/internal/ebpf/common/bpf_bpfel_arm64.o index de9e3d876..f9d4233b8 100644 Binary files a/pkg/internal/ebpf/common/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/common/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/common/bpf_bpfel_x86.go b/pkg/internal/ebpf/common/bpf_bpfel_x86.go index c814fd546..302f9b3d1 100644 --- a/pkg/internal/ebpf/common/bpf_bpfel_x86.go +++ b/pkg/internal/ebpf/common/bpf_bpfel_x86.go @@ -38,7 +38,7 @@ type bpfHttpRequestTrace struct { Status uint16 RemoteAddr [50]uint8 RemoteAddrLen uint64 - Host [256]uint8 + Host [64]uint8 HostLen uint64 HostPort uint32 ContentLength int64 diff --git a/pkg/internal/ebpf/common/bpf_bpfel_x86.o b/pkg/internal/ebpf/common/bpf_bpfel_x86.o index de9e3d876..f9d4233b8 100644 Binary files a/pkg/internal/ebpf/common/bpf_bpfel_x86.o and b/pkg/internal/ebpf/common/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/goruntime/bpf_bpfel_arm64.o b/pkg/internal/ebpf/goruntime/bpf_bpfel_arm64.o index 00dfbf58f..7449be0f6 100644 Binary files a/pkg/internal/ebpf/goruntime/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/goruntime/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/goruntime/bpf_bpfel_x86.o b/pkg/internal/ebpf/goruntime/bpf_bpfel_x86.o index e71982cef..4a78e2edd 100644 Binary files a/pkg/internal/ebpf/goruntime/bpf_bpfel_x86.o and b/pkg/internal/ebpf/goruntime/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_arm64.o index a4a4d769b..da3799649 100644 Binary files a/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_x86.o index 51f411b0a..6f87b7709 100644 Binary files a/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/gosql/bpf_bpfel_arm64.o b/pkg/internal/ebpf/gosql/bpf_bpfel_arm64.o index d7e63456a..e068a80e5 100644 Binary files a/pkg/internal/ebpf/gosql/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/gosql/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/gosql/bpf_bpfel_x86.o b/pkg/internal/ebpf/gosql/bpf_bpfel_x86.o index a7a2b99a4..a51418d0d 100644 Binary files a/pkg/internal/ebpf/gosql/bpf_bpfel_x86.o and b/pkg/internal/ebpf/gosql/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/gosql/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/gosql/bpf_debug_bpfel_arm64.o index b71a24f44..c0c51add8 100644 Binary files a/pkg/internal/ebpf/gosql/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/gosql/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/gosql/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/gosql/bpf_debug_bpfel_x86.o index 1928913dd..ed999a587 100644 Binary files a/pkg/internal/ebpf/gosql/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/gosql/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.o b/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.o index 9983fb8e9..b1feb59ed 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_bpfel_x86.o b/pkg/internal/ebpf/grpc/bpf_bpfel_x86.o index 8cd375e27..8a2ee7654 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_bpfel_x86.o and b/pkg/internal/ebpf/grpc/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.o index 30d949469..33ff2af16 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.o index 5a34ce9bb..f2096884d 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.o b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.o index 764c26a4f..9453f0673 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.o and b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.o b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.o index 9e11c3b43..e9f90d789 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.o and b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.o b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.o index 6daf99aef..8d9f9b6af 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.o and b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.o b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.o index ea04e5c26..2220ee7c6 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.o and b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/httpfltr/bpf_bpfel_arm64.o b/pkg/internal/ebpf/httpfltr/bpf_bpfel_arm64.o index a012d68ae..511d69cfb 100644 Binary files a/pkg/internal/ebpf/httpfltr/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/httpfltr/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/httpfltr/bpf_bpfel_x86.o b/pkg/internal/ebpf/httpfltr/bpf_bpfel_x86.o index 22fe936c1..1136daa3e 100644 Binary files a/pkg/internal/ebpf/httpfltr/bpf_bpfel_x86.o and b/pkg/internal/ebpf/httpfltr/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/httpfltr/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/httpfltr/bpf_debug_bpfel_arm64.o index 29393224e..ce9ad5ef0 100644 Binary files a/pkg/internal/ebpf/httpfltr/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/httpfltr/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/httpfltr/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/httpfltr/bpf_debug_bpfel_x86.o index 1420b9b9c..18aa6a76a 100644 Binary files a/pkg/internal/ebpf/httpfltr/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/httpfltr/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/httpfltr/bpf_tp_bpfel_arm64.o b/pkg/internal/ebpf/httpfltr/bpf_tp_bpfel_arm64.o index df4948513..4c59b82d2 100644 Binary files a/pkg/internal/ebpf/httpfltr/bpf_tp_bpfel_arm64.o and b/pkg/internal/ebpf/httpfltr/bpf_tp_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/httpfltr/bpf_tp_bpfel_x86.o b/pkg/internal/ebpf/httpfltr/bpf_tp_bpfel_x86.o index 290feb2bd..2b4ede236 100644 Binary files a/pkg/internal/ebpf/httpfltr/bpf_tp_bpfel_x86.o and b/pkg/internal/ebpf/httpfltr/bpf_tp_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/httpfltr/bpf_tp_debug_bpfel_arm64.o b/pkg/internal/ebpf/httpfltr/bpf_tp_debug_bpfel_arm64.o index f6ebca897..440766c0f 100644 Binary files a/pkg/internal/ebpf/httpfltr/bpf_tp_debug_bpfel_arm64.o and b/pkg/internal/ebpf/httpfltr/bpf_tp_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/httpfltr/bpf_tp_debug_bpfel_x86.o b/pkg/internal/ebpf/httpfltr/bpf_tp_debug_bpfel_x86.o index 354839be2..266ef5ecb 100644 Binary files a/pkg/internal/ebpf/httpfltr/bpf_tp_debug_bpfel_x86.o and b/pkg/internal/ebpf/httpfltr/bpf_tp_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/httpssl/bpf_bpfel_arm64.o b/pkg/internal/ebpf/httpssl/bpf_bpfel_arm64.o index 617bfd013..36244fc13 100644 Binary files a/pkg/internal/ebpf/httpssl/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/httpssl/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/httpssl/bpf_bpfel_x86.o b/pkg/internal/ebpf/httpssl/bpf_bpfel_x86.o index ce95e4d78..d97da1ab4 100644 Binary files a/pkg/internal/ebpf/httpssl/bpf_bpfel_x86.o and b/pkg/internal/ebpf/httpssl/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/httpssl/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/httpssl/bpf_debug_bpfel_arm64.o index ce958b68a..2d5d45d00 100644 Binary files a/pkg/internal/ebpf/httpssl/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/httpssl/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/httpssl/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/httpssl/bpf_debug_bpfel_x86.o index a1387bf8a..b3de66d6f 100644 Binary files a/pkg/internal/ebpf/httpssl/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/httpssl/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/httpssl/bpf_tp_bpfel_arm64.o b/pkg/internal/ebpf/httpssl/bpf_tp_bpfel_arm64.o index 2dbe28eb9..95555c04f 100644 Binary files a/pkg/internal/ebpf/httpssl/bpf_tp_bpfel_arm64.o and b/pkg/internal/ebpf/httpssl/bpf_tp_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/httpssl/bpf_tp_bpfel_x86.o b/pkg/internal/ebpf/httpssl/bpf_tp_bpfel_x86.o index 764896ea2..8608148a3 100644 Binary files a/pkg/internal/ebpf/httpssl/bpf_tp_bpfel_x86.o and b/pkg/internal/ebpf/httpssl/bpf_tp_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/httpssl/bpf_tp_debug_bpfel_arm64.o b/pkg/internal/ebpf/httpssl/bpf_tp_debug_bpfel_arm64.o index 92804881e..a3725cce0 100644 Binary files a/pkg/internal/ebpf/httpssl/bpf_tp_debug_bpfel_arm64.o and b/pkg/internal/ebpf/httpssl/bpf_tp_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/httpssl/bpf_tp_debug_bpfel_x86.o b/pkg/internal/ebpf/httpssl/bpf_tp_debug_bpfel_x86.o index 84fff82b5..f24a936d0 100644 Binary files a/pkg/internal/ebpf/httpssl/bpf_tp_debug_bpfel_x86.o and b/pkg/internal/ebpf/httpssl/bpf_tp_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.go b/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.go index e965182b2..4bab9ac56 100644 --- a/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.go +++ b/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.go @@ -24,6 +24,20 @@ type bpfGoroutineMetadata struct { Timestamp uint64 } +type bpfHttpClientDataT struct { + Method [7]uint8 + Path [100]uint8 + Host [64]uint8 + _ [5]byte + ContentLength int64 + Pid struct { + HostPid uint32 + UserPid uint32 + Namespace uint32 + } + _ [4]byte +} + type bpfHttpConnectionMetadataT struct { Pid struct { HostPid uint32 @@ -35,7 +49,6 @@ type bpfHttpConnectionMetadataT struct { type bpfHttpFuncInvocationT struct { StartMonotimeNs uint64 - ReqPtr uint64 Tp bpfTpInfoT } @@ -125,17 +138,18 @@ type bpfProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpfMapSpecs struct { - Events *ebpf.MapSpec `ebpf:"events"` - FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` - GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` - OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.MapSpec `ebpf:"pid_cache"` - TraceMap *ebpf.MapSpec `ebpf:"trace_map"` - ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` + Events *ebpf.MapSpec `ebpf:"events"` + FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` + GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` + OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.MapSpec `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.MapSpec `ebpf:"pid_cache"` + TraceMap *ebpf.MapSpec `ebpf:"trace_map"` + ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` } // bpfObjects contains all objects after they have been loaded into the kernel. @@ -157,17 +171,18 @@ func (o *bpfObjects) Close() error { // // It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. type bpfMaps struct { - Events *ebpf.Map `ebpf:"events"` - FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` - GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` - OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.Map `ebpf:"pid_cache"` - TraceMap *ebpf.Map `ebpf:"trace_map"` - ValidPids *ebpf.Map `ebpf:"valid_pids"` + Events *ebpf.Map `ebpf:"events"` + FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` + GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` + OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.Map `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.Map `ebpf:"pid_cache"` + TraceMap *ebpf.Map `ebpf:"trace_map"` + ValidPids *ebpf.Map `ebpf:"valid_pids"` } func (m *bpfMaps) Close() error { @@ -178,6 +193,7 @@ func (m *bpfMaps) Close() error { m.GolangMapbucketStorageMap, m.OngoingGoroutines, m.OngoingHttpClientRequests, + m.OngoingHttpClientRequestsData, m.OngoingHttpServerConnections, m.OngoingHttpServerRequests, m.PidCache, diff --git a/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.o b/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.o index 31afbb763..c24f3f758 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.go b/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.go index 461c5e0f1..bfdcd813f 100644 --- a/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.go +++ b/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.go @@ -24,6 +24,20 @@ type bpfGoroutineMetadata struct { Timestamp uint64 } +type bpfHttpClientDataT struct { + Method [7]uint8 + Path [100]uint8 + Host [64]uint8 + _ [5]byte + ContentLength int64 + Pid struct { + HostPid uint32 + UserPid uint32 + Namespace uint32 + } + _ [4]byte +} + type bpfHttpConnectionMetadataT struct { Pid struct { HostPid uint32 @@ -35,7 +49,6 @@ type bpfHttpConnectionMetadataT struct { type bpfHttpFuncInvocationT struct { StartMonotimeNs uint64 - ReqPtr uint64 Tp bpfTpInfoT } @@ -125,17 +138,18 @@ type bpfProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpfMapSpecs struct { - Events *ebpf.MapSpec `ebpf:"events"` - FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` - GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` - OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.MapSpec `ebpf:"pid_cache"` - TraceMap *ebpf.MapSpec `ebpf:"trace_map"` - ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` + Events *ebpf.MapSpec `ebpf:"events"` + FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` + GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` + OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.MapSpec `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.MapSpec `ebpf:"pid_cache"` + TraceMap *ebpf.MapSpec `ebpf:"trace_map"` + ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` } // bpfObjects contains all objects after they have been loaded into the kernel. @@ -157,17 +171,18 @@ func (o *bpfObjects) Close() error { // // It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. type bpfMaps struct { - Events *ebpf.Map `ebpf:"events"` - FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` - GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` - OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.Map `ebpf:"pid_cache"` - TraceMap *ebpf.Map `ebpf:"trace_map"` - ValidPids *ebpf.Map `ebpf:"valid_pids"` + Events *ebpf.Map `ebpf:"events"` + FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` + GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` + OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.Map `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.Map `ebpf:"pid_cache"` + TraceMap *ebpf.Map `ebpf:"trace_map"` + ValidPids *ebpf.Map `ebpf:"valid_pids"` } func (m *bpfMaps) Close() error { @@ -178,6 +193,7 @@ func (m *bpfMaps) Close() error { m.GolangMapbucketStorageMap, m.OngoingGoroutines, m.OngoingHttpClientRequests, + m.OngoingHttpClientRequestsData, m.OngoingHttpServerConnections, m.OngoingHttpServerRequests, m.PidCache, diff --git a/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.o b/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.o index c552fc375..6e4c278c9 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.o and b/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.go b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.go index 04ddab1ce..a2103a0b6 100644 --- a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.go +++ b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.go @@ -24,6 +24,20 @@ type bpf_debugGoroutineMetadata struct { Timestamp uint64 } +type bpf_debugHttpClientDataT struct { + Method [7]uint8 + Path [100]uint8 + Host [64]uint8 + _ [5]byte + ContentLength int64 + Pid struct { + HostPid uint32 + UserPid uint32 + Namespace uint32 + } + _ [4]byte +} + type bpf_debugHttpConnectionMetadataT struct { Pid struct { HostPid uint32 @@ -35,7 +49,6 @@ type bpf_debugHttpConnectionMetadataT struct { type bpf_debugHttpFuncInvocationT struct { StartMonotimeNs uint64 - ReqPtr uint64 Tp bpf_debugTpInfoT } @@ -125,17 +138,18 @@ type bpf_debugProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_debugMapSpecs struct { - Events *ebpf.MapSpec `ebpf:"events"` - FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` - GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` - OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.MapSpec `ebpf:"pid_cache"` - TraceMap *ebpf.MapSpec `ebpf:"trace_map"` - ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` + Events *ebpf.MapSpec `ebpf:"events"` + FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` + GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` + OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.MapSpec `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.MapSpec `ebpf:"pid_cache"` + TraceMap *ebpf.MapSpec `ebpf:"trace_map"` + ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` } // bpf_debugObjects contains all objects after they have been loaded into the kernel. @@ -157,17 +171,18 @@ func (o *bpf_debugObjects) Close() error { // // It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_debugMaps struct { - Events *ebpf.Map `ebpf:"events"` - FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` - GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` - OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.Map `ebpf:"pid_cache"` - TraceMap *ebpf.Map `ebpf:"trace_map"` - ValidPids *ebpf.Map `ebpf:"valid_pids"` + Events *ebpf.Map `ebpf:"events"` + FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` + GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` + OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.Map `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.Map `ebpf:"pid_cache"` + TraceMap *ebpf.Map `ebpf:"trace_map"` + ValidPids *ebpf.Map `ebpf:"valid_pids"` } func (m *bpf_debugMaps) Close() error { @@ -178,6 +193,7 @@ func (m *bpf_debugMaps) Close() error { m.GolangMapbucketStorageMap, m.OngoingGoroutines, m.OngoingHttpClientRequests, + m.OngoingHttpClientRequestsData, m.OngoingHttpServerConnections, m.OngoingHttpServerRequests, m.PidCache, diff --git a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.o index dd8e6e179..02502c842 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.go b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.go index c3d92c4b2..c769e9cb3 100644 --- a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.go +++ b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.go @@ -24,6 +24,20 @@ type bpf_debugGoroutineMetadata struct { Timestamp uint64 } +type bpf_debugHttpClientDataT struct { + Method [7]uint8 + Path [100]uint8 + Host [64]uint8 + _ [5]byte + ContentLength int64 + Pid struct { + HostPid uint32 + UserPid uint32 + Namespace uint32 + } + _ [4]byte +} + type bpf_debugHttpConnectionMetadataT struct { Pid struct { HostPid uint32 @@ -35,7 +49,6 @@ type bpf_debugHttpConnectionMetadataT struct { type bpf_debugHttpFuncInvocationT struct { StartMonotimeNs uint64 - ReqPtr uint64 Tp bpf_debugTpInfoT } @@ -125,17 +138,18 @@ type bpf_debugProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_debugMapSpecs struct { - Events *ebpf.MapSpec `ebpf:"events"` - FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` - GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` - OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.MapSpec `ebpf:"pid_cache"` - TraceMap *ebpf.MapSpec `ebpf:"trace_map"` - ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` + Events *ebpf.MapSpec `ebpf:"events"` + FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` + GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` + OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.MapSpec `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.MapSpec `ebpf:"pid_cache"` + TraceMap *ebpf.MapSpec `ebpf:"trace_map"` + ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` } // bpf_debugObjects contains all objects after they have been loaded into the kernel. @@ -157,17 +171,18 @@ func (o *bpf_debugObjects) Close() error { // // It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_debugMaps struct { - Events *ebpf.Map `ebpf:"events"` - FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` - GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` - OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.Map `ebpf:"pid_cache"` - TraceMap *ebpf.Map `ebpf:"trace_map"` - ValidPids *ebpf.Map `ebpf:"valid_pids"` + Events *ebpf.Map `ebpf:"events"` + FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` + GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` + OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.Map `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.Map `ebpf:"pid_cache"` + TraceMap *ebpf.Map `ebpf:"trace_map"` + ValidPids *ebpf.Map `ebpf:"valid_pids"` } func (m *bpf_debugMaps) Close() error { @@ -178,6 +193,7 @@ func (m *bpf_debugMaps) Close() error { m.GolangMapbucketStorageMap, m.OngoingGoroutines, m.OngoingHttpClientRequests, + m.OngoingHttpClientRequestsData, m.OngoingHttpServerConnections, m.OngoingHttpServerRequests, m.PidCache, diff --git a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.o index 0f7275cbe..640a9d44a 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.go b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.go index 74ade711d..365383345 100644 --- a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.go +++ b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.go @@ -29,6 +29,20 @@ type bpf_tpGoroutineMetadata struct { Timestamp uint64 } +type bpf_tpHttpClientDataT struct { + Method [7]uint8 + Path [100]uint8 + Host [64]uint8 + _ [5]byte + ContentLength int64 + Pid struct { + HostPid uint32 + UserPid uint32 + Namespace uint32 + } + _ [4]byte +} + type bpf_tpHttpConnectionMetadataT struct { Pid struct { HostPid uint32 @@ -40,7 +54,6 @@ type bpf_tpHttpConnectionMetadataT struct { type bpf_tpHttpFuncInvocationT struct { StartMonotimeNs uint64 - ReqPtr uint64 Tp bpf_tpTpInfoT } @@ -130,20 +143,21 @@ type bpf_tpProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tpMapSpecs struct { - Events *ebpf.MapSpec `ebpf:"events"` - FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` - FramerInvocationMap *ebpf.MapSpec `ebpf:"framer_invocation_map"` - GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` - HeaderReqMap *ebpf.MapSpec `ebpf:"header_req_map"` - Http2ReqMap *ebpf.MapSpec `ebpf:"http2_req_map"` - OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.MapSpec `ebpf:"pid_cache"` - TraceMap *ebpf.MapSpec `ebpf:"trace_map"` - ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` + Events *ebpf.MapSpec `ebpf:"events"` + FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` + FramerInvocationMap *ebpf.MapSpec `ebpf:"framer_invocation_map"` + GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` + HeaderReqMap *ebpf.MapSpec `ebpf:"header_req_map"` + Http2ReqMap *ebpf.MapSpec `ebpf:"http2_req_map"` + OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.MapSpec `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.MapSpec `ebpf:"pid_cache"` + TraceMap *ebpf.MapSpec `ebpf:"trace_map"` + ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` } // bpf_tpObjects contains all objects after they have been loaded into the kernel. @@ -165,20 +179,21 @@ func (o *bpf_tpObjects) Close() error { // // It can be passed to loadBpf_tpObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tpMaps struct { - Events *ebpf.Map `ebpf:"events"` - FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` - FramerInvocationMap *ebpf.Map `ebpf:"framer_invocation_map"` - GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` - HeaderReqMap *ebpf.Map `ebpf:"header_req_map"` - Http2ReqMap *ebpf.Map `ebpf:"http2_req_map"` - OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.Map `ebpf:"pid_cache"` - TraceMap *ebpf.Map `ebpf:"trace_map"` - ValidPids *ebpf.Map `ebpf:"valid_pids"` + Events *ebpf.Map `ebpf:"events"` + FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` + FramerInvocationMap *ebpf.Map `ebpf:"framer_invocation_map"` + GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` + HeaderReqMap *ebpf.Map `ebpf:"header_req_map"` + Http2ReqMap *ebpf.Map `ebpf:"http2_req_map"` + OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.Map `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.Map `ebpf:"pid_cache"` + TraceMap *ebpf.Map `ebpf:"trace_map"` + ValidPids *ebpf.Map `ebpf:"valid_pids"` } func (m *bpf_tpMaps) Close() error { @@ -192,6 +207,7 @@ func (m *bpf_tpMaps) Close() error { m.Http2ReqMap, m.OngoingGoroutines, m.OngoingHttpClientRequests, + m.OngoingHttpClientRequestsData, m.OngoingHttpServerConnections, m.OngoingHttpServerRequests, m.PidCache, diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.o b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.o index 403f2f334..20862fd29 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.o and b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.go b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.go index c6899ff20..e33f12252 100644 --- a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.go +++ b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.go @@ -29,6 +29,20 @@ type bpf_tpGoroutineMetadata struct { Timestamp uint64 } +type bpf_tpHttpClientDataT struct { + Method [7]uint8 + Path [100]uint8 + Host [64]uint8 + _ [5]byte + ContentLength int64 + Pid struct { + HostPid uint32 + UserPid uint32 + Namespace uint32 + } + _ [4]byte +} + type bpf_tpHttpConnectionMetadataT struct { Pid struct { HostPid uint32 @@ -40,7 +54,6 @@ type bpf_tpHttpConnectionMetadataT struct { type bpf_tpHttpFuncInvocationT struct { StartMonotimeNs uint64 - ReqPtr uint64 Tp bpf_tpTpInfoT } @@ -130,20 +143,21 @@ type bpf_tpProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tpMapSpecs struct { - Events *ebpf.MapSpec `ebpf:"events"` - FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` - FramerInvocationMap *ebpf.MapSpec `ebpf:"framer_invocation_map"` - GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` - HeaderReqMap *ebpf.MapSpec `ebpf:"header_req_map"` - Http2ReqMap *ebpf.MapSpec `ebpf:"http2_req_map"` - OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.MapSpec `ebpf:"pid_cache"` - TraceMap *ebpf.MapSpec `ebpf:"trace_map"` - ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` + Events *ebpf.MapSpec `ebpf:"events"` + FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` + FramerInvocationMap *ebpf.MapSpec `ebpf:"framer_invocation_map"` + GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` + HeaderReqMap *ebpf.MapSpec `ebpf:"header_req_map"` + Http2ReqMap *ebpf.MapSpec `ebpf:"http2_req_map"` + OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.MapSpec `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.MapSpec `ebpf:"pid_cache"` + TraceMap *ebpf.MapSpec `ebpf:"trace_map"` + ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` } // bpf_tpObjects contains all objects after they have been loaded into the kernel. @@ -165,20 +179,21 @@ func (o *bpf_tpObjects) Close() error { // // It can be passed to loadBpf_tpObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tpMaps struct { - Events *ebpf.Map `ebpf:"events"` - FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` - FramerInvocationMap *ebpf.Map `ebpf:"framer_invocation_map"` - GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` - HeaderReqMap *ebpf.Map `ebpf:"header_req_map"` - Http2ReqMap *ebpf.Map `ebpf:"http2_req_map"` - OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.Map `ebpf:"pid_cache"` - TraceMap *ebpf.Map `ebpf:"trace_map"` - ValidPids *ebpf.Map `ebpf:"valid_pids"` + Events *ebpf.Map `ebpf:"events"` + FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` + FramerInvocationMap *ebpf.Map `ebpf:"framer_invocation_map"` + GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` + HeaderReqMap *ebpf.Map `ebpf:"header_req_map"` + Http2ReqMap *ebpf.Map `ebpf:"http2_req_map"` + OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.Map `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.Map `ebpf:"pid_cache"` + TraceMap *ebpf.Map `ebpf:"trace_map"` + ValidPids *ebpf.Map `ebpf:"valid_pids"` } func (m *bpf_tpMaps) Close() error { @@ -192,6 +207,7 @@ func (m *bpf_tpMaps) Close() error { m.Http2ReqMap, m.OngoingGoroutines, m.OngoingHttpClientRequests, + m.OngoingHttpClientRequestsData, m.OngoingHttpServerConnections, m.OngoingHttpServerRequests, m.PidCache, diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.o b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.o index c20dce60e..a0c347da1 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.o and b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.go b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.go index 1b24db5c0..851af4945 100644 --- a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.go +++ b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.go @@ -29,6 +29,20 @@ type bpf_tp_debugGoroutineMetadata struct { Timestamp uint64 } +type bpf_tp_debugHttpClientDataT struct { + Method [7]uint8 + Path [100]uint8 + Host [64]uint8 + _ [5]byte + ContentLength int64 + Pid struct { + HostPid uint32 + UserPid uint32 + Namespace uint32 + } + _ [4]byte +} + type bpf_tp_debugHttpConnectionMetadataT struct { Pid struct { HostPid uint32 @@ -40,7 +54,6 @@ type bpf_tp_debugHttpConnectionMetadataT struct { type bpf_tp_debugHttpFuncInvocationT struct { StartMonotimeNs uint64 - ReqPtr uint64 Tp bpf_tp_debugTpInfoT } @@ -130,20 +143,21 @@ type bpf_tp_debugProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tp_debugMapSpecs struct { - Events *ebpf.MapSpec `ebpf:"events"` - FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` - FramerInvocationMap *ebpf.MapSpec `ebpf:"framer_invocation_map"` - GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` - HeaderReqMap *ebpf.MapSpec `ebpf:"header_req_map"` - Http2ReqMap *ebpf.MapSpec `ebpf:"http2_req_map"` - OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.MapSpec `ebpf:"pid_cache"` - TraceMap *ebpf.MapSpec `ebpf:"trace_map"` - ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` + Events *ebpf.MapSpec `ebpf:"events"` + FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` + FramerInvocationMap *ebpf.MapSpec `ebpf:"framer_invocation_map"` + GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` + HeaderReqMap *ebpf.MapSpec `ebpf:"header_req_map"` + Http2ReqMap *ebpf.MapSpec `ebpf:"http2_req_map"` + OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.MapSpec `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.MapSpec `ebpf:"pid_cache"` + TraceMap *ebpf.MapSpec `ebpf:"trace_map"` + ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` } // bpf_tp_debugObjects contains all objects after they have been loaded into the kernel. @@ -165,20 +179,21 @@ func (o *bpf_tp_debugObjects) Close() error { // // It can be passed to loadBpf_tp_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tp_debugMaps struct { - Events *ebpf.Map `ebpf:"events"` - FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` - FramerInvocationMap *ebpf.Map `ebpf:"framer_invocation_map"` - GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` - HeaderReqMap *ebpf.Map `ebpf:"header_req_map"` - Http2ReqMap *ebpf.Map `ebpf:"http2_req_map"` - OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.Map `ebpf:"pid_cache"` - TraceMap *ebpf.Map `ebpf:"trace_map"` - ValidPids *ebpf.Map `ebpf:"valid_pids"` + Events *ebpf.Map `ebpf:"events"` + FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` + FramerInvocationMap *ebpf.Map `ebpf:"framer_invocation_map"` + GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` + HeaderReqMap *ebpf.Map `ebpf:"header_req_map"` + Http2ReqMap *ebpf.Map `ebpf:"http2_req_map"` + OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.Map `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.Map `ebpf:"pid_cache"` + TraceMap *ebpf.Map `ebpf:"trace_map"` + ValidPids *ebpf.Map `ebpf:"valid_pids"` } func (m *bpf_tp_debugMaps) Close() error { @@ -192,6 +207,7 @@ func (m *bpf_tp_debugMaps) Close() error { m.Http2ReqMap, m.OngoingGoroutines, m.OngoingHttpClientRequests, + m.OngoingHttpClientRequestsData, m.OngoingHttpServerConnections, m.OngoingHttpServerRequests, m.PidCache, diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.o b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.o index 3c6a4e48f..4e1cb7412 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.o and b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.go b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.go index f98a3c537..8dcd7d316 100644 --- a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.go +++ b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.go @@ -29,6 +29,20 @@ type bpf_tp_debugGoroutineMetadata struct { Timestamp uint64 } +type bpf_tp_debugHttpClientDataT struct { + Method [7]uint8 + Path [100]uint8 + Host [64]uint8 + _ [5]byte + ContentLength int64 + Pid struct { + HostPid uint32 + UserPid uint32 + Namespace uint32 + } + _ [4]byte +} + type bpf_tp_debugHttpConnectionMetadataT struct { Pid struct { HostPid uint32 @@ -40,7 +54,6 @@ type bpf_tp_debugHttpConnectionMetadataT struct { type bpf_tp_debugHttpFuncInvocationT struct { StartMonotimeNs uint64 - ReqPtr uint64 Tp bpf_tp_debugTpInfoT } @@ -130,20 +143,21 @@ type bpf_tp_debugProgramSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tp_debugMapSpecs struct { - Events *ebpf.MapSpec `ebpf:"events"` - FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` - FramerInvocationMap *ebpf.MapSpec `ebpf:"framer_invocation_map"` - GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` - HeaderReqMap *ebpf.MapSpec `ebpf:"header_req_map"` - Http2ReqMap *ebpf.MapSpec `ebpf:"http2_req_map"` - OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.MapSpec `ebpf:"pid_cache"` - TraceMap *ebpf.MapSpec `ebpf:"trace_map"` - ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` + Events *ebpf.MapSpec `ebpf:"events"` + FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"` + FramerInvocationMap *ebpf.MapSpec `ebpf:"framer_invocation_map"` + GoTraceMap *ebpf.MapSpec `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.MapSpec `ebpf:"golang_mapbucket_storage_map"` + HeaderReqMap *ebpf.MapSpec `ebpf:"header_req_map"` + Http2ReqMap *ebpf.MapSpec `ebpf:"http2_req_map"` + OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.MapSpec `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.MapSpec `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.MapSpec `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.MapSpec `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.MapSpec `ebpf:"pid_cache"` + TraceMap *ebpf.MapSpec `ebpf:"trace_map"` + ValidPids *ebpf.MapSpec `ebpf:"valid_pids"` } // bpf_tp_debugObjects contains all objects after they have been loaded into the kernel. @@ -165,20 +179,21 @@ func (o *bpf_tp_debugObjects) Close() error { // // It can be passed to loadBpf_tp_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tp_debugMaps struct { - Events *ebpf.Map `ebpf:"events"` - FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` - FramerInvocationMap *ebpf.Map `ebpf:"framer_invocation_map"` - GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` - GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` - HeaderReqMap *ebpf.Map `ebpf:"header_req_map"` - Http2ReqMap *ebpf.Map `ebpf:"http2_req_map"` - OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` - OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` - OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` - OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` - PidCache *ebpf.Map `ebpf:"pid_cache"` - TraceMap *ebpf.Map `ebpf:"trace_map"` - ValidPids *ebpf.Map `ebpf:"valid_pids"` + Events *ebpf.Map `ebpf:"events"` + FilteredConnections *ebpf.Map `ebpf:"filtered_connections"` + FramerInvocationMap *ebpf.Map `ebpf:"framer_invocation_map"` + GoTraceMap *ebpf.Map `ebpf:"go_trace_map"` + GolangMapbucketStorageMap *ebpf.Map `ebpf:"golang_mapbucket_storage_map"` + HeaderReqMap *ebpf.Map `ebpf:"header_req_map"` + Http2ReqMap *ebpf.Map `ebpf:"http2_req_map"` + OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` + OngoingHttpClientRequests *ebpf.Map `ebpf:"ongoing_http_client_requests"` + OngoingHttpClientRequestsData *ebpf.Map `ebpf:"ongoing_http_client_requests_data"` + OngoingHttpServerConnections *ebpf.Map `ebpf:"ongoing_http_server_connections"` + OngoingHttpServerRequests *ebpf.Map `ebpf:"ongoing_http_server_requests"` + PidCache *ebpf.Map `ebpf:"pid_cache"` + TraceMap *ebpf.Map `ebpf:"trace_map"` + ValidPids *ebpf.Map `ebpf:"valid_pids"` } func (m *bpf_tp_debugMaps) Close() error { @@ -192,6 +207,7 @@ func (m *bpf_tp_debugMaps) Close() error { m.Http2ReqMap, m.OngoingGoroutines, m.OngoingHttpClientRequests, + m.OngoingHttpClientRequestsData, m.OngoingHttpServerConnections, m.OngoingHttpServerRequests, m.PidCache, diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.o b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.o index b29f6cb60..6b0e7790c 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.o and b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.o differ