[openib-general] [PATCH] [MINOR] OpenSM/osm_helper: Add support for SMInfoRecord dumping

Hal Rosenstock halr at voltaire.com
Thu Jul 6 04:15:49 PDT 2006


OpenSM/osm_helper: Add support for SMInfoRecord dumping

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: include/opensm/osm_helper.h
===================================================================
--- include/opensm/osm_helper.h	(revision 8419)
+++ include/opensm/osm_helper.h	(working copy)
@@ -271,6 +271,12 @@ osm_dump_inform_info_record(
 	IN const osm_log_level_t log_level );
 
 void
+osm_dump_sm_info_record(
+	IN osm_log_t* const p_log,
+	IN const ib_sminfo_record_t* const p_smir,
+	IN const osm_log_level_t log_level );
+
+void
 osm_dump_pkey_block( 
 	IN osm_log_t* const p_log,
 	IN uint64_t port_guid, 
Index: opensm/osm_helper.c
===================================================================
--- opensm/osm_helper.c	(revision 8419)
+++ opensm/osm_helper.c	(working copy)
@@ -1549,6 +1549,39 @@ osm_dump_sm_info(
 /**********************************************************************
  **********************************************************************/
 void
+osm_dump_sm_info_record(
+  IN osm_log_t* const p_log,
+  IN const ib_sminfo_record_t* const p_smir,
+  IN const osm_log_level_t log_level )
+{
+  if( osm_log_is_active( p_log, log_level ) )
+  {
+    osm_log( p_log, OSM_LOG_DEBUG,
+             "SMInfo Record dump:\n"
+             "\t\t\t\tRID\n"
+             "\t\t\t\tLid.....................0x%X\n"
+             "\t\t\t\tReserved................0x%X\n"
+             "\t\t\t\tSMInfo dump:\n"
+             "\t\t\t\tguid....................0x%016" PRIx64 "\n"
+             "\t\t\t\tsm_key..................0x%016" PRIx64 "\n"
+             "\t\t\t\tact_count...............%u\n"
+             "\t\t\t\tpriority................%u\n"
+             "\t\t\t\tsm_state................%u\n"
+             "",
+             cl_ntoh16( p_smir->lid ),
+             cl_ntoh16( p_smir->resv0 ),
+             cl_ntoh64( p_smir->sm_info.guid ),
+             cl_ntoh64( p_smir->sm_info.sm_key ),
+             cl_ntoh32( p_smir->sm_info.act_count ),
+             ib_sminfo_get_priority( &p_smir->sm_info ),
+             ib_sminfo_get_state( &p_smir->sm_info )
+             );
+  }
+}
+
+/**********************************************************************
+ **********************************************************************/
+void
 osm_dump_notice(
   IN osm_log_t* const p_log,
   IN const ib_mad_notice_attr_t *p_ntci,
Index: opensm/libopensm.map
===================================================================
--- opensm/libopensm.map	(revision 8419)
+++ opensm/libopensm.map	(working copy)
@@ -32,6 +32,7 @@ OPENSM_1.0 {
 		osm_dump_slvl_map_table;
 		osm_dump_vl_arb_table;
 		osm_dump_sm_info;
+		osm_dump_sm_info_record;
 		osm_dump_notice;
 		osm_dump_dr_smp;
 		osm_dump_sa_mad;







More information about the general mailing list