diff mbox

[2/3,opensm] perfmgr: Add xmit_wait to event plugin error counters data structure

Message ID 5364815F.6040605@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Hal Rosenstock May 3, 2014, 5:40 a.m. UTC
From: Ira Weiny <ira.weiny@intel.com>
Date: Fri, 4 Apr 2014 20:07:04 -0400

NOTE: This changes the plugin interface.  However, OpenSM plugins must be
compiled for the specific version of OpenSM used.  So this should not be an
issue.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 include/opensm/osm_event_plugin.h   |    1 +
 opensm/osm_perfmgr_db.c             |    5 ++---
 osmeventplugin/src/osmeventplugin.c |    4 +++-
 3 files changed, 6 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/include/opensm/osm_event_plugin.h b/include/opensm/osm_event_plugin.h
index ca5a719..db5ebca 100644
--- a/include/opensm/osm_event_plugin.h
+++ b/include/opensm/osm_event_plugin.h
@@ -126,6 +126,7 @@  typedef struct osm_epi_pe_event {
 	uint64_t link_integrity;
 	uint64_t buffer_overrun;
 	uint64_t vl15_dropped;
+	uint64_t xmit_wait;
 	time_t time_diff_s;
 } osm_epi_pe_event_t;
 
diff --git a/opensm/osm_perfmgr_db.c b/opensm/osm_perfmgr_db.c
index 5b476bd..1b78942 100644
--- a/opensm/osm_perfmgr_db.c
+++ b/opensm/osm_perfmgr_db.c
@@ -359,7 +359,6 @@  perfmgr_db_add_err_reading(perfmgr_db_t * db, uint64_t guid, uint8_t port,
 	perfmgr_db_err_reading_t *previous = NULL;
 	perfmgr_db_err_t rc = PERFMGR_EVENT_DB_SUCCESS;
 	osm_epi_pe_event_t epi_pe_data;
-	uint64_t xmit_wait_diff;
 
 	cl_plock_excl_acquire(&db->lock);
 	node = get(db, guid);
@@ -415,9 +414,9 @@  perfmgr_db_add_err_reading(perfmgr_db_t * db, uint64_t guid, uint8_t port,
 	epi_pe_data.vl15_dropped =
 	    (reading->vl15_dropped - previous->vl15_dropped);
 	p_port->err_total.vl15_dropped += epi_pe_data.vl15_dropped;
-	xmit_wait_diff =
+	epi_pe_data.xmit_wait =
 	    (reading->xmit_wait - previous->xmit_wait);
-	p_port->err_total.xmit_wait += xmit_wait_diff;
+	p_port->err_total.xmit_wait += epi_pe_data.xmit_wait;
 
 	p_port->err_previous = *reading;
 
diff --git a/osmeventplugin/src/osmeventplugin.c b/osmeventplugin/src/osmeventplugin.c
index 0f3f9fb..23986db 100644
--- a/osmeventplugin/src/osmeventplugin.c
+++ b/osmeventplugin/src/osmeventplugin.c
@@ -105,7 +105,9 @@  static void handle_port_counter(_log_events_t * log, osm_epi_pe_event_t * pc)
 	    || pc->xmit_constraint_err > 0
 	    || pc->rcv_constraint_err > 0
 	    || pc->link_integrity > 0
-	    || pc->buffer_overrun > 0 || pc->vl15_dropped > 0) {
+	    || pc->buffer_overrun > 0
+	    || pc->vl15_dropped > 0
+	    || pc->xmit_wait > 0) {
 		fprintf(log->log_file,
 			"Port counter errors for node 0x%" PRIx64
 			" (%s) port %d\n", pc->port_id.node_guid,