diff --git a/bpf/http_types.h b/bpf/http_types.h index 352ff31f8..2aba3c041 100644 --- a/bpf/http_types.h +++ b/bpf/http_types.h @@ -140,6 +140,7 @@ typedef struct tcp_req { // with other instrumented processes pid_info pid; tp_info_t tp; + u64 extra_id; } tcp_req_t; typedef struct call_protocol_args { diff --git a/bpf/k_send_receive.h b/bpf/k_send_receive.h new file mode 100644 index 000000000..fa5c21475 --- /dev/null +++ b/bpf/k_send_receive.h @@ -0,0 +1,45 @@ +#ifndef _K_SEND_RECEIVE_H +#define _K_SEND_RECEIVE_H + +#include "vmlinux.h" +#include "bpf_helpers.h" +#include "k_tracer_defs.h" + +struct { + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __uint(max_entries, MAX_CONCURRENT_REQUESTS); + __type(key, u64); + __type(value, recv_args_t); +} active_recv_args SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __uint(max_entries, MAX_CONCURRENT_REQUESTS); + __type(key, u64); // pid_tid + __type(value, send_args_t); // size to be sent +} active_send_args SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __uint(max_entries, MAX_CONCURRENT_REQUESTS); + __type(key, u64); // *sock + __type(value, send_args_t); // size to be sent +} active_send_sock_args SEC(".maps"); + +static __always_inline void ensure_sent_event(u64 id, u64 *sock_p) { + if (high_request_volume) { + return; + } + send_args_t *s_args = (send_args_t *)bpf_map_lookup_elem(&active_send_args, &id); + if (s_args) { + bpf_dbg_printk("Checking if we need to finish the request per thread id"); + finish_possible_delayed_http_request(&s_args->p_conn); + } // see if we match on another thread, but same sock * + s_args = (send_args_t *)bpf_map_lookup_elem(&active_send_sock_args, sock_p); + if (s_args) { + bpf_dbg_printk("Checking if we need to finish the request per socket"); + finish_possible_delayed_http_request(&s_args->p_conn); + } +} + +#endif \ No newline at end of file diff --git a/bpf/k_tracer.h b/bpf/k_tracer.h index 29804a649..13eead134 100644 --- a/bpf/k_tracer.h +++ b/bpf/k_tracer.h @@ -8,6 +8,8 @@ #include "k_tracer_defs.h" #include "http_ssl_defs.h" #include "pin_internal.h" +#include "k_send_receive.h" +#include "k_unix_sock.h" // Temporary tracking of accept arguments struct { @@ -25,33 +27,6 @@ struct { __type(value, sock_args_t); } active_connect_args SEC(".maps"); -// Temporary tracking of tcp_recvmsg arguments -typedef struct recv_args { - u64 sock_ptr; // linux sock or socket address - u8 iovec_ctx[sizeof(iovec_iter_ctx)]; -} recv_args_t; - -struct { - __uint(type, BPF_MAP_TYPE_LRU_HASH); - __uint(max_entries, MAX_CONCURRENT_REQUESTS); - __type(key, u64); - __type(value, recv_args_t); -} active_recv_args SEC(".maps"); - -struct { - __uint(type, BPF_MAP_TYPE_LRU_HASH); - __uint(max_entries, MAX_CONCURRENT_REQUESTS); - __type(key, u64); // pid_tid - __type(value, send_args_t); // size to be sent -} active_send_args SEC(".maps"); - -struct { - __uint(type, BPF_MAP_TYPE_LRU_HASH); - __uint(max_entries, MAX_CONCURRENT_REQUESTS); - __type(key, u64); // *sock - __type(value, send_args_t); // size to be sent -} active_send_sock_args SEC(".maps"); - struct { __uint(type, BPF_MAP_TYPE_LRU_HASH); __type( @@ -143,6 +118,8 @@ int BPF_KRETPROBE(kretprobe_sys_accept4, uint fd) { //bpf_dbg_printk("=== accept 4 ret id=%d ===", id); + bpf_dbg_printk("=== accept 4 ret id=%d, fd=%d ===", id, fd); + // The file descriptor is the value returned from the accept4 syscall. // If we got a negative file descriptor we don't have a connection if ((int)fd < 0) { @@ -151,12 +128,10 @@ int BPF_KRETPROBE(kretprobe_sys_accept4, uint fd) { sock_args_t *args = bpf_map_lookup_elem(&active_accept_args, &id); if (!args) { - //bpf_dbg_printk("No sock info %d", id); + bpf_dbg_printk("No accept sock info %d", id); goto cleanup; } - bpf_dbg_printk("=== accept 4 ret id=%d, sock=%llx, fd=%d ===", id, args->addr, fd); - ssl_pid_connection_info_t info = {}; if (parse_accept_socket_info(args, &info.p_conn.conn)) { @@ -378,22 +353,6 @@ int BPF_KRETPROBE(kretprobe_tcp_sendmsg, int sent_len) { return 0; } -static __always_inline void ensure_sent_event(u64 id, u64 *sock_p) { - if (high_request_volume) { - return; - } - send_args_t *s_args = bpf_map_lookup_elem(&active_send_args, &id); - if (s_args) { - bpf_dbg_printk("Checking if we need to finish the request per thread id"); - finish_possible_delayed_http_request(&s_args->p_conn); - } // see if we match on another thread, but same sock * - s_args = bpf_map_lookup_elem(&active_send_sock_args, sock_p); - if (s_args) { - bpf_dbg_printk("Checking if we need to finish the request per socket"); - finish_possible_delayed_http_request(&s_args->p_conn); - } -} - SEC("kprobe/tcp_close") int BPF_KPROBE(kprobe_tcp_close, struct sock *sk, long timeout) { u64 id = bpf_get_current_pid_tgid(); diff --git a/bpf/k_tracer_defs.h b/bpf/k_tracer_defs.h index da691a2fb..867c10706 100644 --- a/bpf/k_tracer_defs.h +++ b/bpf/k_tracer_defs.h @@ -16,8 +16,15 @@ typedef struct send_args { pid_connection_info_t p_conn; u64 size; + u64 sock_ptr; } send_args_t; +// Temporary tracking of tcp_recvmsg arguments +typedef struct recv_args { + u64 sock_ptr; // linux sock or socket address + 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), diff --git a/bpf/k_unix_sock.h b/bpf/k_unix_sock.h new file mode 100644 index 000000000..064cc1a77 --- /dev/null +++ b/bpf/k_unix_sock.h @@ -0,0 +1,298 @@ +#ifndef _K_UNIX_SOCK +#define _K_UNIX_SOCK + +#include "vmlinux.h" +#include "bpf_helpers.h" +#include "http_types.h" +#include "tc_common.h" +#include "bpf_dbg.h" +#include "tracing.h" +#include "k_tracer_defs.h" +#include "k_send_receive.h" +#include "protocol_http.h" +#include "protocol_tcp.h" +#include "k_unix_sock_tracker.h" + +static __always_inline struct unix_sock *unix_sock_from_socket(struct socket *sock) { + struct sock *sk; + BPF_CORE_READ_INTO(&sk, sock, sk); + + return (struct unix_sock *)sk; +} + +static __always_inline struct unix_sock *unix_sock_from_sk(struct sock *sk) { + return (struct unix_sock *)sk; +} + +static __always_inline void +connection_info_for_inode(connection_info_t *conn, u32 inode, u32 peer_inode) { + // ensure they are sorted + if (peer_inode > inode) { + conn->s_ip[0] = peer_inode; + conn->d_ip[0] = inode; + } else { + conn->s_ip[0] = inode; + conn->d_ip[0] = peer_inode; + } +} + +static __always_inline void +pid_connection_info_for_inode(u64 id, pid_connection_info_t *p_conn, u32 inode, u32 peer_inode) { + p_conn->pid = pid_from_pid_tgid(id); + connection_info_for_inode(&p_conn->conn, inode, peer_inode); +} + +SEC("kprobe/unix_stream_recvmsg") +int BPF_KPROBE( + kprobe_unix_stream_recvmsg, struct socket *sock, struct msghdr *msg, size_t size, int flags) { + u64 id = bpf_get_current_pid_tgid(); + + if (!valid_pid(id)) { + return 0; + } + + bpf_printk("=== unix_stream recvmsg %d ===", id); + + struct sock *sk; + BPF_CORE_READ_INTO(&sk, sock, sk); + + if (!sk) { + bpf_dbg_printk("can't find sock ptr"); + return 0; + } + + unsigned long inode_number; + unsigned long peer_inode_number = 0; + BPF_CORE_READ_INTO(&inode_number, sock, sk, sk_socket, file, f_inode, i_ino); + + struct unix_sock *usock = unix_sock_from_socket(sock); + + if (usock) { + BPF_CORE_READ_INTO(&peer_inode_number, usock, peer, sk_socket, file, f_inode, i_ino); + } + bpf_dbg_printk("ino %d, peer ino %d", inode_number, peer_inode_number); + + if (peer_inode_number) { + pid_connection_info_t p_conn = {.conn = {0}}; + pid_connection_info_t partial_p_conn = {.conn = {0}}; + pid_connection_info_for_inode(id, &p_conn, inode_number, peer_inode_number); + + // On the first communication between the unix sockets, the peer ino is 0. + // We look this up on the receive side and fix up the trace information, so + // that we can correctly correlate the requests. + + // For the trace information, we look up the peer. + pid_connection_info_for_inode(id, &partial_p_conn, 0, peer_inode_number); + + tp_info_pid_t *existing_tp = + trace_info_for_connection(&partial_p_conn.conn, TRACE_TYPE_CLIENT); + // We found the partial client connection info, delete the old one, + // and add a new one now with the peer information. + if (existing_tp) { + tp_info_pid_t tp = *existing_tp; + delete_trace_info_for_connection(&partial_p_conn.conn, TRACE_TYPE_CLIENT); + set_trace_info_for_connection(&p_conn.conn, TRACE_TYPE_CLIENT, &tp); + } + + // For the ongoing information we look up ourselves + pid_connection_info_for_inode(id, &partial_p_conn, inode_number, 0); + + // Fix up next the HTTP or TCP request info. We try for TCP info first + // since most commonly this setup of unix sockets is related to FastCGI. + tcp_req_t *existing_tcp = + (tcp_req_t *)bpf_map_lookup_elem(&ongoing_tcp_req, &partial_p_conn); + if (existing_tcp) { + tcp_req_t *req = empty_tcp_req(); + if (req) { + __builtin_memcpy(req, existing_tcp, sizeof(tcp_req_t)); + bpf_map_delete_elem(&ongoing_tcp_req, &partial_p_conn); + bpf_map_update_elem(&ongoing_tcp_req, &p_conn, req, BPF_ANY); + } + } else { + http_info_t *existing_http = + (http_info_t *)bpf_map_lookup_elem(&ongoing_http, &partial_p_conn); + + if (existing_http) { + http_info_t *req = empty_http_info(); + if (req) { + __builtin_memcpy(req, existing_http, sizeof(http_info_t)); + bpf_map_delete_elem(&ongoing_http, &partial_p_conn); + bpf_map_update_elem(&ongoing_http, &p_conn, req, BPF_ANY); + } + } + } + } + + // Make sure we don't have stale event from earlier socket connection if they are + // sent through the same socket. This mainly happens if the server overlays virtual + // threads in the runtime. + u64 sock_p = (u64)sk; + ensure_sent_event(id, &sock_p); + + recv_args_t args = { + .sock_ptr = (u64)sk, + }; + + get_iovec_ctx((iovec_iter_ctx *)&args.iovec_ctx, msg); + + bpf_map_update_elem(&active_recv_args, &id, &args, BPF_ANY); + + return 0; +} + +static __always_inline int return_unix_recvmsg(void *ctx, u64 id, int copied_len) { + recv_args_t *args = (recv_args_t *)bpf_map_lookup_elem(&active_recv_args, &id); + + bpf_dbg_printk( + "=== return unix recvmsg id=%d args=%llx copied_len %d ===", id, args, copied_len); + + if (!args || (copied_len <= 0)) { + return 0; + } + + iovec_iter_ctx *iov_ctx = (iovec_iter_ctx *)&args->iovec_ctx; + + if (!iov_ctx->iov && !iov_ctx->ubuf) { + bpf_dbg_printk("iovec_ptr found in kprobe is NULL, ignoring this tcp_recvmsg"); + bpf_map_delete_elem(&active_recv_args, &id); + + return 0; + } + + struct sock *sock_ptr = (struct sock *)args->sock_ptr; + + unsigned long inode_number; + unsigned long peer_inode_number = 0; + BPF_CORE_READ_INTO(&inode_number, sock_ptr, sk_socket, file, f_inode, i_ino); + struct unix_sock *usock = unix_sock_from_sk(sock_ptr); + + if (usock) { + BPF_CORE_READ_INTO(&peer_inode_number, usock, peer, sk_socket, file, f_inode, i_ino); + } + + bpf_dbg_printk("ino %d, peer ino %d", inode_number, peer_inode_number); + + pid_connection_info_t p_conn = {.conn = {0}}; + + pid_connection_info_for_inode(id, &p_conn, inode_number, peer_inode_number); + + bpf_map_delete_elem(&active_recv_args, &id); + + u8 *buf = iovec_memory(); + if (buf) { + // We may read less than copied_len, iovec iterators are limited + // to const iterations in our BPF code. + int read_len = read_iovec_ctx(iov_ctx, buf, copied_len); + if (read_len) { + // doesn't return must be logically last statement + handle_buf_with_connection(ctx, &p_conn, buf, read_len, NO_SSL, TCP_RECV, 0); + } else { + bpf_dbg_printk("Not copied anything"); + } + } + + return 0; +} + +SEC("kretprobe/unix_stream_recvmsg") +int BPF_KRETPROBE(kretprobe_unix_stream_recvmsg, size_t copied) { + u64 id = bpf_get_current_pid_tgid(); + + if (!valid_pid(id)) { + return 0; + } + + bpf_dbg_printk("=== kretprobe_unix_stream_recvmsg id=%d copied_len %d ===", id, copied); + + return return_unix_recvmsg(ctx, id, copied); +} + +SEC("kprobe/unix_stream_sendmsg") +int BPF_KPROBE(kprobe_unix_stream_sendmsg, struct socket *sock, struct msghdr *msg, size_t size) { + u64 id = bpf_get_current_pid_tgid(); + + if (!valid_pid(id)) { + return 0; + } + + bpf_printk("=== unix_stream sendmsg %d ===", id); + + struct sock *sk; + BPF_CORE_READ_INTO(&sk, sock, sk); + + unsigned long inode_number; + unsigned long peer_inode_number = 0; + BPF_CORE_READ_INTO(&inode_number, sock, sk, sk_socket, file, f_inode, i_ino); + + struct unix_sock *usock = unix_sock_from_sk(sk); + + if (usock) { + BPF_CORE_READ_INTO(&peer_inode_number, usock, peer, sk_socket, file, f_inode, i_ino); + } + bpf_dbg_printk("ino %d, peer ino %d", inode_number, peer_inode_number); + + send_args_t s_args = {.size = size, .p_conn = {.conn = {0}}, .sock_ptr = (u64)sk}; + + pid_connection_info_for_inode(id, &s_args.p_conn, inode_number, peer_inode_number); + + u8 *buf = iovec_memory(); + if (buf) { + size = read_msghdr_buf(msg, buf, size); + if (size) { + bpf_map_update_elem(&active_send_args, &id, &s_args, BPF_ANY); + + if (sk) { + u64 sock_p = (u64)sk; + bpf_map_update_elem(&active_send_sock_args, &sock_p, &s_args, BPF_ANY); + } + + handle_buf_with_connection(ctx, &s_args.p_conn, buf, size, NO_SSL, TCP_SEND, 0); + } else { + bpf_dbg_printk("can't find iovec ptr in msghdr, not tracking sendmsg"); + } + } + + return 0; +} + +SEC("kretprobe/unix_stream_sendmsg") +int BPF_KRETPROBE(kretprobe_unix_stream_sendmsg, int sent_len) { + u64 id = bpf_get_current_pid_tgid(); + + if (!valid_pid(id)) { + return 0; + } + + bpf_dbg_printk("=== kretprobe unix_stream sendmsg=%d sent %d===", id, sent_len); + + send_args_t *s_args = (send_args_t *)bpf_map_lookup_elem(&active_send_args, &id); + if (s_args) { + // Unix socket calls can be interleaved, so for black-box context propagation, + // we need to differentiate them. We setup here the last sent active ino, + // which serves as the extra_runtime id. This is enough to differentiate the + // various requests, because we communicate this extra id to the receiving side + // and is able to correlate the incoming request. + if (s_args->sock_ptr) { + struct sock *sk = (struct sock *)s_args->sock_ptr; + unsigned long inode_number; + BPF_CORE_READ_INTO(&inode_number, sk, sk_socket, file, f_inode, i_ino); + + if (inode_number) { + bpf_map_update_elem(&active_unix_socks, &id, &inode_number, BPF_ANY); + } + } + + if (sent_len > 0) { + update_http_sent_len(&s_args->p_conn, sent_len); + } + + // Sometimes app servers don't send close, but small responses back + if (sent_len < MIN_HTTP_SIZE) { + finish_possible_delayed_http_request(&s_args->p_conn); + } + } + + return 0; +} + +#endif \ No newline at end of file diff --git a/bpf/k_unix_sock_tracker.h b/bpf/k_unix_sock_tracker.h new file mode 100644 index 000000000..9bae5dfd6 --- /dev/null +++ b/bpf/k_unix_sock_tracker.h @@ -0,0 +1,15 @@ +#ifndef _K_UNIX_SOCK_TRACKER +#define _K_UNIX_SOCK_TRACKER + +#include "vmlinux.h" +#include "bpf_helpers.h" +#include "map_sizing.h" + +struct { + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __type(key, u64); // the pid_tid + __type(value, u32); // the last seen ino + __uint(max_entries, MAX_CONCURRENT_REQUESTS); +} active_unix_socks SEC(".maps"); + +#endif \ No newline at end of file diff --git a/bpf/protocol_defs.h b/bpf/protocol_defs.h index e9d8c03ff..6f44d72b0 100644 --- a/bpf/protocol_defs.h +++ b/bpf/protocol_defs.h @@ -2,8 +2,9 @@ #define PROTOCOL_DEFS_H // Taken from linux/socket.h -#define AF_INET 2 /* Internet IP Protocol */ -#define AF_INET6 10 /* IP version 6 */ +#define AF_UNIX 1 /* Unix sockets */ +#define AF_INET 2 /* Internet IP Protocol */ +#define AF_INET6 10 /* IP version 6 */ #define IP_V6_ADDR_LEN 16 #define IP_V6_ADDR_LEN_WORDS 4 diff --git a/bpf/protocol_tcp.h b/bpf/protocol_tcp.h index 2fda800a0..dc086136c 100644 --- a/bpf/protocol_tcp.h +++ b/bpf/protocol_tcp.h @@ -36,6 +36,7 @@ static __always_inline tcp_req_t *empty_tcp_req() { static __always_inline void init_new_trace(tp_info_t *tp) { new_trace_id(tp); + urand_bytes(tp->span_id, SPAN_ID_SIZE_BYTES); __builtin_memset(tp->parent_id, 0, sizeof(tp->span_id)); } @@ -84,6 +85,18 @@ static __always_inline void tcp_get_or_set_trace_info(tcp_req_t *req, } } +static __always_inline void cleanup_trace_info(tcp_req_t *tcp, pid_connection_info_t *pid_conn) { + if (tcp->direction == TCP_RECV) { + trace_key_t t_key = {0}; + task_tid(&t_key.p_key); + t_key.extra_id = tcp->extra_id; + + delete_server_trace(&t_key); + } else { + delete_client_trace_info(pid_conn); + } +} + static __always_inline void handle_unknown_tcp_connection(pid_connection_info_t *pid_conn, void *u_buf, int bytes_len, @@ -98,6 +111,14 @@ static __always_inline void handle_unknown_tcp_connection(pid_connection_info_t } } if (!existing) { + if (direction == TCP_RECV) { + trace_key_t *tk = bpf_map_lookup_elem(&client_connect_info, pid_conn); + if (tk) { + bpf_dbg_printk("Got receive as first operation for client connection, ignoring..."); + return; + } + } + tcp_req_t *req = empty_tcp_req(); if (req) { req->flags = EVENT_TCP_REQUEST; @@ -109,6 +130,7 @@ static __always_inline void handle_unknown_tcp_connection(pid_connection_info_t req->end_monotime_ns = 0; req->resp_len = 0; req->len = bytes_len; + req->extra_id = extra_runtime_id(); task_pid(&req->pid); bpf_probe_read(req->buf, K_TCP_MAX_LEN, u_buf); @@ -133,6 +155,7 @@ static __always_inline void handle_unknown_tcp_connection(pid_connection_info_t bpf_probe_read(trace->rbuf, K_TCP_RES_LEN, u_buf); bpf_ringbuf_submit(trace, get_flags()); } + cleanup_trace_info(existing, pid_conn); } } else if (existing->len > 0 && existing->len < (K_TCP_MAX_LEN / 2)) { // Attempt to append one more packet. I couldn't convince the verifier diff --git a/bpf/runtime.h b/bpf/runtime.h index 96f0f5e86..78e60de46 100644 --- a/bpf/runtime.h +++ b/bpf/runtime.h @@ -5,6 +5,7 @@ #include "bpf_helpers.h" #include "pid_types.h" #include "nodejs.h" +#include "k_unix_sock_tracker.h" static __always_inline u64 extra_runtime_id() { u64 id = bpf_get_current_pid_tgid(); @@ -14,6 +15,11 @@ static __always_inline u64 extra_runtime_id() { return *active_node_id; } + u32 *inode_num = (u32 *)bpf_map_lookup_elem(&active_unix_socks, &id); + if (inode_num) { + return (u64)(*inode_num); + } + return 0; } diff --git a/pkg/internal/ebpf/common/bpf_arm64_bpfel.go b/pkg/internal/ebpf/common/bpf_arm64_bpfel.go index 2b6b59ada..df560f91c 100644 --- a/pkg/internal/ebpf/common/bpf_arm64_bpfel.go +++ b/pkg/internal/ebpf/common/bpf_arm64_bpfel.go @@ -215,6 +215,7 @@ type bpfTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } // loadBpf returns the embedded CollectionSpec for bpf. diff --git a/pkg/internal/ebpf/common/bpf_arm64_bpfel.o b/pkg/internal/ebpf/common/bpf_arm64_bpfel.o index 16563d093..915925426 100644 --- a/pkg/internal/ebpf/common/bpf_arm64_bpfel.o +++ b/pkg/internal/ebpf/common/bpf_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3559bba801748d1127c4733c5a7cdde63e458f28a10744d07cee0306a7ee53e5 -size 4536 +oid sha256:7b01d5155416c0085c68af36e96ae7d5991ed6222402a7d403a93086c2beee68 +size 4544 diff --git a/pkg/internal/ebpf/common/bpf_x86_bpfel.go b/pkg/internal/ebpf/common/bpf_x86_bpfel.go index 91c9a24b2..8b042d4fa 100644 --- a/pkg/internal/ebpf/common/bpf_x86_bpfel.go +++ b/pkg/internal/ebpf/common/bpf_x86_bpfel.go @@ -215,6 +215,7 @@ type bpfTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } // loadBpf returns the embedded CollectionSpec for bpf. diff --git a/pkg/internal/ebpf/common/bpf_x86_bpfel.o b/pkg/internal/ebpf/common/bpf_x86_bpfel.o index 16563d093..915925426 100644 --- a/pkg/internal/ebpf/common/bpf_x86_bpfel.o +++ b/pkg/internal/ebpf/common/bpf_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3559bba801748d1127c4733c5a7cdde63e458f28a10744d07cee0306a7ee53e5 -size 4536 +oid sha256:7b01d5155416c0085c68af36e96ae7d5991ed6222402a7d403a93086c2beee68 +size 4544 diff --git a/pkg/internal/ebpf/common/tcp_detect_transform.go b/pkg/internal/ebpf/common/tcp_detect_transform.go index dd332e2d9..706c3e553 100644 --- a/pkg/internal/ebpf/common/tcp_detect_transform.go +++ b/pkg/internal/ebpf/common/tcp_detect_transform.go @@ -42,6 +42,8 @@ func ReadTCPRequestIntoSpan(cfg *config.EPPFTracer, record *ringbuf.Record, filt } else { op, table, sql, kind = detectSQLPayload(cfg.HeuristicSQLDetect, event.Rbuf[:rl]) if validSQL(op, table) { + reverseTCPEvent(&event) + return TCPToSQLToSpan(&event, op, table, sql, kind), false, nil } } diff --git a/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.go index 7ed36fe64..e2e7dd9c0 100644 --- a/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.go @@ -136,8 +136,9 @@ type bpfRecvArgsT struct { } type bpfSendArgsT struct { - P_conn bpfPidConnectionInfoT - Size uint64 + P_conn bpfPidConnectionInfoT + Size uint64 + SockPtr uint64 } type bpfSockArgsT struct { @@ -183,6 +184,7 @@ type bpfTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpfTpInfoPidT struct { @@ -251,36 +253,40 @@ 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"` - 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"` - 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"` + 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. @@ -297,6 +303,7 @@ type bpfMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` CloneMap *ebpf.MapSpec `ebpf:"clone_map"` @@ -358,6 +365,7 @@ type bpfMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` CloneMap *ebpf.Map `ebpf:"clone_map"` @@ -402,6 +410,7 @@ func (m *bpfMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.ClientConnectInfo, m.CloneMap, @@ -439,36 +448,40 @@ 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"` - 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"` - 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"` + 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 { @@ -482,12 +495,16 @@ func (p *bpfPrograms) Close() error { p.KprobeTcpRcvEstablished, p.KprobeTcpRecvmsg, p.KprobeTcpSendmsg, + p.KprobeUnixStreamRecvmsg, + p.KprobeUnixStreamSendmsg, p.KretprobeSockAlloc, p.KretprobeSysAccept4, p.KretprobeSysClone, p.KretprobeSysConnect, p.KretprobeTcpRecvmsg, p.KretprobeTcpSendmsg, + p.KretprobeUnixStreamRecvmsg, + p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, p.ProtocolTcp, diff --git a/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.o index 881d8d343..0942b3e58 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:3e1cf63db03527c347efbf8915f52d78626ddca3f903a64883196a04a6cf4b5c -size 536488 +oid sha256:1b8e80f99ca0d4aec3d9f1b7669d81d1593e57eab17b98c45cf2496bda620304 +size 636872 diff --git a/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.go index 08b762067..5ddf548d3 100644 --- a/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.go @@ -136,8 +136,9 @@ type bpf_debugRecvArgsT struct { } type bpf_debugSendArgsT struct { - P_conn bpf_debugPidConnectionInfoT - Size uint64 + P_conn bpf_debugPidConnectionInfoT + Size uint64 + SockPtr uint64 } type bpf_debugSockArgsT struct { @@ -183,6 +184,7 @@ type bpf_debugTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpf_debugTpInfoPidT struct { @@ -251,36 +253,40 @@ 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"` - 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"` - 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"` + 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. @@ -297,6 +303,7 @@ type bpf_debugMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` CloneMap *ebpf.MapSpec `ebpf:"clone_map"` @@ -359,6 +366,7 @@ type bpf_debugMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` CloneMap *ebpf.Map `ebpf:"clone_map"` @@ -404,6 +412,7 @@ func (m *bpf_debugMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.ClientConnectInfo, m.CloneMap, @@ -442,36 +451,40 @@ 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"` - 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"` - 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"` + 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 { @@ -485,12 +498,16 @@ func (p *bpf_debugPrograms) Close() error { p.KprobeTcpRcvEstablished, p.KprobeTcpRecvmsg, p.KprobeTcpSendmsg, + p.KprobeUnixStreamRecvmsg, + p.KprobeUnixStreamSendmsg, p.KretprobeSockAlloc, p.KretprobeSysAccept4, p.KretprobeSysClone, p.KretprobeSysConnect, p.KretprobeTcpRecvmsg, p.KretprobeTcpSendmsg, + p.KretprobeUnixStreamRecvmsg, + p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, p.ProtocolTcp, diff --git a/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.o index c9d5245ae..89ba715f2 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:1ed41d825128c3175044f335e9f20a75794dd013c6bc6cdb9ae25a3272cb0bd8 -size 915472 +oid sha256:dd02b702152f5df04f3776927f5e01abc30de46b178451acb0547ad26f0c8485 +size 1074272 diff --git a/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.go index 47f86ee59..954a36b8a 100644 --- a/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.go @@ -136,8 +136,9 @@ type bpf_debugRecvArgsT struct { } type bpf_debugSendArgsT struct { - P_conn bpf_debugPidConnectionInfoT - Size uint64 + P_conn bpf_debugPidConnectionInfoT + Size uint64 + SockPtr uint64 } type bpf_debugSockArgsT struct { @@ -183,6 +184,7 @@ type bpf_debugTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpf_debugTpInfoPidT struct { @@ -251,36 +253,40 @@ 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"` - 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"` - 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"` + 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. @@ -297,6 +303,7 @@ type bpf_debugMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` CloneMap *ebpf.MapSpec `ebpf:"clone_map"` @@ -359,6 +366,7 @@ type bpf_debugMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` CloneMap *ebpf.Map `ebpf:"clone_map"` @@ -404,6 +412,7 @@ func (m *bpf_debugMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.ClientConnectInfo, m.CloneMap, @@ -442,36 +451,40 @@ 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"` - 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"` - 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"` + 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 { @@ -485,12 +498,16 @@ func (p *bpf_debugPrograms) Close() error { p.KprobeTcpRcvEstablished, p.KprobeTcpRecvmsg, p.KprobeTcpSendmsg, + p.KprobeUnixStreamRecvmsg, + p.KprobeUnixStreamSendmsg, p.KretprobeSockAlloc, p.KretprobeSysAccept4, p.KretprobeSysClone, p.KretprobeSysConnect, p.KretprobeTcpRecvmsg, p.KretprobeTcpSendmsg, + p.KretprobeUnixStreamRecvmsg, + p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, p.ProtocolTcp, diff --git a/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.o index 97a7efeab..3fa10cd11 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:61e5375aa892a9f8c6554290b23e355f30a0b1beb6ae74147b63aaa0f7e4342d -size 915032 +oid sha256:41c9d1462904fbe9392ef81f372fb399c3085d7d6475197cd76c7c0552fe25ee +size 1073840 diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.go index a77bc856b..2b2297043 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.go @@ -136,8 +136,9 @@ type bpf_tpRecvArgsT struct { } type bpf_tpSendArgsT struct { - P_conn bpf_tpPidConnectionInfoT - Size uint64 + P_conn bpf_tpPidConnectionInfoT + Size uint64 + SockPtr uint64 } type bpf_tpSockArgsT struct { @@ -183,6 +184,7 @@ type bpf_tpTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpf_tpTpInfoPidT struct { @@ -251,36 +253,40 @@ 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"` - 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"` - 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"` + 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. @@ -297,6 +303,7 @@ type bpf_tpMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` CloneMap *ebpf.MapSpec `ebpf:"clone_map"` @@ -358,6 +365,7 @@ type bpf_tpMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` CloneMap *ebpf.Map `ebpf:"clone_map"` @@ -402,6 +410,7 @@ func (m *bpf_tpMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.ClientConnectInfo, m.CloneMap, @@ -439,36 +448,40 @@ 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"` - 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"` - 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"` + 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 { @@ -482,12 +495,16 @@ func (p *bpf_tpPrograms) Close() error { p.KprobeTcpRcvEstablished, p.KprobeTcpRecvmsg, p.KprobeTcpSendmsg, + p.KprobeUnixStreamRecvmsg, + p.KprobeUnixStreamSendmsg, p.KretprobeSockAlloc, p.KretprobeSysAccept4, p.KretprobeSysClone, p.KretprobeSysConnect, p.KretprobeTcpRecvmsg, p.KretprobeTcpSendmsg, + p.KretprobeUnixStreamRecvmsg, + p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, p.ProtocolTcp, diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.o index abf7ca1d1..36219046b 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:516ea3f7bc64ef0fdabd3aa49ed0378ec6e22b60d023e433a02861a79c9d7dea -size 550776 +oid sha256:9532e686253334ff9b887be3f1f5d7e55de14af21a12e358acb2d16f190e3d11 +size 651360 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 76ae2fd6e..9e3efec9d 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.go @@ -136,8 +136,9 @@ type bpf_tp_debugRecvArgsT struct { } type bpf_tp_debugSendArgsT struct { - P_conn bpf_tp_debugPidConnectionInfoT - Size uint64 + P_conn bpf_tp_debugPidConnectionInfoT + Size uint64 + SockPtr uint64 } type bpf_tp_debugSockArgsT struct { @@ -183,6 +184,7 @@ type bpf_tp_debugTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpf_tp_debugTpInfoPidT struct { @@ -251,36 +253,40 @@ 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"` - 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"` - 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"` + 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. @@ -297,6 +303,7 @@ type bpf_tp_debugMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` CloneMap *ebpf.MapSpec `ebpf:"clone_map"` @@ -359,6 +366,7 @@ type bpf_tp_debugMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` CloneMap *ebpf.Map `ebpf:"clone_map"` @@ -404,6 +412,7 @@ func (m *bpf_tp_debugMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.ClientConnectInfo, m.CloneMap, @@ -442,36 +451,40 @@ 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"` - 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"` - 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"` + 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 { @@ -485,12 +498,16 @@ func (p *bpf_tp_debugPrograms) Close() error { p.KprobeTcpRcvEstablished, p.KprobeTcpRecvmsg, p.KprobeTcpSendmsg, + p.KprobeUnixStreamRecvmsg, + p.KprobeUnixStreamSendmsg, p.KretprobeSockAlloc, p.KretprobeSysAccept4, p.KretprobeSysClone, p.KretprobeSysConnect, p.KretprobeTcpRecvmsg, p.KretprobeTcpSendmsg, + p.KretprobeUnixStreamRecvmsg, + p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, p.ProtocolTcp, 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 06fd3cda9..c6667f702 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:3db01edbc4fefb1e3101a382caedca4fd43cd5a99ecd4e3888fa621ee131473f -size 933304 +oid sha256:bbbf7c2ebccded580a43dea0e73d32a1fb65fa3cfeb6b50e8ef77d96ff47c0fe +size 1092616 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 cda7748ec..a0ff3f429 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.go @@ -136,8 +136,9 @@ type bpf_tp_debugRecvArgsT struct { } type bpf_tp_debugSendArgsT struct { - P_conn bpf_tp_debugPidConnectionInfoT - Size uint64 + P_conn bpf_tp_debugPidConnectionInfoT + Size uint64 + SockPtr uint64 } type bpf_tp_debugSockArgsT struct { @@ -183,6 +184,7 @@ type bpf_tp_debugTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpf_tp_debugTpInfoPidT struct { @@ -251,36 +253,40 @@ 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"` - 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"` - 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"` + 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. @@ -297,6 +303,7 @@ type bpf_tp_debugMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` CloneMap *ebpf.MapSpec `ebpf:"clone_map"` @@ -359,6 +366,7 @@ type bpf_tp_debugMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` CloneMap *ebpf.Map `ebpf:"clone_map"` @@ -404,6 +412,7 @@ func (m *bpf_tp_debugMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.ClientConnectInfo, m.CloneMap, @@ -442,36 +451,40 @@ 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"` - 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"` - 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"` + 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 { @@ -485,12 +498,16 @@ func (p *bpf_tp_debugPrograms) Close() error { p.KprobeTcpRcvEstablished, p.KprobeTcpRecvmsg, p.KprobeTcpSendmsg, + p.KprobeUnixStreamRecvmsg, + p.KprobeUnixStreamSendmsg, p.KretprobeSockAlloc, p.KretprobeSysAccept4, p.KretprobeSysClone, p.KretprobeSysConnect, p.KretprobeTcpRecvmsg, p.KretprobeTcpSendmsg, + p.KretprobeUnixStreamRecvmsg, + p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, p.ProtocolTcp, 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 d25a2eaba..ded1ca2b0 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:dcd84ebf054f6faf7ffa9d5e8a48966251066b85df9326666f22a7b4f2d7d64d -size 932864 +oid sha256:d51eee8e3a88155e11f9ce98d79d917362f7995b2ffd4a91d6cc5c174a031acb +size 1092184 diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.go index 5bd49d7cf..ab394add2 100644 --- a/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.go @@ -136,8 +136,9 @@ type bpf_tpRecvArgsT struct { } type bpf_tpSendArgsT struct { - P_conn bpf_tpPidConnectionInfoT - Size uint64 + P_conn bpf_tpPidConnectionInfoT + Size uint64 + SockPtr uint64 } type bpf_tpSockArgsT struct { @@ -183,6 +184,7 @@ type bpf_tpTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpf_tpTpInfoPidT struct { @@ -251,36 +253,40 @@ 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"` - 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"` - 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"` + 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. @@ -297,6 +303,7 @@ type bpf_tpMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` CloneMap *ebpf.MapSpec `ebpf:"clone_map"` @@ -358,6 +365,7 @@ type bpf_tpMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` CloneMap *ebpf.Map `ebpf:"clone_map"` @@ -402,6 +410,7 @@ func (m *bpf_tpMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.ClientConnectInfo, m.CloneMap, @@ -439,36 +448,40 @@ 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"` - 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"` - 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"` + 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 { @@ -482,12 +495,16 @@ func (p *bpf_tpPrograms) Close() error { p.KprobeTcpRcvEstablished, p.KprobeTcpRecvmsg, p.KprobeTcpSendmsg, + p.KprobeUnixStreamRecvmsg, + p.KprobeUnixStreamSendmsg, p.KretprobeSockAlloc, p.KretprobeSysAccept4, p.KretprobeSysClone, p.KretprobeSysConnect, p.KretprobeTcpRecvmsg, p.KretprobeTcpSendmsg, + p.KretprobeUnixStreamRecvmsg, + p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, p.ProtocolTcp, diff --git a/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.o index 8f0939276..7b9cd60a1 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:84124bcfa2d03c5f1512db17d0acbe9d158ce8e00ad403521acaeb60d0fa5701 -size 550176 +oid sha256:437c59ebff500c0ede491032b53484295a0f0058cf676a800892bb8ad921930e +size 650736 diff --git a/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.go b/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.go index 1dc380608..d3d26a4cd 100644 --- a/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.go +++ b/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.go @@ -136,8 +136,9 @@ type bpfRecvArgsT struct { } type bpfSendArgsT struct { - P_conn bpfPidConnectionInfoT - Size uint64 + P_conn bpfPidConnectionInfoT + Size uint64 + SockPtr uint64 } type bpfSockArgsT struct { @@ -183,6 +184,7 @@ type bpfTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpfTpInfoPidT struct { @@ -251,36 +253,40 @@ 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"` - 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"` - 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"` + 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. @@ -297,6 +303,7 @@ type bpfMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` CloneMap *ebpf.MapSpec `ebpf:"clone_map"` @@ -358,6 +365,7 @@ type bpfMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` CloneMap *ebpf.Map `ebpf:"clone_map"` @@ -402,6 +410,7 @@ func (m *bpfMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.ClientConnectInfo, m.CloneMap, @@ -439,36 +448,40 @@ 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"` - 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"` - 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"` + 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 { @@ -482,12 +495,16 @@ func (p *bpfPrograms) Close() error { p.KprobeTcpRcvEstablished, p.KprobeTcpRecvmsg, p.KprobeTcpSendmsg, + p.KprobeUnixStreamRecvmsg, + p.KprobeUnixStreamSendmsg, p.KretprobeSockAlloc, p.KretprobeSysAccept4, p.KretprobeSysClone, p.KretprobeSysConnect, p.KretprobeTcpRecvmsg, p.KretprobeTcpSendmsg, + p.KretprobeUnixStreamRecvmsg, + p.KretprobeUnixStreamSendmsg, p.ProtocolHttp, p.ProtocolHttp2, p.ProtocolTcp, diff --git a/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.o b/pkg/internal/ebpf/generictracer/bpf_x86_bpfel.o index 68ec79306..4debb673e 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:d859ddef84f6eb1d9f144beaa69cb59fd08a96ae338b77d72f585c7cea4ce09d -size 535888 +oid sha256:abd5e3f90a4584a11290eedd6e35ad4b4d999d7146348b1d8047a4cdec210af9 +size 636256 diff --git a/pkg/internal/ebpf/generictracer/generictracer.go b/pkg/internal/ebpf/generictracer/generictracer.go index b90bd80eb..fc87a003f 100644 --- a/pkg/internal/ebpf/generictracer/generictracer.go +++ b/pkg/internal/ebpf/generictracer/generictracer.go @@ -284,6 +284,16 @@ func (p *Tracer) KProbes() map[string]ebpfcommon.FunctionPrograms { Required: true, Start: p.bpfObjects.KprobeSysExit, }, + "unix_stream_recvmsg": { + Required: true, + Start: p.bpfObjects.KprobeUnixStreamRecvmsg, + End: p.bpfObjects.KretprobeUnixStreamRecvmsg, + }, + "unix_stream_sendmsg": { + Required: true, + Start: p.bpfObjects.KprobeUnixStreamSendmsg, + End: p.bpfObjects.KretprobeUnixStreamSendmsg, + }, } } diff --git a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o index da0486c66..24adba6d5 100644 --- a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2705a4b8715a347b64b04dc633e5fea4c2ba70c890db9055fbf6927a6715698a +oid sha256:e3fc9fc1aab32525ef28649a0cd9cf410aa8659cf2cdeb624e4fc67f696a0457 size 381008 diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o index fef714d74..3d417fb00 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:32f9fd6f88f5c616e8312c3a1454e0656f25a53a71c5331b86b3c888132dedfd +oid sha256:acff4b175784a87fc0cd056fba0da72bf72ea158ab8bb3dd3a04306d8b232696 size 884144 diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o index 440d589be..a6e53216e 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:88faa153e5c574df247e46030e698f795afdcc8933cd39e6c7be1e38f9734408 +oid sha256:821e1c266e50322e5157b836742cda621ca9a1582961e1571fceed88fb63176f size 885944 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o index 557b8a77d..ca10079a0 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:24f2a99087364cd54eff3b596050e44e11483b1e56e053656b3bbf8c6b8127a0 +oid sha256:745e773fb26c6893c2d29e15ce9216acda377c17d178d2ba97e6d4eb63d83c05 size 428128 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o index fdae2dc88..5738e9799 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f9e06265710208a910cbe72c2f401379b4aa7254b2b95270ea90f3b5f09c06c6 +oid sha256:5e9385248c28e88d4d18fd7d9abacd08890bc11511a28c0308170a0fbaec5f54 size 984512 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o index 5a232b4fd..d2727823f 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:87ea917661b0d145823382b64c14305c31e26edcad83919c09f0dea4fd81e665 +oid sha256:83e196c531fa0c211611e6988d863d690d320ad6acfd143d3c4d8e0d45382f6f size 986304 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o index e61be0470..849c1a894 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2bf6c526ed0ac2a05318014ea6b8d667467bedc2d2618618560bf13ce375e4bc +oid sha256:359104fc51e73e12f840c16cc5bf8eb580c2545de40b0fd5a5186dbba9c043d5 size 429888 diff --git a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o index 762176151..d946e691c 100644 --- a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4ff91fb4ed1b14ab8b6fd56335d45e3662316024dccb26f7d3d601be908b87d6 +oid sha256:cc56df5e06bfca793f1614ce589aaf799b28ace175ce90fd2fe21000693b0b0e size 382832 diff --git a/pkg/internal/ebpf/httptracer/bpf_arm64_bpfel.o b/pkg/internal/ebpf/httptracer/bpf_arm64_bpfel.o index e4d7f1783..a65c10206 100644 --- a/pkg/internal/ebpf/httptracer/bpf_arm64_bpfel.o +++ b/pkg/internal/ebpf/httptracer/bpf_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:531109a911d19d42d1466d7b77f03898480fbcf7c90c9ca406fa11d9551c09b7 +oid sha256:df434981ca10e71b44eeda7bcfc12b112db63e74450023fdde5e8f4d56cd7c96 size 42984 diff --git a/pkg/internal/ebpf/httptracer/bpf_debug_arm64_bpfel.o b/pkg/internal/ebpf/httptracer/bpf_debug_arm64_bpfel.o index b581585c0..c7ac7589b 100644 --- a/pkg/internal/ebpf/httptracer/bpf_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/httptracer/bpf_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2f349266f8b0a5877954d37b97849a20c04c92ed6147389765b4ab04c24150eb +oid sha256:3146d12757a7437c70589673f3c4e4ad1e4c446f058af787b3e98ec95c4e93fc size 43232 diff --git a/pkg/internal/ebpf/httptracer/bpf_debug_x86_bpfel.o b/pkg/internal/ebpf/httptracer/bpf_debug_x86_bpfel.o index b05fee8fa..d1ccccbaf 100644 --- a/pkg/internal/ebpf/httptracer/bpf_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/httptracer/bpf_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dca31fa9a85115331b30b1587d9a1ffd20da5fef126f378ec33beb79d0b06d9b +oid sha256:c2ed6e92ddedd263ca06fa27de7f312e1a5c3d80f6b9d0119a9a9efe3cf24ae7 size 43112 diff --git a/pkg/internal/ebpf/httptracer/bpf_x86_bpfel.o b/pkg/internal/ebpf/httptracer/bpf_x86_bpfel.o index 0e54455b2..4f538beef 100644 --- a/pkg/internal/ebpf/httptracer/bpf_x86_bpfel.o +++ b/pkg/internal/ebpf/httptracer/bpf_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:244013c7a102f7bab54bed3203fa517b44464b043d41450d6e36e590cd78442d +oid sha256:d438a039747714927570b34debf995fe3bc25daa6bee16d9f9d9021b6cf13e69 size 42872 diff --git a/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.go b/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.go index 26e63738e..acd8aa476 100644 --- a/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.go +++ b/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.go @@ -186,6 +186,7 @@ type bpfTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpfTpBufDataT struct{ Buf [256]uint8 } @@ -276,6 +277,7 @@ type bpfMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` BufMem *ebpf.MapSpec `ebpf:"buf_mem"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` @@ -337,6 +339,7 @@ type bpfMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` BufMem *ebpf.Map `ebpf:"buf_mem"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` @@ -381,6 +384,7 @@ func (m *bpfMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.BufMem, m.ClientConnectInfo, diff --git a/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.o b/pkg/internal/ebpf/tctracer/bpf_arm64_bpfel.o index bc5ee0d44..09e3e91e6 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:ddf0d176b8e7f4c086403cd753222b633885ac1c37eaafcb9f29bc9c53da2495 -size 207288 +oid sha256:b2392df988db2516a75d47a1305e30308a3f976dcd1d6bef42319486afb385e5 +size 212512 diff --git a/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.go b/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.go index d1ea90789..0c1b823d5 100644 --- a/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.go @@ -186,6 +186,7 @@ type bpf_debugTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpf_debugTpBufDataT struct{ Buf [256]uint8 } @@ -276,6 +277,7 @@ type bpf_debugMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` BufMem *ebpf.MapSpec `ebpf:"buf_mem"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` @@ -338,6 +340,7 @@ type bpf_debugMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` BufMem *ebpf.Map `ebpf:"buf_mem"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` @@ -383,6 +386,7 @@ func (m *bpf_debugMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.BufMem, m.ClientConnectInfo, diff --git a/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.o b/pkg/internal/ebpf/tctracer/bpf_debug_arm64_bpfel.o index ba72bdedb..4f918b5de 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:24dab2726f31be8cfc05b6f270a3e49735d12982fdffa9aa7179a3c81e534725 -size 380824 +oid sha256:4af7ce28ad1eacc862d0ac4e38c8debbfcbfe5526b3df6d4025d6eaebc5a6834 +size 392456 diff --git a/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.go b/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.go index e3325a12b..a020ab599 100644 --- a/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.go @@ -186,6 +186,7 @@ type bpf_debugTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpf_debugTpBufDataT struct{ Buf [256]uint8 } @@ -276,6 +277,7 @@ type bpf_debugMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` BufMem *ebpf.MapSpec `ebpf:"buf_mem"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` @@ -338,6 +340,7 @@ type bpf_debugMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` BufMem *ebpf.Map `ebpf:"buf_mem"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` @@ -383,6 +386,7 @@ func (m *bpf_debugMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.BufMem, m.ClientConnectInfo, diff --git a/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.o b/pkg/internal/ebpf/tctracer/bpf_debug_x86_bpfel.o index c0c4516ee..d16d66b93 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:ead4c8e133887e4f71194770a8fb5004109701034d730a941b9e619d7d96ed8e -size 382128 +oid sha256:3e96508fd11f4ca0a1cd8ddcc41ec38ddeb067d5894925bf376ed10173af157e +size 393768 diff --git a/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.go b/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.go index f5681ed8b..3d57c01c2 100644 --- a/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.go +++ b/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.go @@ -186,6 +186,7 @@ type bpfTcpReqT struct { Flags uint8 _ [7]byte } + ExtraId uint64 } type bpfTpBufDataT struct{ Buf [256]uint8 } @@ -276,6 +277,7 @@ type bpfMapSpecs struct { ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.MapSpec `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.MapSpec `ebpf:"async_reset_args"` BufMem *ebpf.MapSpec `ebpf:"buf_mem"` ClientConnectInfo *ebpf.MapSpec `ebpf:"client_connect_info"` @@ -337,6 +339,7 @@ type bpfMaps struct { ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"` ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"` ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"` + ActiveUnixSocks *ebpf.Map `ebpf:"active_unix_socks"` AsyncResetArgs *ebpf.Map `ebpf:"async_reset_args"` BufMem *ebpf.Map `ebpf:"buf_mem"` ClientConnectInfo *ebpf.Map `ebpf:"client_connect_info"` @@ -381,6 +384,7 @@ func (m *bpfMaps) Close() error { m.ActiveSslHandshakes, m.ActiveSslReadArgs, m.ActiveSslWriteArgs, + m.ActiveUnixSocks, m.AsyncResetArgs, m.BufMem, m.ClientConnectInfo, diff --git a/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.o b/pkg/internal/ebpf/tctracer/bpf_x86_bpfel.o index 8527be8f5..46437de5f 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:54c47460fc90e3a103f6e35c5c7a694686dd8b0969be3768a9a4221839e4ac78 -size 208600 +oid sha256:3a741e0120ba322ae8f8735b15e21327cba8a4973880e0077928801604923084 +size 213816 diff --git a/test/integration/components/jaeger/jaeger.go b/test/integration/components/jaeger/jaeger.go index c3dfa19a1..db1d2b5fb 100644 --- a/test/integration/components/jaeger/jaeger.go +++ b/test/integration/components/jaeger/jaeger.go @@ -70,6 +70,20 @@ func (t *Trace) FindByOperationName(operationName string) []Span { return matches } +func (t *Trace) FindByOperationNameAndService(operationName, service string) []Span { + var matches []Span + for _, s := range t.Spans { + if s.OperationName == operationName { + if p, ok := t.Processes[s.ProcessID]; ok { + if p.ServiceName == service { + matches = append(matches, s) + } + } + } + } + return matches +} + func (t *Trace) ParentOf(s *Span) (Span, bool) { parentID := "" for _, ref := range s.References { diff --git a/test/integration/components/php/unix_sock_sql/config/mysql/custom.cnf b/test/integration/components/php/unix_sock_sql/config/mysql/custom.cnf new file mode 100644 index 000000000..02b0c634b --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/config/mysql/custom.cnf @@ -0,0 +1,102 @@ + +[mysqld] +# +# * Basic Settings +# +user = mysql +# pid-file = /var/run/mysqld/mysqld.pid +# socket = /var/run/mysqld/mysqld.sock +# port = 3306 +# datadir = /var/lib/mysql + + +# If MySQL is running as a replication slave, this should be +# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir +# tmpdir = /tmp +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +bind-address = 0.0.0.0 #change this to your ip +mysqlx-bind-address = 127.0.0.1 +# +# * Fine Tuning +# +key_buffer_size = 16M +# max_allowed_packet = 64M +# thread_stack = 256K +# open_file_limit = 200000 +default_storage_engine = InnoDB + + + +# This replaces the startup script and checks MyISAM tables if needed +# the first time they are touched +myisam-recover-options = BACKUP + +# max_connections = 151 + +# table_open_cache = 4000 + +# * INNODB +innodb_buffer_pool_size = 5096M +innodb_log_buffer_size = 512M +innodb_log_file_size = 512M +innodb_flush_log_at_trx_commit = 0 +innodb_flush_method = O_DIRECT +innodb_buffer_pool_instances = 8 +innodb_thread_concurrency = 8 +innodb_concurrency_tickets = 5000 +innodb_io_capacity = 5000 +innodb_io_capacity_max = 15000 +innodb_stats_on_metadata = 0 +innodb_buffer_pool_dump_at_shutdown = 1 +innodb_buffer_pool_load_at_startup = 1 +innodb_adaptive_hash_index = 1 +innodb_adaptive_hash_index_parts = 8 +innodb_checksum_algorithm = crc32 +innodb_read_io_threads = 8 +innodb_write_io_threads = 4 +innodb_file_per_table = 1 + + +# * OTHERS +skip_name_resolve = 1 +disable_log_bin = 1 +sync_binlog = 0 +thread_cache_size = 20 +#lower_case_table_names =1 #u can set this option after the first run -- then restart the mysqld service with the new value + + +join_buffer_size = 262K +sort_buffer_size = 262K +read_buffer_size = 132K +read_rnd_buffer_size = 262K + +# +# * Logging and Replication +# +# Both location gets rotated by the cronjob. +# +# Log all queries +# Be aware that this log type is a performance killer. +# general_log_file = /var/log/mysql/query.log +# general_log = 1 +# +# Error log - should be very few entries. +# +log_error = /var/log/mysql/error.log +# +# Here you can see queries with especially long duration +slow_query_log = 1 +slow_query_log_file = /var/log/mysql/slow.log +long_query_time = 10 +#log-queries-not-using-indexes + +# The following can be used as easy to replay backup logs or for replication. +# note: if you are setting up a replication slave, see README.Debian about +# other settings you may need to change. +# server-id = 1 +# log_bin = /var/log/mysql/mysql-bin.log +# binlog_expire_logs_seconds = 2592000 +# max_binlog_size = 100M +# binlog_do_db = include_database_name +# binlog_ignore_db = include_database_name diff --git a/test/integration/components/php/unix_sock_sql/config/nginx/nginx.conf b/test/integration/components/php/unix_sock_sql/config/nginx/nginx.conf new file mode 100644 index 000000000..5e4d6bac0 --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/config/nginx/nginx.conf @@ -0,0 +1,26 @@ +user www-data; +worker_processes 3; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + keepalive_timeout 65; + + include /etc/nginx/sites-enabled/*; +} + diff --git a/test/integration/components/php/unix_sock_sql/config/nginx/sites-available/default.conf b/test/integration/components/php/unix_sock_sql/config/nginx/sites-available/default.conf new file mode 100644 index 000000000..163f98af5 --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/config/nginx/sites-available/default.conf @@ -0,0 +1,18 @@ +server { + listen 80 default_server; + + root /var/www/html/; + index index.php index.html index.htm; + + server_name _; + location / { + try_files $uri $uri/ =404; + } + + location ~* \.php$ { + fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + } +} diff --git a/test/integration/components/php/unix_sock_sql/config/php/php-fpm.conf b/test/integration/components/php/unix_sock_sql/config/php/php-fpm.conf new file mode 100644 index 000000000..2aa14d3aa --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/config/php/php-fpm.conf @@ -0,0 +1,7 @@ +[global] +pid = /run/php-fpm/php-fpm.pid +error_log = /var/log/php/php-fpm.log +emergency_restart_threshold = 3 +emergency_restart_interval = 1m +process_control_timeout = 5s +include=etc/pool.d/*.conf diff --git a/test/integration/components/php/unix_sock_sql/config/php/php/php.ini b/test/integration/components/php/unix_sock_sql/config/php/php/php.ini new file mode 100644 index 000000000..402665e9f --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/config/php/php/php.ini @@ -0,0 +1,179 @@ +[PHP] + +engine = On +short_open_tag = Off +precision = 14 +output_buffering = 4096 +zlib.output_compression = Off +implicit_flush = Off +unserialize_callback_func = +serialize_precision = -1 +disable_functions = +disable_classes = +realpath_cache_size = 4M +realpath_cache_ttl = 300 +zend.enable_gc = On +zend.exception_ignore_args = On +zend.exception_string_param_max_len = 0 +expose_php = Off +max_execution_time = 30 +max_input_time = 60 +memory_limit = 128M +error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT +display_errors = Off +display_startup_errors = Off +log_errors = On +ignore_repeated_errors = Off +ignore_repeated_source = Off +report_memleaks = On +error_log = /var/log/php/error.log +variables_order = "GPCS" +request_order = "GP" +register_argc_argv = Off +auto_globals_jit = On +post_max_size = 1.5M +auto_prepend_file = +auto_append_file = +default_mimetype = "text/html" +default_charset = "UTF-8" +doc_root = +user_dir = +enable_dl = Off +file_uploads = On +upload_max_filesize = 1.1M +max_file_uploads = 1 +allow_url_fopen = Off +allow_url_include = Off +default_socket_timeout = 60 +zend_extension=opcache + +[CLI Server] +cli_server.color = On + +[Date] + +[filter] + +[iconv] + +[imap] + +[intl] + +[sqlite3] + +[Pcre] + +[Pdo] + +[Pdo_mysql] +pdo_mysql.default_socket= + +[Phar] + +[mail function] +SMTP = localhost +smtp_port = 25 +mail.add_x_header = Off + +[ODBC] +odbc.allow_persistent = On +odbc.check_persistent = On +odbc.max_persistent = -1 +odbc.max_links = -1 +odbc.defaultlrl = 4096 +odbc.defaultbinmode = 1 + +[MySQLi] + +mysqli.max_persistent = -1 +mysqli.allow_persistent = On +mysqli.max_links = -1 +mysqli.default_port = 3306 +mysqli.default_socket = +mysqli.default_host = +mysqli.default_user = +mysqli.default_pw = +mysqli.reconnect = Off + +[mysqlnd] + +mysqlnd.collect_statistics = On +mysqlnd.collect_memory_statistics = Off + +[OCI8] + +[PostgreSQL] + +pgsql.allow_persistent = On +pgsql.auto_reset_persistent = Off +pgsql.max_persistent = -1 +pgsql.max_links = -1 +pgsql.ignore_notice = 0 +pgsql.log_notice = 0 + +[bcmath] +bcmath.scale = 0 + +[browscap] + +[Session] +session.save_handler = files +session.use_strict_mode = 1 +session.use_cookies = 1 +session.cookie_secure = 1 +session.use_only_cookies = 1 +session.name = WASOL +session.auto_start = 0 +session.cookie_lifetime = 0 +session.cookie_path = / +session.cookie_domain = +session.cookie_httponly = 1 +session.cookie_samesite = +session.serialize_handler = php +session.gc_probability = 0 +session.gc_divisor = 1000 +session.gc_maxlifetime = 1440 +session.referer_check = +session.cache_limiter = nocache +session.cache_expire = 180 +session.use_trans_sid = 0 +session.sid_length = 26 +session.trans_sid_tags = "a=href,area=href,frame=src,form=" +session.sid_bits_per_character = 5 + +[Assertion] +zend.assertions = -1 + +[COM] + +[mbstring] + +[gd] + +[exif] + +[Tidy] +tidy.clean_output = Off + +[soap] +soap.wsdl_cache_enabled=0 +soap.wsdl_cache_dir="/tmp" +soap.wsdl_cache_ttl=86400 +soap.wsdl_cache_limit = 5 + +[sysvshm] + +[ldap] +ldap.max_links = -1 + +[dba] + +[opcache] + +[curl] + +[openssl] + +[ffi] + diff --git a/test/integration/components/php/unix_sock_sql/config/php/pool.d/www.conf b/test/integration/components/php/unix_sock_sql/config/php/pool.d/www.conf new file mode 100644 index 000000000..9f0ebb6b6 --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/config/php/pool.d/www.conf @@ -0,0 +1,11 @@ +[www] + +user = www-data +group = www-data +listen.owner = www-data +listen.group = www-data +pm = static +pm.max_children = 3 +pm.max_requests = 1000 +pm.status_path = /status +clear_env = no \ No newline at end of file diff --git a/test/integration/components/php/unix_sock_sql/config/php/pool.d/zz-sock.conf b/test/integration/components/php/unix_sock_sql/config/php/pool.d/zz-sock.conf new file mode 100644 index 000000000..93e2e6c06 --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/config/php/pool.d/zz-sock.conf @@ -0,0 +1,5 @@ +[global] +daemonize = no + +[www] +listen = /run/php-fpm/php-fpm.sock diff --git a/test/integration/components/php/unix_sock_sql/docker/Dockerfile_mysql b/test/integration/components/php/unix_sock_sql/docker/Dockerfile_mysql new file mode 100644 index 000000000..841662dc6 --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/docker/Dockerfile_mysql @@ -0,0 +1,22 @@ +FROM mysql:8.0.34-debian + +SHELL ["/bin/bash", "-c"] + +RUN chmod 1777 /tmp +RUN usermod -u 1000 mysql +RUN groupmod -g 1000 mysql + +COPY test/integration/components/php/unix_sock_sql/docker/init_sql/ /docker-entrypoint-initdb.d/ +COPY test/integration/components/php/unix_sock_sql/config/mysql/custom.cnf /etc/mysql/conf.d/ + +RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +EXPOSE 3306 + +RUN chown -R mysql:mysql /var/lib/mysql + +RUN install -o mysql -g mysql -d /var/log/mysql && \ + install -o mysql -g mysql /dev/null /var/log/mysql/error.log && \ + install -o mysql -g mysql /dev/null /var/log/mysql/slow.log + +USER mysql diff --git a/test/integration/components/php/unix_sock_sql/docker/Dockerfile_nginx b/test/integration/components/php/unix_sock_sql/docker/Dockerfile_nginx new file mode 100644 index 000000000..f11691b5d --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/docker/Dockerfile_nginx @@ -0,0 +1,41 @@ +FROM nginx:latest + +SHELL ["/bin/bash", "-c"] + +RUN chmod 1777 /tmp +RUN apt-get update -y && apt-get install -y procps + +RUN groupadd -f www-data && \ + (id -u www-data &> /dev/null || useradd -G www-data www-data -D) + +RUN usermod -u 1000 www-data +RUN groupmod -g 1000 www-data +RUN usermod -aG adm www-data + +RUN mkdir /etc/nginx/sites-available && mkdir /etc/nginx/sites-enabled + +COPY test/integration/components/php/unix_sock_sql/config/nginx/nginx.conf /etc/nginx/nginx.conf +COPY test/integration/components/php/unix_sock_sql/config/nginx/sites-available /etc/nginx/sites-available +COPY --chown=www-data:www-data test/integration/components/php/unix_sock_sql/src/ /var/www/html/ + +RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/ + +EXPOSE 80/tcp + +RUN unlink /var/log/nginx/access.log +RUN unlink /var/log/nginx/error.log + +RUN chown -R www-data:www-data /var/log/nginx && \ + chown -R www-data:www-data /etc/nginx && \ + chown -R www-data:www-data /var/cache/nginx && \ + chown -R www-data:www-data /var/www && \ + install -o www-data -g www-data /dev/null /var/run/nginx.pid + +WORKDIR /var/www/html + +RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +USER www-data + +CMD ["/usr/sbin/nginx", "-g", "daemon off;"] + diff --git a/test/integration/components/php/unix_sock_sql/docker/Dockerfile_php b/test/integration/components/php/unix_sock_sql/docker/Dockerfile_php new file mode 100644 index 000000000..64893d7d8 --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/docker/Dockerfile_php @@ -0,0 +1,35 @@ +FROM php:8.2-fpm + +SHELL ["/bin/bash", "-c"] + +RUN chmod 1777 /tmp +RUN apt-get update -y && apt-get install -y procps + +RUN groupadd -f www-data && \ + (id -u www-data &> /dev/null || useradd -G www-data www-data -D) + +RUN usermod -u 1000 www-data +RUN groupmod -g 1000 www-data + +RUN docker-php-ext-install \ + pdo_mysql \ + sockets + +EXPOSE 9000 + +RUN install -d -m 0755 -o www-data -g www-data /run/php-fpm + +COPY --chown=www-data:www-data test/integration/components/php/unix_sock_sql/src/ /var/www/html/ +COPY test/integration/components/php/unix_sock_sql/config/php/ /usr/local/etc/ +COPY test/integration/components/php/unix_sock_sql/config/php/php/php.ini /usr/local/etc/php/ + +RUN install -d -m 0755 -o www-data -g www-data /var/lib/php/sessions + +RUN install -o www-data -g www-data -d /var/log/php && \ + install -o www-data -g www-data /dev/null /var/log/php/error.log && \ + install -o www-data -g www-data /dev/null /var/log/php/php-fpm.log && \ + chown -R www-data:www-data /var/www + +WORKDIR /var/www/html + +USER www-data \ No newline at end of file diff --git a/test/integration/components/php/unix_sock_sql/docker/init_sql/init.sql b/test/integration/components/php/unix_sock_sql/docker/init_sql/init.sql new file mode 100644 index 000000000..003b90bc8 --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/docker/init_sql/init.sql @@ -0,0 +1,13 @@ +CREATE DATABASE IF NOT EXISTS `testdb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; +GO +USE `testdb`; +GO +CREATE TABLE IF NOT EXISTS `accounts` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `address` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +GO +INSERT INTO `accounts` (name, address) VALUES ('My Company', '1234 Some Address, Some Town, Canada'), ('Other Company', '234 Some Street, Another Town, Spain'), ('Another Company', '456 Another Street, Large Town, Germany'); + diff --git a/test/integration/components/php/unix_sock_sql/src/index.php b/test/integration/components/php/unix_sock_sql/src/index.php new file mode 100644 index 000000000..262b48d0f --- /dev/null +++ b/test/integration/components/php/unix_sock_sql/src/index.php @@ -0,0 +1,32 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); +} catch(PDOException $e) { + echo "Error: " . $e->getMessage(); + die; +} + +$stmt = $conn->query("SELECT * FROM accounts")->fetchAll(); +print_r($stmt); + +?> + + +
+ +