3
3
4
4
#include "../../../shared/fd_config.h"
5
5
#include "../../../shared/fd_action.h"
6
+ #include "../../../../disco/net/fd_net_tile.h"
6
7
#include "../../../../disco/quic/fd_quic_tile.h"
7
8
#include "../../../../waltz/quic/fd_quic_private.h"
8
9
@@ -24,15 +25,12 @@ typedef struct peer_conn_id_map peer_conn_id_map_t;
24
25
#define MAP_LG_SLOT_CNT PEER_MAP_LG_SLOT_CNT
25
26
#include "../../../../util/tmpl/fd_map.c"
26
27
27
- /* fd_quic_trace_ctx is the relocated fd_quic_ctx_t of the target quic
28
- tile. fd_quic_trace_ctx_remote is the original fd_quic_ctx_t, but
29
- the pointer itself is in the local address space. */
30
-
31
- extern fd_quic_ctx_t fd_quic_trace_ctx ;
32
- extern fd_quic_ctx_t const * fd_quic_trace_ctx_remote ;
33
- extern ulong fd_quic_trace_ctx_raddr ;
34
- extern ulong volatile * fd_quic_trace_link_metrics ;
35
- extern void const * fd_quic_trace_log_base ;
28
+ /* fd_quic_trace_ctx_remote is the original fd_quic_ctx_t, but the
29
+ pointer itself is in the local address space. */
30
+ extern void const * fd_quic_trace_tile_ctx_remote ; /* local ptr to remote ctx */
31
+ extern ulong fd_quic_trace_tile_ctx_raddr ; /* remote addr of remote ctx */
32
+ extern ulong volatile * fd_quic_trace_link_metrics ;
33
+ extern void const * fd_quic_trace_log_base ;
36
34
extern peer_conn_id_map_t _fd_quic_trace_peer_map [1UL <<PEER_MAP_LG_SLOT_CNT ];
37
35
extern peer_conn_id_map_t * fd_quic_trace_peer_map ;
38
36
@@ -45,8 +43,12 @@ struct fd_quic_trace_ctx {
45
43
int dump ; /* whether the user requested --dump */
46
44
int dump_config ; /* whether the user requested --dump-config */
47
45
int dump_conns ; /* whether the user requested --dump-conns */
48
- int net_out ; /* whether to include tx (net-out) packets */
46
+ int trace_send ; /* whether the user requested tracing send tile (1) or quic tile (0) */
49
47
ulong net_out_base ; /* base address of net-out chunks in local addr space */
48
+
49
+ fd_quic_t * quic ; /* local join to remote quic */
50
+ fd_net_rx_bounds_t net_in_bounds [1 ]; /* bounds of net-in chunks in local addr space */
51
+ uchar buffer [ FD_NET_MTU ];
50
52
};
51
53
52
54
typedef struct fd_quic_trace_ctx fd_quic_trace_ctx_t ;
@@ -61,29 +63,41 @@ struct fd_quic_trace_frame_ctx {
61
63
62
64
typedef struct fd_quic_trace_frame_ctx fd_quic_trace_frame_ctx_t ;
63
65
66
+ #define translate_ptr ( ptr ) __extension__({ \
67
+ ulong rel = (ulong)(ptr) - fd_quic_trace_tile_ctx_raddr; \
68
+ ulong laddr = (ulong)fd_quic_trace_tile_ctx_remote + rel; \
69
+ (__typeof__(ptr))(laddr); \
70
+ })
71
+
72
+ #define tile_member ( ctx_ptr , field , is_send ) \
73
+ *fd_ptr_if( is_send, &(((fd_send_tile_ctx_t*)(ctx_ptr))->field), &(((fd_quic_ctx_t*)(ctx_ptr))->field))
74
+
75
+
64
76
FD_PROTOTYPES_BEGIN
65
77
66
78
void
67
79
fd_quic_trace_frames ( fd_quic_trace_frame_ctx_t * context ,
68
- uchar const * data ,
69
- ulong data_sz );
80
+ uchar const * data ,
81
+ ulong data_sz );
70
82
71
83
void
72
- fd_quic_trace_rx_tile ( fd_quic_trace_ctx_t * trace_ctx ,
84
+ fd_quic_trace_rx_tile ( fd_quic_trace_ctx_t * trace_ctx ,
73
85
fd_frag_meta_t const * rx_mcache ,
74
86
fd_frag_meta_t const * tx_mcache );
75
87
76
88
void
77
- fd_quic_trace_log_tile ( fd_frag_meta_t const * in_mcache );
89
+ fd_quic_trace_log_tile ( fd_quic_trace_ctx_t * ctx ,
90
+ fd_frag_meta_t const * in_mcache );
78
91
79
- FD_PROTOTYPES_END
92
+ static inline fd_quic_conn_t const *
93
+ fd_quic_trace_conn_at_idx ( fd_quic_t const * quic , ulong idx ) {
94
+ fd_quic_state_t const * state = fd_quic_get_state_const ( quic );
95
+ ulong const local_conn_base = translate_ptr ( state -> conn_base );
96
+ return (fd_quic_conn_t * )( local_conn_base + idx * state -> conn_sz );
97
+ }
80
98
99
+ FD_PROTOTYPES_END
81
100
82
- #define translate_ptr ( ptr ) __extension__({ \
83
- ulong rel = (ulong)(ptr) - fd_quic_trace_ctx_raddr; \
84
- ulong laddr = (ulong)fd_quic_trace_ctx_remote + rel; \
85
- (__typeof__(ptr))(laddr); \
86
- })
87
101
88
102
extern action_t fd_action_quic_trace ;
89
103
0 commit comments