LCOV - code coverage report
Current view: top level - app/firedancer - main.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 14 31 45.2 %
Date: 2025-10-13 04:42:14 Functions: 1 2 50.0 %

          Line data    Source code
       1             : #include "topology.h"
       2             : #include "config.h"
       3             : #include "../shared/boot/fd_boot.h"
       4             : #include "../shared/commands/configure/configure.h"
       5             : 
       6             : char const * FD_APP_NAME    = "Firedancer";
       7             : char const * FD_BINARY_NAME = "firedancer";
       8             : 
       9             : extern fd_topo_obj_callbacks_t fd_obj_cb_mcache;
      10             : extern fd_topo_obj_callbacks_t fd_obj_cb_dcache;
      11             : extern fd_topo_obj_callbacks_t fd_obj_cb_fseq;
      12             : extern fd_topo_obj_callbacks_t fd_obj_cb_metrics;
      13             : extern fd_topo_obj_callbacks_t fd_obj_cb_opaque;
      14             : extern fd_topo_obj_callbacks_t fd_obj_cb_dbl_buf;
      15             : extern fd_topo_obj_callbacks_t fd_obj_cb_neigh4_hmap;
      16             : extern fd_topo_obj_callbacks_t fd_obj_cb_fib4;
      17             : extern fd_topo_obj_callbacks_t fd_obj_cb_keyswitch;
      18             : extern fd_topo_obj_callbacks_t fd_obj_cb_tile;
      19             : extern fd_topo_obj_callbacks_t fd_obj_cb_store;
      20             : extern fd_topo_obj_callbacks_t fd_obj_cb_fec_sets;
      21             : extern fd_topo_obj_callbacks_t fd_obj_cb_txncache;
      22             : extern fd_topo_obj_callbacks_t fd_obj_cb_exec_spad;
      23             : extern fd_topo_obj_callbacks_t fd_obj_cb_banks;
      24             : extern fd_topo_obj_callbacks_t fd_obj_cb_funk;
      25             : extern fd_topo_obj_callbacks_t fd_obj_cb_bank_hash_cmp;
      26             : 
      27             : fd_topo_obj_callbacks_t * CALLBACKS[] = {
      28             :   &fd_obj_cb_mcache,
      29             :   &fd_obj_cb_dcache,
      30             :   &fd_obj_cb_fseq,
      31             :   &fd_obj_cb_metrics,
      32             :   &fd_obj_cb_opaque,
      33             :   &fd_obj_cb_dbl_buf,
      34             :   &fd_obj_cb_neigh4_hmap,
      35             :   &fd_obj_cb_fib4,
      36             :   &fd_obj_cb_keyswitch,
      37             :   &fd_obj_cb_tile,
      38             :   &fd_obj_cb_store,
      39             :   &fd_obj_cb_fec_sets,
      40             :   &fd_obj_cb_txncache,
      41             :   &fd_obj_cb_exec_spad,
      42             :   &fd_obj_cb_banks,
      43             :   &fd_obj_cb_funk,
      44             :   &fd_obj_cb_bank_hash_cmp,
      45             :   NULL,
      46             : };
      47             : 
      48             : configure_stage_t * STAGES[] = {
      49             :   &fd_cfg_stage_hugetlbfs,
      50             :   &fd_cfg_stage_sysctl,
      51             :   &fd_cfg_stage_ethtool_channels,
      52             :   &fd_cfg_stage_ethtool_offloads,
      53             :   &fd_cfg_stage_ethtool_loopback,
      54             :   &fd_cfg_stage_snapshots,
      55             :   NULL,
      56             : };
      57             : 
      58             : 
      59             : extern fd_topo_run_tile_t fd_tile_net;
      60             : extern fd_topo_run_tile_t fd_tile_netlnk;
      61             : extern fd_topo_run_tile_t fd_tile_sock;
      62             : extern fd_topo_run_tile_t fd_tile_quic;
      63             : extern fd_topo_run_tile_t fd_tile_verify;
      64             : extern fd_topo_run_tile_t fd_tile_dedup;
      65             : extern fd_topo_run_tile_t fd_tile_resolv;
      66             : extern fd_topo_run_tile_t fd_tile_pack;
      67             : extern fd_topo_run_tile_t fd_tile_bank;
      68             : extern fd_topo_run_tile_t fd_tile_shred;
      69             : extern fd_topo_run_tile_t fd_tile_sign;
      70             : extern fd_topo_run_tile_t fd_tile_metric;
      71             : extern fd_topo_run_tile_t fd_tile_cswtch;
      72             : extern fd_topo_run_tile_t fd_tile_gui;
      73             : extern fd_topo_run_tile_t fd_tile_plugin;
      74             : extern fd_topo_run_tile_t fd_tile_bundle;
      75             : 
      76             : extern fd_topo_run_tile_t fd_tile_gossvf;
      77             : extern fd_topo_run_tile_t fd_tile_gossip;
      78             : extern fd_topo_run_tile_t fd_tile_repair;
      79             : extern fd_topo_run_tile_t fd_tile_replay;
      80             : extern fd_topo_run_tile_t fd_tile_execor;
      81             : extern fd_topo_run_tile_t fd_tile_poh;
      82             : extern fd_topo_run_tile_t fd_tile_send;
      83             : extern fd_topo_run_tile_t fd_tile_tower;
      84             : extern fd_topo_run_tile_t fd_tile_rpcserv;
      85             : extern fd_topo_run_tile_t fd_tile_genesi;
      86             : extern fd_topo_run_tile_t fd_tile_ipecho;
      87             : 
      88             : fd_topo_run_tile_t * TILES[] = {
      89             :   &fd_tile_net,
      90             :   &fd_tile_netlnk,
      91             :   &fd_tile_sock,
      92             :   &fd_tile_quic,
      93             :   &fd_tile_verify,
      94             :   &fd_tile_dedup,
      95             :   &fd_tile_resolv,
      96             :   &fd_tile_pack,
      97             :   &fd_tile_bank,
      98             :   &fd_tile_shred,
      99             :   &fd_tile_sign,
     100             :   &fd_tile_metric,
     101             :   &fd_tile_cswtch,
     102             :   &fd_tile_gui,
     103             :   &fd_tile_plugin,
     104             :   &fd_tile_bundle,
     105             :   &fd_tile_gossvf,
     106             :   &fd_tile_gossip,
     107             :   &fd_tile_repair,
     108             :   &fd_tile_replay,
     109             :   &fd_tile_execor,
     110             :   &fd_tile_poh,
     111             :   &fd_tile_send,
     112             :   &fd_tile_tower,
     113             :   &fd_tile_rpcserv,
     114             :   &fd_tile_genesi,
     115             :   &fd_tile_ipecho,
     116             :   NULL,
     117             : };
     118             : 
     119             : extern action_t fd_action_run;
     120             : extern action_t fd_action_run1;
     121             : extern action_t fd_action_configure;
     122             : extern action_t fd_action_monitor;
     123             : extern action_t fd_action_keys;
     124             : extern action_t fd_action_ready;
     125             : extern action_t fd_action_mem;
     126             : extern action_t fd_action_netconf;
     127             : extern action_t fd_action_set_identity;
     128             : extern action_t fd_action_help;
     129             : extern action_t fd_action_metrics;
     130             : extern action_t fd_action_version;
     131             : extern action_t fd_action_shred_version;
     132             : 
     133             : action_t * ACTIONS[] = {
     134             :   &fd_action_run,
     135             :   &fd_action_run1,
     136             :   &fd_action_configure,
     137             :   &fd_action_monitor,
     138             :   &fd_action_keys,
     139             :   &fd_action_ready,
     140             :   &fd_action_mem,
     141             :   &fd_action_netconf,
     142             :   &fd_action_set_identity,
     143             :   &fd_action_help,
     144             :   &fd_action_metrics,
     145             :   &fd_action_version,
     146             :   &fd_action_shred_version,
     147             :   NULL,
     148             : };
     149             : 
     150             : int
     151             : main( int     argc,
     152          12 :       char ** argv ) {
     153          12 :   fd_config_file_t _default = fd_config_file_default();
     154          12 :   fd_config_file_t testnet = fd_config_file_testnet();
     155          12 :   fd_config_file_t devnet = fd_config_file_devnet();
     156          12 :   fd_config_file_t mainnet = fd_config_file_mainnet();
     157             : 
     158          12 :   fd_config_file_t * configs[] = {
     159          12 :     &_default,
     160          12 :     &testnet,
     161          12 :     &devnet,
     162          12 :     &mainnet,
     163          12 :     NULL
     164          12 :   };
     165             : 
     166          12 :   return fd_main( argc, argv, 1, configs, fd_topo_initialize );
     167          12 : }
     168             : 
     169             : /* Kind of a hack for now, we sometimes want to view bench generation
     170             :    in the monitor binary, but it's not part of the production binary. */
     171             : 
     172             : void
     173             : add_bench_topo( fd_topo_t  * topo,
     174             :                 char const * affinity,
     175             :                 ulong        benchg_tile_cnt,
     176             :                 ulong        benchs_tile_cnt,
     177             :                 ulong        accounts_cnt,
     178             :                 int          transaction_mode,
     179             :                 float        contending_fraction,
     180             :                 float        cu_price_spread,
     181             :                 ulong        conn_cnt,
     182             :                 ushort       send_to_port,
     183             :                 uint         send_to_ip_addr,
     184             :                 ushort       rpc_port,
     185             :                 uint         rpc_ip_addr,
     186             :                 int          no_quic,
     187           0 :                 int          reserve_agave_cores ) {
     188           0 :   (void)topo;
     189           0 :   (void)affinity;
     190           0 :   (void)benchg_tile_cnt;
     191           0 :   (void)benchs_tile_cnt;
     192           0 :   (void)accounts_cnt;
     193           0 :   (void)transaction_mode;
     194           0 :   (void)contending_fraction;
     195           0 :   (void)cu_price_spread;
     196           0 :   (void)conn_cnt;
     197           0 :   (void)send_to_port;
     198           0 :   (void)send_to_ip_addr;
     199           0 :   (void)rpc_port;
     200           0 :   (void)rpc_ip_addr;
     201           0 :   (void)no_quic;
     202           0 :   (void)reserve_agave_cores;
     203           0 : }

Generated by: LCOV version 1.14