LCOV - code coverage report
Current view: top level - disco/diag - fd_diag_tile.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 39 0.0 %
Date: 2026-10-23 17:13:25 Functions: 0 12 0.0 %

          Line data    Source code
       1             : #ifndef HEADER_fd_src_disco_diag_fd_diag_tile_h
       2             : #define HEADER_fd_src_disco_diag_fd_diag_tile_h
       3             : 
       4             : #include "../fd_disco_base.h"
       5             : #include "../topo/fd_cpu_topo.h"
       6             : 
       7           0 : #define FD_DIAG_BUNDLE_STATUS_DISCONNECTED (0UL) /* All bundle tiles disconnected */
       8           0 : #define FD_DIAG_BUNDLE_STATUS_CONNECTING   (1UL) /* At least one bundle tile connecting, none connected or sleeping */
       9           0 : #define FD_DIAG_BUNDLE_STATUS_CONNECTED    (2UL) /* At least one bundle tile connected */
      10           0 : #define FD_DIAG_BUNDLE_STATUS_SLEEPING     (3UL) /* At least one bundle tile sleeping, none connected */
      11           0 : #define FD_DIAG_BUNDLE_STATUS_DISABLED     (4UL) /* No bundle tiles configured */
      12             : 
      13           0 : #define FD_DIAG_VOTE_STATUS_DISABLED     (0UL) /* Non-voting or no tower tile */
      14           0 : #define FD_DIAG_VOTE_STATUS_NOT_STARTED  (1UL) /* Tower tile not running or no votes cast yet */
      15           0 : #define FD_DIAG_VOTE_STATUS_DELINQUENT   (2UL) /* Vote distance exceeds threshold or vote stalled */
      16           0 : #define FD_DIAG_VOTE_STATUS_VOTING       (3UL) /* Voting normally */
      17           0 : #define FD_DIAG_VOTE_STATUS_INADMISSIBLE (4UL) /* Voting, but vote account fails the admission ticket filter */
      18             : 
      19           0 : #define FD_DIAG_REPLAY_STATUS_DISABLED    (0UL) /* No replay tile */
      20           0 : #define FD_DIAG_REPLAY_STATUS_NOT_STARTED (1UL) /* Replay tile not running or slots are zero */
      21           0 : #define FD_DIAG_REPLAY_STATUS_BEHIND      (2UL) /* Replay lagging behind turbine or reset slot stalled */
      22           0 : #define FD_DIAG_REPLAY_STATUS_RUNNING     (3UL) /* Replay keeping up */
      23             : 
      24           0 : #define FD_DIAG_TURBINE_STATUS_DISABLED         (0UL) /* No shred or replay tiles */
      25           0 : #define FD_DIAG_TURBINE_STATUS_NOT_STARTED      (1UL) /* Tiles not all running or turbine slot is zero */
      26           0 : #define FD_DIAG_TURBINE_STATUS_STALLED          (2UL) /* Turbine slot not advancing */
      27           0 : #define FD_DIAG_TURBINE_STATUS_REPAIR_OUTPACING (3UL) /* Repair byte throughput exceeds turbine */
      28           0 : #define FD_DIAG_TURBINE_STATUS_RUNNING          (4UL) /* Turbine receiving normally */
      29             : 
      30           0 : #define FD_DIAG_BUILDER_STATUS_DISABLED     (0UL)
      31           0 : #define FD_DIAG_BUILDER_STATUS_DISCONNECTED (1UL)
      32           0 : #define FD_DIAG_BUILDER_STATUS_CONNECTING   (2UL)
      33           0 : #define FD_DIAG_BUILDER_STATUS_UNHEALTHY    (3UL)
      34           0 : #define FD_DIAG_BUILDER_STATUS_CONNECTED    (4UL)
      35             : 
      36           0 : #define FD_DIAG_SYSTEM_CPU_MAX      (1024UL)
      37           0 : #define FD_DIAG_SYSTEM_NUMA_MAX     (64UL)
      38           0 : #define FD_DIAG_SYSTEM_TILE_MAX     (256UL)
      39             : #define FD_DIAG_SYSTEM_TILE_MEM_MAX (FD_DIAG_SYSTEM_TILE_MAX*FD_DIAG_SYSTEM_NUMA_MAX)
      40             : 
      41           0 : #define FD_DIAG_SYSTEM_FILE_CATEGORY_ACCOUNTS  (0U)
      42           0 : #define FD_DIAG_SYSTEM_FILE_CATEGORY_SHREDS    (1U)
      43           0 : #define FD_DIAG_SYSTEM_FILE_CATEGORY_SNAPSHOTS (2U)
      44           0 : #define FD_DIAG_SYSTEM_FILE_CATEGORY_GUI       (3U)
      45           0 : #define FD_DIAG_SYSTEM_FILE_CATEGORY_LOGS      (4U)
      46             : #define FD_DIAG_SYSTEM_FILE_MAX                 (5UL)
      47             : 
      48             : struct fd_diag_system_cpu {
      49             :   ushort cpu_idx;
      50             :   ushort numa_idx;
      51             :   ushort sibling_idx; /* USHORT_MAX when unavailable/offline */
      52             :   ushort die_idx;
      53             :   uchar  online;
      54             : };
      55             : typedef struct fd_diag_system_cpu fd_diag_system_cpu_t;
      56             : 
      57             : static inline void
      58             : fd_diag_system_cpu_init( fd_diag_system_cpu_t * cpu,
      59           0 :                          fd_topo_cpu_t const *  topo_cpu ) {
      60           0 :   cpu->cpu_idx     = (ushort)topo_cpu->idx;
      61           0 :   cpu->numa_idx    = (ushort)topo_cpu->numa_node;
      62           0 :   cpu->sibling_idx = topo_cpu->sibling==ULONG_MAX ? USHORT_MAX : (ushort)topo_cpu->sibling;
      63           0 :   cpu->die_idx     = topo_cpu->die_idx==ULONG_MAX ? USHORT_MAX : (ushort)topo_cpu->die_idx;
      64           0 :   cpu->online      = (uchar)topo_cpu->online;
      65           0 : }
      66             : 
      67             : struct fd_diag_system_numa_mem {
      68             :   ushort numa_idx;
      69             :   ulong  total_bytes;
      70             :   ulong  free_bytes;
      71             :   ulong  shared_bytes; /* Configured workspace bytes without a unique tile owner */
      72             : };
      73             : typedef struct fd_diag_system_numa_mem fd_diag_system_numa_mem_t;
      74             : 
      75             : struct fd_diag_system_tile_mem {
      76             :   ushort tile_idx;
      77             :   ushort numa_idx;
      78             :   ulong  allocated_bytes; /* Configured workspace and stack bytes */
      79             : };
      80             : typedef struct fd_diag_system_tile_mem fd_diag_system_tile_mem_t;
      81             : 
      82             : struct fd_diag_system_mount {
      83             :   char  path[ PATH_MAX ];
      84             :   ulong total_bytes;
      85             :   ulong free_bytes;
      86             :   ulong available_bytes;
      87             : };
      88             : typedef struct fd_diag_system_mount fd_diag_system_mount_t;
      89             : 
      90             : struct fd_diag_system_file {
      91             :   char  path[ PATH_MAX ];
      92             :   uint  category;
      93             :   uint  mount_idx;
      94             :   ulong bytes;
      95             : };
      96             : typedef struct fd_diag_system_file fd_diag_system_file_t;
      97             : 
      98             : struct fd_diag_system_resources {
      99             :   ulong                     sample_time_nanos;
     100             :   uint                      cpu_cnt;
     101             :   ulong                     mem_available_bytes;
     102             :   ulong                     mem_free_bytes;
     103             :   uint                      numa_mem_cnt;
     104             :   uint                      tile_mem_cnt;
     105             :   uint                      mount_cnt;
     106             :   uint                      file_cnt;
     107             :   fd_diag_system_cpu_t      cpu     [ FD_DIAG_SYSTEM_CPU_MAX      ];
     108             :   fd_diag_system_numa_mem_t numa_mem[ FD_DIAG_SYSTEM_NUMA_MAX     ];
     109             :   fd_diag_system_tile_mem_t tile_mem[ FD_DIAG_SYSTEM_TILE_MEM_MAX ];
     110             :   fd_diag_system_mount_t    mount   [ FD_DIAG_SYSTEM_FILE_MAX     ];
     111             :   fd_diag_system_file_t     file    [ FD_DIAG_SYSTEM_FILE_MAX     ];
     112             : };
     113             : typedef struct fd_diag_system_resources fd_diag_system_resources_t;
     114             : 
     115             : #endif /* HEADER_fd_src_disco_diag_fd_diag_tile_h */

Generated by: LCOV version 1.14