LCOV - code coverage report
Current view: top level - app/fddev/quic_trace - fd_quic_trace_log_tile.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 42 0.0 %
Date: 2025-01-08 12:08:44 Functions: 0 4 0.0 %

          Line data    Source code
       1             : #include "fd_quic_trace.h"
       2             : #include "../../../waltz/quic/log/fd_quic_log_user.h"
       3             : #include <stdio.h>
       4             : 
       5             : static int
       6             : before_frag( void * _ctx   FD_FN_UNUSED,
       7             :              ulong  in_idx FD_FN_UNUSED,
       8             :              ulong  seq    FD_FN_UNUSED,
       9           0 :              ulong  sig ) {
      10           0 :   return !( fd_quic_log_sig_event( sig )==FD_QUIC_EVENT_CONN_QUIC_CLOSE );
      11           0 : }
      12             : 
      13             : static void
      14             : during_frag( void * _ctx   FD_PARAM_UNUSED,
      15             :              ulong  in_idx FD_PARAM_UNUSED,
      16             :              ulong  seq    FD_PARAM_UNUSED,
      17             :              ulong  sig    FD_PARAM_UNUSED,
      18             :              ulong  chunk,
      19           0 :              ulong  sz ) {
      20           0 :   fd_quic_ctx_t * ctx = &fd_quic_trace_ctx;
      21           0 :   fd_memcpy( ctx->buffer, fd_chunk_to_laddr_const( fd_quic_trace_log_base, chunk ), sz );
      22           0 : }
      23             : 
      24             : static void
      25             : after_frag( void *              _ctx   FD_FN_UNUSED,
      26             :             ulong               in_idx FD_FN_UNUSED,
      27             :             ulong               seq    FD_FN_UNUSED,
      28             :             ulong               sig    FD_FN_UNUSED,
      29             :             ulong               sz     FD_FN_UNUSED,
      30             :             ulong               tsorig FD_FN_UNUSED,
      31           0 :             fd_stem_context_t * stem   FD_FN_UNUSED ) {
      32           0 :   fd_quic_ctx_t * ctx = &fd_quic_trace_ctx;
      33           0 :   fd_quic_log_error_t const * error = fd_type_pun_const( ctx->buffer );
      34           0 :   printf( "event=conn_close_quic conn_id=%016lx src_ip=%08x enc=%d pktnum=%8lu close_code=0x%lx loc=%.*s(%u)\n",
      35           0 :           error->hdr.conn_id,
      36           0 :           fd_uint_bswap( FD_LOAD( uint, error->hdr.ip4_saddr ) ),
      37           0 :           error->hdr.enc_level,
      38           0 :           error->hdr.pkt_num,
      39           0 :           error->code[0],
      40           0 :           (int)sizeof(error->src_file),
      41           0 :           error->src_file,
      42           0 :           error->src_line );
      43           0 : }
      44             : 
      45             : 
      46             : #define STEM_BURST (1UL)
      47             : #define STEM_CALLBACK_CONTEXT_TYPE  void
      48             : #define STEM_CALLBACK_CONTEXT_ALIGN 1
      49           0 : #define STEM_CALLBACK_BEFORE_FRAG   before_frag
      50           0 : #define STEM_CALLBACK_DURING_FRAG   during_frag
      51           0 : #define STEM_CALLBACK_AFTER_FRAG    after_frag
      52             : #include "../../../disco/stem/fd_stem.c"
      53             : 
      54             : void
      55           0 : fd_quic_trace_log_tile( fd_frag_meta_t const * in_mcache ) {
      56           0 :   fd_frag_meta_t const * in_mcache_tbl[1] = { in_mcache };
      57             : 
      58           0 :   uchar   fseq_mem[ FD_FSEQ_FOOTPRINT ] __attribute__((aligned(FD_FSEQ_ALIGN)));
      59           0 :   ulong * fseq = fd_fseq_join( fd_fseq_new( fseq_mem, 0UL ) );
      60           0 :   ulong * fseq_tbl[1] = { fseq };
      61             : 
      62           0 :   fd_rng_t rng[1];
      63           0 :   FD_TEST( fd_rng_join( fd_rng_new( rng, (uint)fd_tickcount(), 0UL ) ) );
      64             : 
      65           0 :   uchar scratch[ sizeof(fd_stem_tile_in_t)+128 ] __attribute__((aligned(FD_STEM_SCRATCH_ALIGN)));
      66             : 
      67           0 :   stem_run1( /* in_cnt     */ 1UL,
      68           0 :              /* in_mcache  */ in_mcache_tbl,
      69           0 :              /* in_fseq    */ fseq_tbl,
      70           0 :              /* out_cnt    */ 0UL,
      71             :              /* out_mcache */ NULL,
      72           0 :              /* cons_cnt   */ 0UL,
      73             :              /* cons_out   */ NULL,
      74             :              /* cons_fseq  */ NULL,
      75           0 :              /* stem_burst */ 1UL,
      76           0 :              /* stem_lazy  */ 0L,
      77           0 :              /* rng        */ rng,
      78           0 :              /* scratch    */ scratch,
      79             :              /* ctx        */ NULL );
      80             : 
      81           0 :   fd_fseq_delete( fd_fseq_leave( fseq ) );
      82           0 : }

Generated by: LCOV version 1.14