LCOV - code coverage report
Current view: top level - app/fdctl - main.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 12 29 41.4 %
Date: 2025-09-17 04:38:03 Functions: 1 2 50.0 %

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

Generated by: LCOV version 1.14