LCOV - code coverage report
Current view: top level - app/firedancer/commands - shred_version.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 20 0.0 %
Date: 2025-09-19 04:41:14 Functions: 0 1 0.0 %

          Line data    Source code
       1             : #include "../../shared/fd_config.h"
       2             : #include "../../shared/fd_action.h"
       3             : 
       4             : #include "../../../disco/topo/fd_topo.h"
       5             : #include "../../../discof/ipecho/fd_ipecho_client.h"
       6             : 
       7             : #include <stdlib.h>
       8             : #include <unistd.h>
       9             : 
      10             : void
      11             : shred_version_cmd_fn( args_t *   args,
      12           0 :                       config_t * config ) {
      13           0 :   (void)args;
      14             : 
      15           0 :   void * _client = aligned_alloc( FD_IPECHO_CLIENT_ALIGN, fd_ipecho_client_footprint() );
      16           0 :   FD_TEST( _client );
      17           0 :   fd_ipecho_client_t * client = fd_ipecho_client_join( fd_ipecho_client_new( _client ) );
      18           0 :   FD_TEST( client );
      19             : 
      20           0 :   ulong tile_idx = fd_topo_find_tile( &config->topo, "gossip", 0UL );
      21           0 :   FD_TEST( tile_idx!=ULONG_MAX );
      22             : 
      23           0 :   fd_topo_tile_t * tile = &config->topo.tiles[ tile_idx ];
      24           0 :   fd_ipecho_client_init( client, tile->gossip.entrypoints, tile->gossip.entrypoints_cnt );
      25             : 
      26           0 :   for(;;) {
      27           0 :     ushort shred_version = 0;
      28           0 :     int _charge_busy;
      29           0 :     int err = fd_ipecho_client_poll( client, &shred_version, &_charge_busy );
      30           0 :     if( FD_UNLIKELY( -1==err ) ) FD_LOG_ERR(( "couldn't get shred version" ));
      31           0 :     if( FD_UNLIKELY( !err) ) {
      32             :       FD_LOG_STDOUT(( "%hu\n", shred_version ));
      33           0 :       break;
      34           0 :     }
      35           0 :   }
      36           0 : }
      37             : 
      38             : action_t fd_action_shred_version = {
      39             :   .name        = "shred-version",
      40             :   .fn          = shred_version_cmd_fn,
      41             :   .description = "Retrieve the current shred version from the entrypoints",
      42             : };

Generated by: LCOV version 1.14