[ofa-general] [PATCH 2/4] opensm/updn: dump used root nodes guid

Sasha Khapyorsky sashak at voltaire.com
Wed Mar 26 10:27:04 PDT 2008


This dump file has similar to root_node_guids format. Useful for
debugging and root nodes list generation.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/opensm/osm_ucast_updn.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/opensm/opensm/osm_ucast_updn.c b/opensm/opensm/osm_ucast_updn.c
index 0dc9f1f..93e6c7c 100644
--- a/opensm/opensm/osm_ucast_updn.c
+++ b/opensm/opensm/osm_ucast_updn.c
@@ -544,6 +544,14 @@ static void delete_updn_node(struct updn_node *u)
 
 /**********************************************************************
  **********************************************************************/
+static void dump_roots(cl_map_item_t *item, FILE *file, void *cxt)
+{
+	osm_switch_t *sw = (osm_switch_t *)item;
+	if (!((struct updn_node *)sw->priv)->rank)
+		fprintf(file, "0x%" PRIx64 "\n",
+			cl_ntoh64(osm_node_get_node_guid(sw->p_node)));
+}
+
 /* UPDN callback function */
 static int __osm_updn_call(void *ctx)
 {
@@ -590,6 +598,11 @@ static int __osm_updn_call(void *ctx)
 		ret = 1;
 	}
 
+	if (osm_log_is_active(&p_updn->p_osm->log, OSM_LOG_ROUTING))
+		osm_dump_qmap_to_file(p_updn->p_osm, "opensm-updn-roots.dump",
+				      &p_updn->p_osm->subn.sw_guid_tbl,
+				      dump_roots, NULL);
+
 	p_item = cl_qmap_head(&p_updn->p_osm->subn.sw_guid_tbl);
 	while (p_item != cl_qmap_end(&p_updn->p_osm->subn.sw_guid_tbl)) {
 		p_sw = (osm_switch_t *) p_item;
-- 
1.5.4.1.122.gaa8d




More information about the general mailing list