All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
To: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH] opensm/perfmgr/console: add 'pm sweep'
Date: Tue, 17 Jul 2012 11:50:41 -0700	[thread overview]
Message-ID: <20120717115041.5c196342cc2ce83cf1bbb8d7@llnl.gov> (raw)

NOTE: The following applies after previous Performance Manager patches posted to the list.

Signed-off-by: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
---
 opensm/osm_console.c |    8 +++++++-
 opensm/osm_perfmgr.c |    7 ++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/opensm/osm_console.c b/opensm/osm_console.c
index 789092f..261cea4 100644
--- a/opensm/osm_console.c
+++ b/opensm/osm_console.c
@@ -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);
 		}
diff --git a/opensm/osm_perfmgr.c b/opensm/osm_perfmgr.c
index 3b36ef6..4b9b2a0 100644
--- a/opensm/osm_perfmgr.c
+++ b/opensm/osm_perfmgr.c
@@ -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
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2012-07-17 18:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17 18:50 Ira Weiny [this message]
     [not found] ` <20120717115041.5c196342cc2ce83cf1bbb8d7-i2BcT+NCU+M@public.gmane.org>
2012-08-12  7:34   ` [PATCH] opensm/perfmgr/console: add 'pm sweep' Alex Netes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120717115041.5c196342cc2ce83cf1bbb8d7@llnl.gov \
    --to=weiny2-i2bct+ncu+m@public.gmane.org \
    --cc=alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.