@@ -242,13 +242,16 @@ static void help_perfmgr(FILE * out, int detail)
"perfmgr(pm) [enable|disable\n"
" |clear_counters|dump_counters|print_counters(pc)|print_errors(pe)\n"
" |set_rm_nodes|clear_rm_nodes|clear_inactive\n"
- " |dump_redir|clear_redir|sweep_time[seconds]]\n");
+ " |dump_redir|clear_redir\n"
+ " |sweep|sweep_time[seconds]]\n");
if (detail) {
fprintf(out,
"perfmgr -- print the performance manager state\n");
fprintf(out,
" [enable|disable] -- change the perfmgr state\n");
fprintf(out,
+ " [sweep] -- Initiate a sweep of the fabric\n");
+ fprintf(out,
" [sweep_time] -- change the perfmgr sweep time (requires [seconds] option)\n");
fprintf(out,
" [clear_counters] -- clear the counters stored\n");
@@ -1523,6 +1526,9 @@ static void perfmgr_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
"sweep_time requires a time period "
"(in seconds) to be specified\n");
}
+ } else if (strcmp(p_cmd, "sweep") == 0) {
+ osm_sm_signal(&p_osm->sm, OSM_SIGNAL_PERFMGR_SWEEP);
+ fprintf(out, "sweep initiated...\n");
} else {
fprintf(out, "\"%s\" option not found\n", p_cmd);
}
@@ -802,6 +802,12 @@ void osm_perfmgr_process(osm_perfmgr_t * pm)
if (pm->state != PERFMGR_STATE_ENABLED)
return;
+ if (pm->sweep_state == PERFMGR_SWEEP_ACTIVE ||
+ pm->sweep_state == PERFMGR_SWEEP_SUSPENDED)
+ return;
+
+ pm->sweep_state = PERFMGR_SWEEP_ACTIVE;
+
if (pm->subn->sm_state == IB_SMINFO_STATE_STANDBY ||
pm->subn->sm_state == IB_SMINFO_STATE_NOTACTIVE)
perfmgr_discovery(pm->subn->p_osm);
@@ -827,7 +833,6 @@ void osm_perfmgr_process(osm_perfmgr_t * pm)
#if ENABLE_OSM_PERF_MGR_PROFILE
gettimeofday(&before, NULL);
#endif
- pm->sweep_state = PERFMGR_SWEEP_ACTIVE;
/* With the global lock held, collect the node guids */
/* FIXME we should be able to track SA notices
* and not have to sweep the node_guid_tbl each pass
NOTE: The following applies after previous Performance Manager patches posted to the list. Signed-off-by: Ira Weiny <weiny2@llnl.gov> --- opensm/osm_console.c | 8 +++++++- opensm/osm_perfmgr.c | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-)