Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/app/shared/commands/monitor/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "../../../platform/fd_cap_chk.h"
#include "../../../../disco/topo/fd_topo.h"
#include "../../../../disco/metrics/fd_metrics.h"
#include "../../../../util/log/fd_log.h"

#include "helper.h"

Expand All @@ -30,7 +31,6 @@ monitor_cmd_args( int * pargc,
args->monitor.dt_max = fd_env_strip_cmdline_long( pargc, pargv, "--dt-max", NULL, 133333333. );
args->monitor.duration = fd_env_strip_cmdline_long( pargc, pargv, "--duration", NULL, 0. );
args->monitor.seed = fd_env_strip_cmdline_uint( pargc, pargv, "--seed", NULL, (uint)fd_tickcount() );
args->monitor.ns_per_tic = 1./fd_tempo_tick_per_ns( NULL ); /* calibrate during init */

args->monitor.with_bench = fd_env_strip_cmdline_contains( pargc, pargv, "--bench" );
args->monitor.with_sankey = fd_env_strip_cmdline_contains( pargc, pargv, "--sankey" );
Expand Down Expand Up @@ -232,8 +232,7 @@ run_monitor( config_t const * config,
long dt_min,
long dt_max,
long duration,
uint seed,
double ns_per_tic ) {
uint seed ) {
fd_topo_t const * topo = &config->topo;

/* Setup local objects used by this app */
Expand All @@ -253,7 +252,7 @@ run_monitor( config_t const * config,
/* Get the initial reference diagnostic snapshot */
tile_snap( tile_snap_prv, topo );
link_snap( link_snap_prv, topo );
long then; long tic; fd_tempo_observe_pair( &then, &tic );
long then = fd_log_wallclock();

/* Monitor for duration ns. Note that for duration==0, this
will still do exactly one pretty print. */
Expand Down Expand Up @@ -290,7 +289,7 @@ run_monitor( config_t const * config,

tile_snap( tile_snap_cur, topo );
link_snap( link_snap_cur, topo );
long now; long toc; fd_tempo_observe_pair( &now, &toc );
long now = fd_log_wallclock();

/* Pretty print a comparison between this diagnostic snapshot and
the previous one. */
Expand Down Expand Up @@ -327,7 +326,7 @@ run_monitor( config_t const * config,
if( cur->status==2UL ) continue; /* stopped tile */
PRINT( " %7s", topo->tiles[ tile_idx ].name );
PRINT( " | %7lu", cur->pid );
PRINT( " | " ); printf_stale ( &buf, &buf_sz, (long)(0.5+ns_per_tic*(double)(toc - (long)cur->heartbeat)), 1e8 /* 100 millis */ );
PRINT( " | " ); printf_stale ( &buf, &buf_sz, (long)(now - (long)cur->heartbeat), 1e8 /* 100 millis */ );
PRINT( " | " ); printf_heart ( &buf, &buf_sz, (long)cur->heartbeat, (long)prv->heartbeat );
PRINT( " | " ); printf_err_cnt ( &buf, &buf_sz, cur->nivcsw, prv->nivcsw );
PRINT( " | " ); printf_err_cnt ( &buf, &buf_sz, cur->nvcsw, prv->nvcsw );
Expand Down Expand Up @@ -487,7 +486,7 @@ run_monitor( config_t const * config,
break;
}

then = now; tic = toc;
then = now;
tile_snap_t * tmp = tile_snap_prv; tile_snap_prv = tile_snap_cur; tile_snap_cur = tmp;
link_snap_t * tmp2 = link_snap_prv; link_snap_prv = link_snap_cur; link_snap_cur = tmp2;
}
Expand Down Expand Up @@ -575,8 +574,7 @@ monitor_cmd_fn( args_t * args,
args->monitor.dt_min,
args->monitor.dt_max,
args->monitor.duration,
args->monitor.seed,
args->monitor.ns_per_tic );
args->monitor.seed );

exit( 0 ); /* gracefully exit */
}
Expand Down
1 change: 0 additions & 1 deletion src/app/shared/fd_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ union fdctl_args {
long dt_max;
long duration;
uint seed;
double ns_per_tic;
int drain_output_fd;
int with_bench;
int with_sankey;
Expand Down
3 changes: 2 additions & 1 deletion src/disco/stem/fd_stem.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
#error "fd_stem requires alloca"
#endif

#include "../../util/log/fd_log.h"
#include "../topo/fd_topo.h"
#include "../metrics/fd_metrics.h"
#include "../../tango/fd_tango.h"
Expand Down Expand Up @@ -422,7 +423,7 @@ STEM_(run1)( ulong in_cnt,

/* Update metrics counters to external viewers */
FD_COMPILER_MFENCE();
FD_MGAUGE_SET( TILE, HEARTBEAT, (ulong)now );
FD_MGAUGE_SET( TILE, HEARTBEAT, (ulong)fd_log_wallclock() );
FD_MGAUGE_SET( TILE, IN_BACKPRESSURE, metric_in_backp );
FD_MCNT_INC ( TILE, BACKPRESSURE_COUNT, metric_backp_cnt );
FD_MCNT_ENUM_COPY( TILE, REGIME_DURATION_NANOS, metric_regime_ticks );
Expand Down