diff mbox

[08/10] opensm/console: add abreviations for perfmgr commands

Message ID 20120703165352.40a34471.weiny2@llnl.gov (mailing list archive)
State Rejected
Delegated to: Alex Netes
Headers show

Commit Message

Ira Weiny July 3, 2012, 11:53 p.m. UTC
Add:
   "pm" for "perfmgr"
   "pc" for "print_counters"

Signed-off-by: Ira Weiny <weiny2@llnl.gov>
---
 opensm/osm_console.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/opensm/osm_console.c b/opensm/osm_console.c
index af32b51..cd41286 100644
--- a/opensm/osm_console.c
+++ b/opensm/osm_console.c
@@ -239,7 +239,10 @@  static void help_update_desc(FILE *out, int detail)
 static void help_perfmgr(FILE * out, int detail)
 {
 	fprintf(out,
-		"perfmgr [enable|disable|clear_counters|dump_counters|print_counters|dump_redir|clear_redir|set_rm_nodes|clear_rm_nodes|clear_inactive|sweep_time[seconds]]\n");
+		"perfmgr(pm) [enable|disable\n"
+		"             |clear_counters|dump_counters|print_counters(pc)\n"
+		"             |set_rm_nodes|clear_rm_nodes|clear_inactive\n"
+		"             |dump_redir|clear_redir|sweep_time[seconds]]\n");
 	if (detail) {
 		fprintf(out,
 			"perfmgr -- print the performance manager state\n");
@@ -262,6 +265,8 @@  static void help_perfmgr(FILE * out, int detail)
 		fprintf(out,
 			"   [pe [<nodename|nodeguid>]] -- same as print_errors\n");
 		fprintf(out,
+			"   [pc [<nodename|nodeguid>]] -- same as print_counters\n");
+		fprintf(out,
 			"   [dump_redir [<nodename|nodeguid>]] -- dump the redirection table\n");
 		fprintf(out,
 			"   [clear_redir [<nodename|nodeguid>]] -- clear the redirection table\n");
@@ -272,6 +277,11 @@  static void help_perfmgr(FILE * out, int detail)
 			"   [clear_inactive] -- Delete inactive nodes from the DB\n");
 	}
 }
+static void help_pm(FILE *out, int detail)
+{
+	if (detail)
+		help_perfmgr(out, detail);
+}
 #endif				/* ENABLE_OSM_PERF_MGR */
 
 /* more help routines go here */
@@ -1472,7 +1482,8 @@  static void perfmgr_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
 		} else if (strcmp(p_cmd, "clear_inactive") == 0) {
 			unsigned cnt = osm_perfmgr_delete_inactive(&p_osm->perfmgr);
 			fprintf(out, "Removed %u nodes from Database\n", cnt);
-		} else if (strcmp(p_cmd, "print_counters") == 0) {
+		} else if (strcmp(p_cmd, "print_counters") == 0 ||
+			   strcmp(p_cmd, "pc") == 0) {
 			char *port = NULL;
 			p_cmd = name_token(p_last);
 			if (p_cmd) {
@@ -1670,6 +1681,7 @@  static const struct command console_cmds[] = {
 	{"version", &help_version, &version_parse},
 #ifdef ENABLE_OSM_PERF_MGR
 	{"perfmgr", &help_perfmgr, &perfmgr_parse},
+	{"pm", &help_pm, &perfmgr_parse},
 #endif				/* ENABLE_OSM_PERF_MGR */
 	{"dump_portguid", &help_dump_portguid, &dump_portguid_parse},
 	{NULL, NULL, NULL}	/* end of array */