From: Hal Rosenstock Subject: [PATCH 4/3] opensm: Dump info functions update for per module logging Date: Mon, 18 Jun 2012 06:13:32 -0400 Message-ID: <4FDEFF4C.2040205@dev.mellanox.co.il> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Alex Netes Cc: "linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)" , Ilya Nelkenbaum List-Id: linux-rdma@vger.kernel.org All information dump function calls were updated to _v2 and those additional _v2 functions added to osm_helper.c. Log messages are generated by separate functions as well. Signed-off-by: Ilya Nelkenbaum Reviewed-by : Hal Rosenstock --- include/opensm/osm_helper.h | 116 ++++ opensm/libopensm.map | 26 + opensm/osm_guid_info_rcv.c | 4 +- opensm/osm_helper.c | 1252 ++++++++++++++++++++++++++++------- opensm/osm_inform.c | 20 +- opensm/osm_mlnx_ext_port_info_rcv.c | 4 +- opensm/osm_node_info_rcv.c | 30 +- opensm/osm_pkey_rcv.c | 4 +- opensm/osm_port_info_rcv.c | 8 +- opensm/osm_sa.c | 4 +- opensm/osm_sa_class_port_info.c | 2 +- opensm/osm_sa_guidinfo_record.c | 4 +- opensm/osm_sa_informinfo.c | 8 +- opensm/osm_sa_link_record.c | 2 +- opensm/osm_sa_mad_ctrl.c | 8 +- opensm/osm_sa_mcmember_record.c | 6 +- opensm/osm_sa_multipath_record.c | 2 +- opensm/osm_sa_node_record.c | 6 +- opensm/osm_sa_path_record.c | 2 +- opensm/osm_sa_portinfo_record.c | 8 +- opensm/osm_sa_service_record.c | 12 +- opensm/osm_sa_sminfo_record.c | 2 +- opensm/osm_sa_sw_info_record.c | 8 +- opensm/osm_slvl_map_rcv.c | 8 +- opensm/osm_sm_mad_ctrl.c | 20 +- opensm/osm_sminfo_rcv.c | 4 +- opensm/osm_state_mgr.c | 6 +- opensm/osm_sw_info_rcv.c | 4 +- opensm/osm_trap_rcv.c | 2 +- opensm/osm_vl15intf.c | 6 +- opensm/osm_vl_arb_rcv.c | 4 +- 31 files changed, 1265 insertions(+), 327 deletions(-) diff --git a/include/opensm/osm_helper.h b/include/opensm/osm_helper.h index 85718c7..bc4bad3 100644 --- a/include/opensm/osm_helper.h +++ b/include/opensm/osm_helper.h @@ -213,6 +213,13 @@ void osm_dump_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, IN ib_net64_t port_guid, IN uint8_t port_num, IN const ib_port_info_t * p_pi, IN osm_log_level_t log_level); + +void osm_dump_port_info_v2(IN osm_log_t * p_log, IN ib_net64_t node_guid, + IN ib_net64_t port_guid, IN uint8_t port_num, + IN const ib_port_info_t * p_pi, + IN const int file_id, + IN osm_log_level_t log_level); + /* * PARAMETERS * p_log @@ -254,6 +261,12 @@ void osm_dump_guid_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, IN ib_net64_t port_guid, IN uint8_t block_num, IN const ib_guid_info_t * p_gi, IN osm_log_level_t log_level); + +void osm_dump_guid_info_v2(IN osm_log_t * p_log, IN ib_net64_t node_guid, + IN ib_net64_t port_guid, IN uint8_t block_num, + IN const ib_guid_info_t * p_gi, + IN const int file_id, + IN osm_log_level_t log_level); /* * PARAMETERS * p_log @@ -287,67 +300,138 @@ void osm_dump_mlnx_ext_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, IN const ib_mlnx_ext_port_info_t * p_pi, IN osm_log_level_t log_level); +void osm_dump_mlnx_ext_port_info_v2(IN osm_log_t * p_log, IN ib_net64_t node_guid, + IN ib_net64_t port_guid, IN uint8_t port_num, + IN const ib_mlnx_ext_port_info_t * p_pi, + IN const int file_id, + IN osm_log_level_t log_level); + void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr, IN osm_log_level_t log_level); +void osm_dump_path_record_v2(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_multipath_record(IN osm_log_t * p_log, IN const ib_multipath_rec_t * p_mpr, IN osm_log_level_t log_level); +void osm_dump_multipath_record_v2(IN osm_log_t * p_log, + IN const ib_multipath_rec_t * p_mpr, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_node_record(IN osm_log_t * p_log, IN const ib_node_record_t * p_nr, IN osm_log_level_t log_level); +void osm_dump_node_record_v2(IN osm_log_t * p_log, + IN const ib_node_record_t * p_nr, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr, IN osm_log_level_t log_level); +void osm_dump_mc_record_v2(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_link_record(IN osm_log_t * p_log, IN const ib_link_record_t * p_lr, IN osm_log_level_t log_level); +void osm_dump_link_record_v2(IN osm_log_t * p_log, + IN const ib_link_record_t * p_lr, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_service_record(IN osm_log_t * p_log, IN const ib_service_record_t * p_sr, IN osm_log_level_t log_level); +void osm_dump_service_record_v2(IN osm_log_t * p_log, + IN const ib_service_record_t * p_sr, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_portinfo_record(IN osm_log_t * p_log, IN const ib_portinfo_record_t * p_pir, IN osm_log_level_t log_level); +void osm_dump_portinfo_record_v2(IN osm_log_t * p_log, + IN const ib_portinfo_record_t * p_pir, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_guidinfo_record(IN osm_log_t * p_log, IN const ib_guidinfo_record_t * p_gir, IN osm_log_level_t log_level); +void osm_dump_guidinfo_record_v2(IN osm_log_t * p_log, + IN const ib_guidinfo_record_t * p_gir, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_inform_info(IN osm_log_t * p_log, IN const ib_inform_info_t * p_ii, IN osm_log_level_t log_level); +void osm_dump_inform_info_v2(IN osm_log_t * p_log, + IN const ib_inform_info_t * p_ii, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_inform_info_record(IN osm_log_t * p_log, IN const ib_inform_info_record_t * p_iir, IN osm_log_level_t log_level); +void osm_dump_inform_info_record_v2(IN osm_log_t * p_log, + IN const ib_inform_info_record_t * p_iir, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_switch_info_record(IN osm_log_t * p_log, IN const ib_switch_info_record_t * p_sir, IN osm_log_level_t log_level); +void osm_dump_switch_info_record_v2(IN osm_log_t * p_log, + IN const ib_switch_info_record_t * p_sir, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_sm_info_record(IN osm_log_t * p_log, IN const ib_sminfo_record_t * p_smir, IN osm_log_level_t log_level); +void osm_dump_sm_info_record_v2(IN osm_log_t * p_log, + IN const ib_sminfo_record_t * p_smir, + IN const int file_id, IN osm_log_level_t log_level); + void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid, IN uint16_t block_num, IN uint8_t port_num, IN const ib_pkey_table_t * p_pkey_tbl, IN osm_log_level_t log_level); +void osm_dump_pkey_block_v2(IN osm_log_t * p_log, IN uint64_t port_guid, + IN uint16_t block_num, IN uint8_t port_num, + IN const ib_pkey_table_t * p_pkey_tbl, + IN const int file_id, + IN osm_log_level_t log_level); + void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid, IN uint8_t in_port_num, IN uint8_t out_port_num, IN const ib_slvl_table_t * p_slvl_tbl, IN osm_log_level_t log_level); +void osm_dump_slvl_map_table_v2(IN osm_log_t * p_log, IN uint64_t port_guid, + IN uint8_t in_port_num, IN uint8_t out_port_num, + IN const ib_slvl_table_t * p_slvl_tbl, + IN const int file_id, + IN osm_log_level_t log_level); + + void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid, IN uint8_t block_num, IN uint8_t port_num, IN const ib_vl_arb_table_t * p_vla_tbl, IN osm_log_level_t log_level); +void osm_dump_vl_arb_table_v2(IN osm_log_t * p_log, IN uint64_t port_guid, + IN uint8_t block_num, IN uint8_t port_num, + IN const ib_vl_arb_table_t * p_vla_tbl, + IN const int file_id, + IN osm_log_level_t log_level); + /****f* OpenSM: Helper/osm_dump_port_info * NAME * osm_dump_port_info @@ -360,6 +444,11 @@ void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid, void osm_dump_node_info(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni, IN osm_log_level_t log_level); + +void osm_dump_node_info_v2(IN osm_log_t * p_log, + IN const ib_node_info_t * p_ni, + IN const int file_id, + IN osm_log_level_t log_level); /* * PARAMETERS * p_log @@ -390,6 +479,10 @@ void osm_dump_node_info(IN osm_log_t * p_log, */ void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi, IN osm_log_level_t log_level); + +void osm_dump_sm_info_v2(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi, + IN const int file_id, IN osm_log_level_t log_level); + /* * PARAMETERS * p_log @@ -421,6 +514,11 @@ void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi, void osm_dump_switch_info(IN osm_log_t * p_log, IN const ib_switch_info_t * p_si, IN osm_log_level_t log_level); + +void osm_dump_switch_info_v2(IN osm_log_t * p_log, + IN const ib_switch_info_t * p_si, + IN const int file_id, + IN osm_log_level_t log_level); /* * PARAMETERS * p_log @@ -452,6 +550,11 @@ void osm_dump_switch_info(IN osm_log_t * p_log, void osm_dump_notice(IN osm_log_t * p_log, IN const ib_mad_notice_attr_t * p_ntci, IN osm_log_level_t log_level); + +void osm_dump_notice_v2(IN osm_log_t * p_log, + IN const ib_mad_notice_attr_t * p_ntci, + IN const int file_id, + IN osm_log_level_t log_level); /* * PARAMETERS * p_log @@ -497,15 +600,28 @@ const char *osm_get_disp_msg_str(IN cl_disp_msgid_t msg); void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path, IN osm_log_level_t level); +void osm_dump_dr_path_v2(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path, + IN const int file_id, IN osm_log_level_t level); + + void osm_dump_smp_dr_path(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, IN osm_log_level_t level); +void osm_dump_smp_dr_path_v2(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, + IN const int file_id, IN osm_log_level_t level); + void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, IN osm_log_level_t level); +void osm_dump_dr_smp_v2(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, + IN const int file_id, IN osm_log_level_t level); + void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_smp, IN osm_log_level_t level); +void osm_dump_sa_mad_v2(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_smp, + IN const int file_id, IN osm_log_level_t level); + /****f* IBA Base: Types/osm_get_sm_signal_str * NAME * osm_get_sm_signal_str diff --git a/opensm/libopensm.map b/opensm/libopensm.map index 2885b43..f7eae57 100644 --- a/opensm/libopensm.map +++ b/opensm/libopensm.map @@ -20,31 +20,56 @@ OPENSM_1.5 { ib_get_trap_str; ib_zero_gid; osm_dump_port_info; + osm_dump_port_info_v2; osm_dump_portinfo_record; + osm_dump_portinfo_record_v2; osm_dump_guid_info; + osm_dump_guid_info_v2; osm_dump_guidinfo_record; + osm_dump_guidinfo_record_v2; osm_dump_node_info; + osm_dump_node_info_v2; osm_dump_node_record; + osm_dump_node_record_v2; osm_dump_path_record; + osm_dump_path_record_v2; osm_dump_multipath_record; + osm_dump_multipath_record_v2; osm_dump_mc_record; + osm_dump_mc_record_v2; osm_dump_service_record; + osm_dump_service_record_v2; osm_dump_inform_info; + osm_dump_inform_info_v2; osm_dump_inform_info_record; + osm_dump_inform_info_record_v2; osm_dump_link_record; + osm_dump_link_record_v2; osm_dump_switch_info; + osm_dump_switch_info_v2; osm_dump_switch_info_record; + osm_dump_switch_info_record_v2; osm_dump_pkey_table; osm_dump_slvl_map_table; + osm_dump_slvl_map_table_v2; osm_dump_vl_arb_table; + osm_dump_vl_arb_table_v2; osm_dump_sm_info; + osm_dump_sm_info_v2; osm_dump_sm_info_record; + osm_dump_sm_info_record_v2; osm_dump_notice; + osm_dump_notice_v2; osm_dump_dr_smp; + osm_dump_dr_smp_v2; osm_dump_sa_mad; + osm_dump_sa_mad_v2; osm_dump_dr_path; + osm_dump_dr_path_v2; osm_dump_smp_dr_path; + osm_dump_smp_dr_path_v2; osm_dump_pkey_block; + osm_dump_pkey_block_v2; osm_log_raw; osm_get_sm_state_str; osm_get_sm_signal_str; @@ -63,6 +88,7 @@ OPENSM_1.5 { ib_path_rate_get_prev; ib_path_rate_get_next; osm_dump_mlnx_ext_port_info; + osm_dump_mlnx_ext_port_info_v2; osm_log_v2; osm_log_msg_box_v2; osm_log_is_active_v2; diff --git a/opensm/osm_guid_info_rcv.c b/opensm/osm_guid_info_rcv.c index a50f5f4..141bcb1 100644 --- a/opensm/osm_guid_info_rcv.c +++ b/opensm/osm_guid_info_rcv.c @@ -90,8 +90,8 @@ void osm_gi_rcv_process(IN void *context, IN void *data) port_guid = p_context->port_guid; node_guid = p_context->node_guid; - osm_dump_guid_info(sm->p_log, node_guid, port_guid, block_num, p_gi, - OSM_LOG_DEBUG); + osm_dump_guid_info_v2(sm->p_log, node_guid, port_guid, block_num, p_gi, + FILE_ID, OSM_LOG_DEBUG); CL_PLOCK_EXCL_ACQUIRE(sm->p_lock); p_port = osm_get_port_by_guid(sm->p_subn, port_guid); diff --git a/opensm/osm_helper.c b/opensm/osm_helper.c index 1ff2426..fb07cff 100644 --- a/opensm/osm_helper.c +++ b/opensm/osm_helper.c @@ -790,15 +790,16 @@ static void dbg_get_capabilities_str(IN char *p_buf, IN uint32_t buf_size, } } -void osm_dump_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, - IN ib_net64_t port_guid, IN uint8_t port_num, - IN const ib_port_info_t * p_pi, - IN osm_log_level_t log_level) +static void osm_dump_port_info_to_buf(IN ib_net64_t node_guid, + IN ib_net64_t port_guid, + IN uint8_t port_num, + IN const ib_port_info_t * p_pi, + OUT char * buf) { - if (osm_log_is_active(p_log, log_level)) { - char buf[BUF_SIZE]; - - osm_log(p_log, log_level, + if (!buf || !p_pi) + return; + else { + sprintf(buf, "PortInfo dump:\n" "\t\t\t\tport number..............%u\n" "\t\t\t\tnode_guid................0x%016" PRIx64 "\n" @@ -873,6 +874,21 @@ void osm_dump_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, ib_port_info_get_link_speed_ext_active(p_pi), ib_port_info_get_link_speed_ext_sup(p_pi), p_pi->link_speed_ext_enabled); + } +} + +void osm_dump_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, + IN ib_net64_t port_guid, IN uint8_t port_num, + IN const ib_port_info_t * p_pi, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_port_info_to_buf(node_guid, port_guid, + port_num, p_pi, buf); + + osm_log(p_log, log_level, buf); /* show the capabilities mask */ if (p_pi->capability_mask) { @@ -883,36 +899,90 @@ void osm_dump_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, } } +void osm_dump_port_info_v2(IN osm_log_t * p_log, IN ib_net64_t node_guid, + IN ib_net64_t port_guid, IN uint8_t port_num, + IN const ib_port_info_t * p_pi, IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_port_info_to_buf(node_guid, port_guid, + port_num, p_pi, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + + /* show the capabilities mask */ + if (p_pi->capability_mask) { + dbg_get_capabilities_str(buf, BUF_SIZE, "\t\t\t\t", + p_pi); + osm_log_v2(p_log, log_level, file_id, "%s", buf); + } + } +} + +static void osm_dump_mlnx_ext_port_info_to_buf(IN ib_net64_t node_guid, + IN ib_net64_t port_guid, IN uint8_t port_num, + IN const ib_mlnx_ext_port_info_t * p_pi, + OUT char * buf) +{ + if (!buf || !p_pi) + return; + else { + sprintf(buf, + "MLNX ExtendedPortInfo dump:\n" + "\t\t\t\tport number..............%u\n" + "\t\t\t\tnode_guid................0x%016" PRIx64 "\n" + "\t\t\t\tport_guid................0x%016" PRIx64 "\n" + "\t\t\t\tStateChangeEnable........0x%X\n" + "\t\t\t\tLinkSpeedSupported.......0x%X\n" + "\t\t\t\tLinkSpeedEnabled.........0x%X\n" + "\t\t\t\tLinkSpeedActive..........0x%X\n", + port_num, cl_ntoh64(node_guid), cl_ntoh64(port_guid), + p_pi->state_change_enable, p_pi->link_speed_supported, + p_pi->link_speed_enabled, p_pi->link_speed_active); + } +} + void osm_dump_mlnx_ext_port_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, IN ib_net64_t port_guid, IN uint8_t port_num, IN const ib_mlnx_ext_port_info_t * p_pi, IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { - osm_log(p_log, log_level, - "MLNX ExtendedPortInfo dump:\n" - "\t\t\t\tport number..............%u\n" - "\t\t\t\tnode_guid................0x%016" PRIx64 "\n" - "\t\t\t\tport_guid................0x%016" PRIx64 "\n" - "\t\t\t\tStateChangeEnable........0x%X\n" - "\t\t\t\tLinkSpeedSupported.......0x%X\n" - "\t\t\t\tLinkSpeedEnabled.........0x%X\n" - "\t\t\t\tLinkSpeedActive..........0x%X\n", - port_num, cl_ntoh64(node_guid), cl_ntoh64(port_guid), - p_pi->state_change_enable, p_pi->link_speed_supported, - p_pi->link_speed_enabled, p_pi->link_speed_active); + char buf[BUF_SIZE]; + + osm_dump_mlnx_ext_port_info_to_buf(node_guid, port_guid, + port_num, p_pi, buf); + + osm_log(p_log, log_level, buf); } } -void osm_dump_portinfo_record(IN osm_log_t * p_log, - IN const ib_portinfo_record_t * p_pir, - IN osm_log_level_t log_level) +void osm_dump_mlnx_ext_port_info_v2(IN osm_log_t * p_log, IN ib_net64_t node_guid, + IN ib_net64_t port_guid, IN uint8_t port_num, + IN const ib_mlnx_ext_port_info_t * p_pi, + IN const int file_id, IN osm_log_level_t log_level) { - if (osm_log_is_active(p_log, log_level)) { - char buf[BUF_SIZE]; + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_mlnx_ext_port_info_to_buf(node_guid, port_guid, + port_num, p_pi, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_portinfo_record_to_buf(IN const ib_portinfo_record_t * p_pir, + OUT char * buf) +{ + if (!buf || !p_pir) + return; + else { const ib_port_info_t *p_pi = &p_pir->port_info; - osm_log(p_log, log_level, + sprintf(buf, "PortInfo Record dump:\n" "\t\t\t\tRID\n" "\t\t\t\tEndPortLid...............%u\n" @@ -989,6 +1059,20 @@ void osm_dump_portinfo_record(IN osm_log_t * p_log, ib_port_info_get_link_speed_ext_active(p_pi), ib_port_info_get_link_speed_ext_sup(p_pi), p_pi->link_speed_ext_enabled); + } +} + +void osm_dump_portinfo_record(IN osm_log_t * p_log, + IN const ib_portinfo_record_t * p_pir, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + const ib_port_info_t *p_pi = &p_pir->port_info; + + osm_dump_portinfo_record_to_buf(p_pir, buf); + + osm_log(p_log, log_level, buf); /* show the capabilities mask */ if (p_pi->capability_mask) { @@ -999,13 +1083,38 @@ void osm_dump_portinfo_record(IN osm_log_t * p_log, } } -void osm_dump_guid_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, - IN ib_net64_t port_guid, IN uint8_t block_num, - IN const ib_guid_info_t * p_gi, - IN osm_log_level_t log_level) +void osm_dump_portinfo_record_v2(IN osm_log_t * p_log, + IN const ib_portinfo_record_t * p_pir, + IN const int file_id, + IN osm_log_level_t log_level) { - if (osm_log_is_active(p_log, log_level)) { - osm_log(p_log, log_level, + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + const ib_port_info_t *p_pi = &p_pir->port_info; + + osm_dump_portinfo_record_to_buf(p_pir, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + + /* show the capabilities mask */ + if (p_pi->capability_mask) { + dbg_get_capabilities_str(buf, BUF_SIZE, "\t\t\t\t", + p_pi); + osm_log_v2(p_log, log_level, file_id, "%s", buf); + } + } +} + +static void osm_dump_guid_info_to_buf(IN ib_net64_t node_guid, + IN ib_net64_t port_guid, + IN uint8_t block_num, + IN const ib_guid_info_t * p_gi, + OUT char * buf) +{ + if (!buf || !p_gi) + return; + else { + sprintf(buf, "GUIDInfo dump:\n" "\t\t\t\tblock number............%u\n" "\t\t\t\tnode_guid...............0x%016" PRIx64 "\n" @@ -1026,14 +1135,46 @@ void osm_dump_guid_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, } } -void osm_dump_guidinfo_record(IN osm_log_t * p_log, - IN const ib_guidinfo_record_t * p_gir, - IN osm_log_level_t log_level) +void osm_dump_guid_info(IN osm_log_t * p_log, IN ib_net64_t node_guid, + IN ib_net64_t port_guid, IN uint8_t block_num, + IN const ib_guid_info_t * p_gi, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_guid_info_to_buf(node_guid, port_guid, + block_num, p_gi, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_guid_info_v2(IN osm_log_t * p_log, IN ib_net64_t node_guid, + IN ib_net64_t port_guid, IN uint8_t block_num, + IN const ib_guid_info_t * p_gi, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_guid_info_to_buf(node_guid, port_guid, + block_num, p_gi, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_guidinfo_record_to_buf(IN const ib_guidinfo_record_t * p_gir, + OUT char * buf) +{ + if (!buf || !p_gir) + return; + else { const ib_guid_info_t *p_gi = &p_gir->guid_info; - osm_log(p_log, log_level, + sprintf(buf, "GUIDInfo Record dump:\n" "\t\t\t\tRID\n" "\t\t\t\tLid.....................%u\n" @@ -1057,12 +1198,40 @@ void osm_dump_guidinfo_record(IN osm_log_t * p_log, cl_ntoh64(p_gi->guid[6]), cl_ntoh64(p_gi->guid[7])); } } - -void osm_dump_node_info(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni, - IN osm_log_level_t log_level) +void osm_dump_guidinfo_record(IN osm_log_t * p_log, + IN const ib_guidinfo_record_t * p_gir, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { - osm_log(p_log, log_level, + char buf[BUF_SIZE]; + + osm_dump_guidinfo_record_to_buf(p_gir, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_guidinfo_record_v2(IN osm_log_t * p_log, + IN const ib_guidinfo_record_t * p_gir, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_guidinfo_record_to_buf(p_gir, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_node_info_to_buf(IN const ib_node_info_t * p_ni, + OUT char * buf) +{ + if (!buf || !p_ni) + return; + else { + sprintf(buf, "NodeInfo dump:\n" "\t\t\t\tbase_version............0x%X\n" "\t\t\t\tclass_version...........0x%X\n" @@ -1087,18 +1256,43 @@ void osm_dump_node_info(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni, } } -void osm_dump_node_record(IN osm_log_t * p_log, - IN const ib_node_record_t * p_nr, - IN osm_log_level_t log_level) +void osm_dump_node_info(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_node_info_to_buf(p_ni, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_node_info_v2(IN osm_log_t * p_log, IN const ib_node_info_t * p_ni, + IN const int file_id, IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_node_info_to_buf(p_ni, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_node_record_to_buf(IN const ib_node_record_t * p_nr, + OUT char * buf) +{ + if (!buf || !p_nr) + return; + else { char desc[sizeof(p_nr->node_desc.description) + 1]; const ib_node_info_t *p_ni = &p_nr->node_info; memcpy(desc, p_nr->node_desc.description, sizeof(p_nr->node_desc.description)); desc[sizeof(desc) - 1] = '\0'; - osm_log(p_log, log_level, + sprintf(buf, "Node Record dump:\n" "\t\t\t\tRID\n" "\t\t\t\tLid.....................%u\n" @@ -1130,13 +1324,43 @@ void osm_dump_node_record(IN osm_log_t * p_log, } } -void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr, +void osm_dump_node_record(IN osm_log_t * p_log, + IN const ib_node_record_t * p_nr, IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_node_record_to_buf(p_nr, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_node_record_v2(IN osm_log_t * p_log, + IN const ib_node_record_t * p_nr, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_node_record_to_buf(p_nr, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_path_record_to_buf(IN const ib_path_rec_t * p_pr, + OUT char * buf) +{ + if (!buf || !p_pr) + return; + else { char gid_str[INET6_ADDRSTRLEN]; char gid_str2[INET6_ADDRSTRLEN]; - osm_log(p_log, log_level, + + sprintf(buf, "PathRecord dump:\n" "\t\t\t\tservice_id..............0x%016" PRIx64 "\n" "\t\t\t\tdgid....................%s\n" @@ -1169,11 +1393,36 @@ void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr, } } -void osm_dump_multipath_record(IN osm_log_t * p_log, - IN const ib_multipath_rec_t * p_mpr, - IN osm_log_level_t log_level) +void osm_dump_path_record(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_path_record_to_buf(p_pr, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_path_record_v2(IN osm_log_t * p_log, IN const ib_path_rec_t * p_pr, + IN const int file_id, IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_path_record_to_buf(p_pr, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_multipath_record_to_buf(IN const ib_multipath_rec_t * p_mpr, + OUT char * buf) +{ + if (!buf || !p_mpr) + return; + else { char gid_str[INET6_ADDRSTRLEN]; char buf_line[1024]; ib_gid_t const *p_gid = p_mpr->gids; @@ -1201,7 +1450,7 @@ void osm_dump_multipath_record(IN osm_log_t * p_log, p_gid++; } } - osm_log(p_log, log_level, + sprintf(buf, "MultiPath Record dump:\n" "\t\t\t\thop_flow_raw............0x%X\n" "\t\t\t\ttclass..................0x%X\n" @@ -1228,13 +1477,43 @@ void osm_dump_multipath_record(IN osm_log_t * p_log, } } -void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr, - IN osm_log_level_t log_level) +void osm_dump_multipath_record(IN osm_log_t * p_log, + IN const ib_multipath_rec_t * p_mpr, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_multipath_record_to_buf(p_mpr, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_multipath_record_v2(IN osm_log_t * p_log, + IN const ib_multipath_rec_t * p_mpr, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_multipath_record_to_buf(p_mpr, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_mc_record_to_buf(IN const ib_member_rec_t * p_mcmr, + OUT char * buf) +{ + if(!buf || !p_mcmr) + return; + else { char gid_str[INET6_ADDRSTRLEN]; char gid_str2[INET6_ADDRSTRLEN]; - osm_log(p_log, log_level, + + sprintf(buf, "MCMember Record dump:\n" "\t\t\t\tMGID....................%s\n" "\t\t\t\tPortGid.................%s\n" @@ -1260,11 +1539,36 @@ void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr, } } -void osm_dump_service_record(IN osm_log_t * p_log, - IN const ib_service_record_t * p_sr, - IN osm_log_level_t log_level) +void osm_dump_mc_record(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_mc_record_to_buf(p_mcmr, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_mc_record_v2(IN osm_log_t * p_log, IN const ib_member_rec_t * p_mcmr, + IN const int file_id, IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_mc_record_to_buf(p_mcmr, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_service_record_to_buf(IN const ib_service_record_t * p_sr, + OUT char * buf) +{ + if (!buf || !p_sr) + return; + else { char gid_str[INET6_ADDRSTRLEN]; char buf_service_key[35]; char buf_service_name[65]; @@ -1282,7 +1586,7 @@ void osm_dump_service_record(IN osm_log_t * p_log, strncpy(buf_service_name, (char *)p_sr->service_name, 64); buf_service_name[64] = '\0'; - osm_log(p_log, log_level, + sprintf(buf, "Service Record dump:\n" "\t\t\t\tServiceID...............0x%016" PRIx64 "\n" "\t\t\t\tServiceGID..............%s\n" @@ -1351,70 +1655,146 @@ void osm_dump_service_record(IN osm_log_t * p_log, } } -void osm_dump_inform_info(IN osm_log_t * p_log, - IN const ib_inform_info_t * p_ii, - IN osm_log_level_t log_level) +void osm_dump_service_record(IN osm_log_t * p_log, + IN const ib_service_record_t * p_sr, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_service_record_to_buf(p_sr, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_service_record_v2(IN osm_log_t * p_log, + IN const ib_service_record_t * p_sr, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_service_record_to_buf(p_sr, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_inform_info_to_buf_generic(IN const ib_inform_info_t * p_ii, + OUT char * buf) +{ + if (!buf || !p_ii) + return; + else { uint32_t qpn; uint8_t resp_time_val; char gid_str[INET6_ADDRSTRLEN]; + ib_inform_info_get_qpn_resp_time(p_ii->g_or_v.generic. qpn_resp_time_val, &qpn, &resp_time_val); - if (p_ii->is_generic) { - osm_log(p_log, log_level, - "InformInfo dump:\n" - "\t\t\t\tgid.....................%s\n" - "\t\t\t\tlid_range_begin.........%u\n" - "\t\t\t\tlid_range_end...........%u\n" - "\t\t\t\tis_generic..............0x%X\n" - "\t\t\t\tsubscribe...............0x%X\n" - "\t\t\t\ttrap_type...............0x%X\n" - "\t\t\t\ttrap_num................%u\n" - "\t\t\t\tqpn.....................0x%06X\n" - "\t\t\t\tresp_time_val...........0x%X\n" - "\t\t\t\tnode_type...............0x%06X\n" "", - inet_ntop(AF_INET6, p_ii->gid.raw, gid_str, - sizeof gid_str), - cl_ntoh16(p_ii->lid_range_begin), - cl_ntoh16(p_ii->lid_range_end), - p_ii->is_generic, p_ii->subscribe, - cl_ntoh16(p_ii->trap_type), - cl_ntoh16(p_ii->g_or_v.generic.trap_num), - cl_ntoh32(qpn), resp_time_val, - cl_ntoh32(ib_inform_info_get_prod_type(p_ii))); - } else { - osm_log(p_log, log_level, - "InformInfo dump:\n" - "\t\t\t\tgid.....................%s\n" - "\t\t\t\tlid_range_begin.........%u\n" - "\t\t\t\tlid_range_end...........%u\n" - "\t\t\t\tis_generic..............0x%X\n" - "\t\t\t\tsubscribe...............0x%X\n" - "\t\t\t\ttrap_type...............0x%X\n" - "\t\t\t\tdev_id..................0x%X\n" - "\t\t\t\tqpn.....................0x%06X\n" - "\t\t\t\tresp_time_val...........0x%X\n" - "\t\t\t\tvendor_id...............0x%06X\n" "", - inet_ntop(AF_INET6, p_ii->gid.raw, gid_str, - sizeof gid_str), - cl_ntoh16(p_ii->lid_range_begin), - cl_ntoh16(p_ii->lid_range_end), - p_ii->is_generic, p_ii->subscribe, - cl_ntoh16(p_ii->trap_type), - cl_ntoh16(p_ii->g_or_v.vend.dev_id), - cl_ntoh32(qpn), resp_time_val, - cl_ntoh32(ib_inform_info_get_prod_type(p_ii))); - } + sprintf(buf, + "InformInfo dump:\n" + "\t\t\t\tgid.....................%s\n" + "\t\t\t\tlid_range_begin.........%u\n" + "\t\t\t\tlid_range_end...........%u\n" + "\t\t\t\tis_generic..............0x%X\n" + "\t\t\t\tsubscribe...............0x%X\n" + "\t\t\t\ttrap_type...............0x%X\n" + "\t\t\t\ttrap_num................%u\n" + "\t\t\t\tqpn.....................0x%06X\n" + "\t\t\t\tresp_time_val...........0x%X\n" + "\t\t\t\tnode_type...............0x%06X\n" "", + inet_ntop(AF_INET6, p_ii->gid.raw, gid_str, + sizeof gid_str), + cl_ntoh16(p_ii->lid_range_begin), + cl_ntoh16(p_ii->lid_range_end), + p_ii->is_generic, p_ii->subscribe, + cl_ntoh16(p_ii->trap_type), + cl_ntoh16(p_ii->g_or_v.generic.trap_num), + cl_ntoh32(qpn), resp_time_val, + cl_ntoh32(ib_inform_info_get_prod_type(p_ii))); } } -void osm_dump_inform_info_record(IN osm_log_t * p_log, - IN const ib_inform_info_record_t * p_iir, - IN osm_log_level_t log_level) +static void osm_dump_inform_info_to_buf(IN const ib_inform_info_t * p_ii, + OUT char * buf) +{ + if (!buf || !p_ii) + return; + else { + uint32_t qpn; + uint8_t resp_time_val; + char gid_str[INET6_ADDRSTRLEN]; + + ib_inform_info_get_qpn_resp_time(p_ii->g_or_v.generic. + qpn_resp_time_val, &qpn, + &resp_time_val); + sprintf(buf, + "InformInfo dump:\n" + "\t\t\t\tgid.....................%s\n" + "\t\t\t\tlid_range_begin.........%u\n" + "\t\t\t\tlid_range_end...........%u\n" + "\t\t\t\tis_generic..............0x%X\n" + "\t\t\t\tsubscribe...............0x%X\n" + "\t\t\t\ttrap_type...............0x%X\n" + "\t\t\t\tdev_id..................0x%X\n" + "\t\t\t\tqpn.....................0x%06X\n" + "\t\t\t\tresp_time_val...........0x%X\n" + "\t\t\t\tvendor_id...............0x%06X\n" "", + inet_ntop(AF_INET6, p_ii->gid.raw, gid_str, + sizeof gid_str), + cl_ntoh16(p_ii->lid_range_begin), + cl_ntoh16(p_ii->lid_range_end), + p_ii->is_generic, p_ii->subscribe, + cl_ntoh16(p_ii->trap_type), + cl_ntoh16(p_ii->g_or_v.vend.dev_id), + cl_ntoh32(qpn), resp_time_val, + cl_ntoh32(ib_inform_info_get_prod_type(p_ii))); + } +} + +void osm_dump_inform_info(IN osm_log_t * p_log, + IN const ib_inform_info_t * p_ii, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + if (p_ii->is_generic) + osm_dump_inform_info_to_buf_generic(p_ii, buf); + else + osm_dump_inform_info_to_buf(p_ii, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_inform_info_v2(IN osm_log_t * p_log, + IN const ib_inform_info_t * p_ii, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + if (p_ii->is_generic) + osm_dump_inform_info_to_buf_generic(p_ii, buf); + else + osm_dump_inform_info_to_buf(p_ii, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_inform_info_record_to_buf_generic(IN const ib_inform_info_record_t * p_iir, + OUT char * buf) +{ + if (!buf || p_iir) + return; + else { char gid_str[INET6_ADDRSTRLEN]; char gid_str2[INET6_ADDRSTRLEN]; uint32_t qpn; @@ -1423,80 +1803,128 @@ void osm_dump_inform_info_record(IN osm_log_t * p_log, ib_inform_info_get_qpn_resp_time(p_iir->inform_info.g_or_v. generic.qpn_resp_time_val, &qpn, &resp_time_val); - if (p_iir->inform_info.is_generic) { - osm_log(p_log, log_level, - "InformInfo Record dump:\n" - "\t\t\t\tRID\n" - "\t\t\t\tSubscriberGID...........%s\n" - "\t\t\t\tSubscriberEnum..........0x%X\n" - "\t\t\t\tInformInfo dump:\n" - "\t\t\t\tgid.....................%s\n" - "\t\t\t\tlid_range_begin.........%u\n" - "\t\t\t\tlid_range_end...........%u\n" - "\t\t\t\tis_generic..............0x%X\n" - "\t\t\t\tsubscribe...............0x%X\n" - "\t\t\t\ttrap_type...............0x%X\n" - "\t\t\t\ttrap_num................%u\n" - "\t\t\t\tqpn.....................0x%06X\n" - "\t\t\t\tresp_time_val...........0x%X\n" - "\t\t\t\tnode_type...............0x%06X\n" "", - inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, - gid_str, sizeof gid_str), - cl_ntoh16(p_iir->subscriber_enum), - inet_ntop(AF_INET6, p_iir->inform_info.gid.raw, - gid_str2, sizeof gid_str2), - cl_ntoh16(p_iir->inform_info.lid_range_begin), - cl_ntoh16(p_iir->inform_info.lid_range_end), - p_iir->inform_info.is_generic, - p_iir->inform_info.subscribe, - cl_ntoh16(p_iir->inform_info.trap_type), - cl_ntoh16(p_iir->inform_info.g_or_v.generic. - trap_num), cl_ntoh32(qpn), - resp_time_val, - cl_ntoh32(ib_inform_info_get_prod_type - (&p_iir->inform_info))); - } else { - osm_log(p_log, log_level, - "InformInfo Record dump:\n" - "\t\t\t\tRID\n" - "\t\t\t\tSubscriberGID...........%s\n" - "\t\t\t\tSubscriberEnum..........0x%X\n" - "\t\t\t\tInformInfo dump:\n" - "\t\t\t\tgid.....................%s\n" - "\t\t\t\tlid_range_begin.........%u\n" - "\t\t\t\tlid_range_end...........%u\n" - "\t\t\t\tis_generic..............0x%X\n" - "\t\t\t\tsubscribe...............0x%X\n" - "\t\t\t\ttrap_type...............0x%X\n" - "\t\t\t\tdev_id..................0x%X\n" - "\t\t\t\tqpn.....................0x%06X\n" - "\t\t\t\tresp_time_val...........0x%X\n" - "\t\t\t\tvendor_id...............0x%06X\n" "", - inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, - gid_str, sizeof gid_str), - cl_ntoh16(p_iir->subscriber_enum), - inet_ntop(AF_INET6, p_iir->inform_info.gid.raw, - gid_str2, sizeof gid_str2), - cl_ntoh16(p_iir->inform_info.lid_range_begin), - cl_ntoh16(p_iir->inform_info.lid_range_end), - p_iir->inform_info.is_generic, - p_iir->inform_info.subscribe, - cl_ntoh16(p_iir->inform_info.trap_type), - cl_ntoh16(p_iir->inform_info.g_or_v.vend. - dev_id), cl_ntoh32(qpn), - resp_time_val, - cl_ntoh32(ib_inform_info_get_prod_type - (&p_iir->inform_info))); - } + sprintf(buf, + "InformInfo Record dump:\n" + "\t\t\t\tRID\n" + "\t\t\t\tSubscriberGID...........%s\n" + "\t\t\t\tSubscriberEnum..........0x%X\n" + "\t\t\t\tInformInfo dump:\n" + "\t\t\t\tgid.....................%s\n" + "\t\t\t\tlid_range_begin.........%u\n" + "\t\t\t\tlid_range_end...........%u\n" + "\t\t\t\tis_generic..............0x%X\n" + "\t\t\t\tsubscribe...............0x%X\n" + "\t\t\t\ttrap_type...............0x%X\n" + "\t\t\t\ttrap_num................%u\n" + "\t\t\t\tqpn.....................0x%06X\n" + "\t\t\t\tresp_time_val...........0x%X\n" + "\t\t\t\tnode_type...............0x%06X\n" "", + inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, + gid_str, sizeof gid_str), + cl_ntoh16(p_iir->subscriber_enum), + inet_ntop(AF_INET6, p_iir->inform_info.gid.raw, + gid_str2, sizeof gid_str2), + cl_ntoh16(p_iir->inform_info.lid_range_begin), + cl_ntoh16(p_iir->inform_info.lid_range_end), + p_iir->inform_info.is_generic, + p_iir->inform_info.subscribe, + cl_ntoh16(p_iir->inform_info.trap_type), + cl_ntoh16(p_iir->inform_info.g_or_v.generic. + trap_num), cl_ntoh32(qpn), + resp_time_val, + cl_ntoh32(ib_inform_info_get_prod_type + (&p_iir->inform_info))); } } -void osm_dump_link_record(IN osm_log_t * p_log, - IN const ib_link_record_t * p_lr, - IN osm_log_level_t log_level) +static void osm_dump_inform_info_record_to_buf(IN const ib_inform_info_record_t * p_iir, + OUT char * buf) +{ + if(!buf || p_iir) + return; + else { + char gid_str[INET6_ADDRSTRLEN]; + char gid_str2[INET6_ADDRSTRLEN]; + uint32_t qpn; + uint8_t resp_time_val; + + ib_inform_info_get_qpn_resp_time(p_iir->inform_info.g_or_v. + generic.qpn_resp_time_val, + &qpn, &resp_time_val); + sprintf(buf, + "InformInfo Record dump:\n" + "\t\t\t\tRID\n" + "\t\t\t\tSubscriberGID...........%s\n" + "\t\t\t\tSubscriberEnum..........0x%X\n" + "\t\t\t\tInformInfo dump:\n" + "\t\t\t\tgid.....................%s\n" + "\t\t\t\tlid_range_begin.........%u\n" + "\t\t\t\tlid_range_end...........%u\n" + "\t\t\t\tis_generic..............0x%X\n" + "\t\t\t\tsubscribe...............0x%X\n" + "\t\t\t\ttrap_type...............0x%X\n" + "\t\t\t\tdev_id..................0x%X\n" + "\t\t\t\tqpn.....................0x%06X\n" + "\t\t\t\tresp_time_val...........0x%X\n" + "\t\t\t\tvendor_id...............0x%06X\n" "", + inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, + gid_str, sizeof gid_str), + cl_ntoh16(p_iir->subscriber_enum), + inet_ntop(AF_INET6, p_iir->inform_info.gid.raw, + gid_str2, sizeof gid_str2), + cl_ntoh16(p_iir->inform_info.lid_range_begin), + cl_ntoh16(p_iir->inform_info.lid_range_end), + p_iir->inform_info.is_generic, + p_iir->inform_info.subscribe, + cl_ntoh16(p_iir->inform_info.trap_type), + cl_ntoh16(p_iir->inform_info.g_or_v.vend. + dev_id), cl_ntoh32(qpn), + resp_time_val, + cl_ntoh32(ib_inform_info_get_prod_type + (&p_iir->inform_info))); + } +} + +void osm_dump_inform_info_record(IN osm_log_t * p_log, + IN const ib_inform_info_record_t * p_iir, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { - osm_log(p_log, log_level, + char buf[BUF_SIZE]; + + if (p_iir->inform_info.is_generic) + osm_dump_inform_info_record_to_buf_generic(p_iir, buf); + else + osm_dump_inform_info_record_to_buf(p_iir, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_inform_info_record_v2(IN osm_log_t * p_log, + IN const ib_inform_info_record_t * p_iir, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + if (p_iir->inform_info.is_generic) + osm_dump_inform_info_record_to_buf_generic(p_iir, buf); + else + osm_dump_inform_info_record_to_buf(p_iir, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_link_record_to_buf(IN const ib_link_record_t * p_lr, + OUT char * buf) +{ + if (!buf || !p_lr) + return; + else { + sprintf(buf, "Link Record dump:\n" "\t\t\t\tfrom_lid................%u\n" "\t\t\t\tfrom_port_num...........%u\n" @@ -1508,12 +1936,40 @@ void osm_dump_link_record(IN osm_log_t * p_log, } } -void osm_dump_switch_info(IN osm_log_t * p_log, - IN const ib_switch_info_t * p_si, +void osm_dump_link_record(IN osm_log_t * p_log, + IN const ib_link_record_t * p_lr, IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { - osm_log(p_log, OSM_LOG_VERBOSE, + char buf[BUF_SIZE]; + + osm_dump_link_record_to_buf(p_lr, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_link_record_v2(IN osm_log_t * p_log, + IN const ib_link_record_t * p_lr, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_link_record_to_buf(p_lr, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_switch_info_to_buf(IN const ib_switch_info_t * p_si, + OUT char * buf) +{ + if (!buf || !p_si) + return; + else { + sprintf(buf, "SwitchInfo dump:\n" "\t\t\t\tlin_cap.................0x%X\n" "\t\t\t\trand_cap................0x%X\n" @@ -1537,12 +1993,40 @@ void osm_dump_switch_info(IN osm_log_t * p_log, } } -void osm_dump_switch_info_record(IN osm_log_t * p_log, - IN const ib_switch_info_record_t * p_sir, - IN osm_log_level_t log_level) +void osm_dump_switch_info(IN osm_log_t * p_log, + IN const ib_switch_info_t * p_si, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { - osm_log(p_log, log_level, + char buf[BUF_SIZE]; + + osm_dump_switch_info_to_buf(p_si, buf); + + osm_log(p_log, OSM_LOG_VERBOSE, buf); + } +} + +void osm_dump_switch_info_v2(IN osm_log_t * p_log, + IN const ib_switch_info_t * p_si, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_switch_info_to_buf(p_si, buf); + + osm_log_v2(p_log, OSM_LOG_VERBOSE, file_id, buf); + } +} + +static void osm_dump_switch_info_record_to_buf(IN const ib_switch_info_record_t * p_sir, + OUT char * buf) +{ + if (!buf || !p_sir) + return; + else { + sprintf(buf, "SwitchInfo Record dump:\n" "\t\t\t\tRID\n" "\t\t\t\tlid.....................%u\n" @@ -1573,12 +2057,42 @@ void osm_dump_switch_info_record(IN osm_log_t * p_log, } } -void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid, - IN uint16_t block_num, IN uint8_t port_num, - IN const ib_pkey_table_t * p_pkey_tbl, - IN osm_log_level_t log_level) +void osm_dump_switch_info_record(IN osm_log_t * p_log, + IN const ib_switch_info_record_t * p_sir, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_switch_info_record_to_buf(p_sir, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_switch_info_record_v2(IN osm_log_t * p_log, + IN const ib_switch_info_record_t * p_sir, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_switch_info_record_to_buf(p_sir, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_pkey_block_to_buf(IN uint64_t port_guid, + IN uint16_t block_num, + IN uint8_t port_num, + IN const ib_pkey_table_t * p_pkey_tbl, + OUT char * buf) +{ + if (!buf || !p_pkey_tbl) + return; + else { char buf_line[1024]; int i, n; @@ -1586,7 +2100,7 @@ void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid, n += sprintf(buf_line + n, " 0x%04x |", cl_ntoh16(p_pkey_tbl->pkey_entry[i])); - osm_log(p_log, log_level, + sprintf(buf, "P_Key table dump:\n" "\t\t\tport_guid...........0x%016" PRIx64 "\n" "\t\t\tblock_num...........0x%X\n" @@ -1595,12 +2109,46 @@ void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid, } } -void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid, - IN uint8_t in_port_num, IN uint8_t out_port_num, - IN const ib_slvl_table_t * p_slvl_tbl, - IN osm_log_level_t log_level) +void osm_dump_pkey_block(IN osm_log_t * p_log, IN uint64_t port_guid, + IN uint16_t block_num, IN uint8_t port_num, + IN const ib_pkey_table_t * p_pkey_tbl, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_pkey_block_to_buf(port_guid, block_num, port_num, + p_pkey_tbl, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_pkey_block_v2(IN osm_log_t * p_log, IN uint64_t port_guid, + IN uint16_t block_num, IN uint8_t port_num, + IN const ib_pkey_table_t * p_pkey_tbl, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_pkey_block_to_buf(port_guid, block_num, + port_num, p_pkey_tbl, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_slvl_map_table_to_buf(IN uint64_t port_guid, + IN uint8_t in_port_num, + IN uint8_t out_port_num, + IN const ib_slvl_table_t * p_slvl_tbl, + OUT char * buf) +{ + if (!buf || !p_slvl_tbl) + return; + else { char buf_line1[1024], buf_line2[1024]; int n; uint8_t i; @@ -1610,7 +2158,7 @@ void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid, for (i = 0, n = 0; i < 16; i++) n += sprintf(buf_line2 + n, "0x%01X |", ib_slvl_table_get(p_slvl_tbl, i)); - osm_log(p_log, log_level, + sprintf(buf, "SLtoVL dump:\n" "\t\t\tport_guid............0x%016" PRIx64 "\n" "\t\t\tin_port_num..........%u\n" @@ -1620,12 +2168,46 @@ void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid, } } -void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid, - IN uint8_t block_num, IN uint8_t port_num, - IN const ib_vl_arb_table_t * p_vla_tbl, - IN osm_log_level_t log_level) +void osm_dump_slvl_map_table(IN osm_log_t * p_log, IN uint64_t port_guid, + IN uint8_t in_port_num, IN uint8_t out_port_num, + IN const ib_slvl_table_t * p_slvl_tbl, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_slvl_map_table_to_buf(port_guid, in_port_num, + out_port_num, p_slvl_tbl, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_slvl_map_table_v2(IN osm_log_t * p_log, IN uint64_t port_guid, + IN uint8_t in_port_num, IN uint8_t out_port_num, + IN const ib_slvl_table_t * p_slvl_tbl, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_slvl_map_table_to_buf(port_guid, in_port_num, + out_port_num, p_slvl_tbl, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_vl_arb_table_to_buf(IN uint64_t port_guid, + IN uint8_t block_num, + IN uint8_t port_num, + IN const ib_vl_arb_table_t * p_vla_tbl, + OUT char * buf) +{ + if (!buf || !p_vla_tbl) + return; + else { char buf_line1[1024], buf_line2[1024]; int i, n; @@ -1635,7 +2217,7 @@ void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid, for (i = 0, n = 0; i < 32; i++) n += sprintf(buf_line2 + n, " 0x%01X |", p_vla_tbl->vl_entry[i].weight); - osm_log(p_log, log_level, + sprintf(buf, "VLArb dump:\n" "\t\t\tport_guid...........0x%016" PRIx64 "\n" "\t\t\tblock_num...........0x%X\n" "\t\t\tport_num............%u\n\tVL : | %s\n\tWEIGHT:| %s\n", @@ -1644,11 +2226,44 @@ void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid, } } -void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi, - IN osm_log_level_t log_level) +void osm_dump_vl_arb_table(IN osm_log_t * p_log, IN uint64_t port_guid, + IN uint8_t block_num, IN uint8_t port_num, + IN const ib_vl_arb_table_t * p_vla_tbl, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { - osm_log(p_log, OSM_LOG_DEBUG, + char buf[BUF_SIZE]; + + osm_dump_vl_arb_table_to_buf(port_guid, block_num, + port_num, p_vla_tbl, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_vl_arb_table_v2(IN osm_log_t * p_log, IN uint64_t port_guid, + IN uint8_t block_num, IN uint8_t port_num, + IN const ib_vl_arb_table_t * p_vla_tbl, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_vl_arb_table_to_buf(port_guid, block_num, + port_num, p_vla_tbl, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_sm_info_to_buf(IN const ib_sm_info_t * p_smi, + OUT char * buf) +{ + if (!buf || !p_smi) + return; + else { + sprintf(buf, "SMInfo dump:\n" "\t\t\t\tguid....................0x%016" PRIx64 "\n" "\t\t\t\tsm_key..................0x%016" PRIx64 "\n" @@ -1662,12 +2277,37 @@ void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi, } } -void osm_dump_sm_info_record(IN osm_log_t * p_log, - IN const ib_sminfo_record_t * p_smir, - IN osm_log_level_t log_level) +void osm_dump_sm_info(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { - osm_log(p_log, OSM_LOG_DEBUG, + char buf[BUF_SIZE]; + + osm_dump_sm_info_to_buf(p_smi, buf); + + osm_log(p_log, OSM_LOG_DEBUG, buf); + } +} + +void osm_dump_sm_info_v2(IN osm_log_t * p_log, IN const ib_sm_info_t * p_smi, + IN const int file_id, IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_sm_info_to_buf(p_smi, buf); + + osm_log_v2(p_log, OSM_LOG_DEBUG, file_id, buf); + } +} + +static void osm_dump_sm_info_record_to_buf(IN const ib_sminfo_record_t * p_smir, + OUT char * buf) +{ + if (!buf || !p_smir) + return; + else { + sprintf(buf, "SMInfo Record dump:\n" "\t\t\t\tRID\n" "\t\t\t\tLid.....................%u\n" @@ -1687,18 +2327,44 @@ void osm_dump_sm_info_record(IN osm_log_t * p_log, } } -void osm_dump_notice(IN osm_log_t * p_log, - IN const ib_mad_notice_attr_t * p_ntci, - IN osm_log_level_t log_level) +void osm_dump_sm_info_record(IN osm_log_t * p_log, + IN const ib_sminfo_record_t * p_smir, + IN osm_log_level_t log_level) { - if (!osm_log_is_active(p_log, log_level)) - return; + if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_sm_info_record_to_buf(p_smir, buf); + + osm_log(p_log, OSM_LOG_DEBUG, buf); + } +} + +void osm_dump_sm_info_record_v2(IN osm_log_t * p_log, + IN const ib_sminfo_record_t * p_smir, + IN const int file_id, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_sm_info_record_to_buf(p_smir, buf); + + osm_log_v2(p_log, OSM_LOG_DEBUG, file_id, buf); + } +} - if (ib_notice_is_generic(p_ntci)) { +static void osm_dump_notice_to_buf_generic(IN const ib_mad_notice_attr_t * p_ntci, + OUT char * log_buf) +{ + if (!log_buf || !p_ntci) + return; + else { char gid_str[INET6_ADDRSTRLEN]; char gid_str2[INET6_ADDRSTRLEN]; char buff[1024]; int n; + buff[0] = '\0'; /* immediate data based on the trap */ @@ -1858,7 +2524,7 @@ void osm_dump_notice(IN osm_log_t * p_log, break; } - osm_log(p_log, log_level, + sprintf(log_buf, "Generic Notice dump:\n" "\t\t\t\ttype.....................%u\n" "\t\t\t\tprod_type................%u (%s)\n" @@ -1868,8 +2534,16 @@ void osm_dump_notice(IN osm_log_t * p_log, ib_get_producer_type_str(ib_notice_get_prod_type (p_ntci)), cl_ntoh16(p_ntci->g_or_v.generic.trap_num), buff); - } else { - osm_log(p_log, log_level, + } +} + +static void osm_dump_notice_to_buf(IN const ib_mad_notice_attr_t * p_ntci, + OUT char * buf) +{ + if (!buf || !p_ntci) + return; + else { + sprintf(buf, "Vendor Notice dump:\n" "\t\t\t\ttype.....................%u\n" "\t\t\t\tvendor...................%u\n" @@ -1880,11 +2554,43 @@ void osm_dump_notice(IN osm_log_t * p_log, } } -void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, +void osm_dump_notice(IN osm_log_t * p_log, + IN const ib_mad_notice_attr_t * p_ntci, IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { char buf[BUF_SIZE]; + + if (ib_notice_is_generic(p_ntci)) + osm_dump_notice_to_buf_generic(p_ntci, buf); + else + osm_dump_notice_to_buf(p_ntci, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_notice_v2(IN osm_log_t * p_log, + IN const ib_mad_notice_attr_t * p_ntci, + IN const int file_id, IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + if (ib_notice_is_generic(p_ntci)) + osm_dump_notice_to_buf_generic(p_ntci, buf); + else + osm_dump_notice_to_buf(p_ntci, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_dr_smp_to_buf(IN const ib_smp_t * p_smp, OUT char * buf) +{ + if (!buf || !p_smp) + return; + else { unsigned n; n = sprintf(buf, @@ -1980,20 +2686,41 @@ void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, n += snprintf(buf + n, sizeof(buf) - n, "\t\t\t\tMAD IS LID ROUTED\n"); } - - osm_log(p_log, log_level, "%s\n", buf); } } -void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_mad, +void osm_dump_dr_smp(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { char buf[BUF_SIZE]; + osm_dump_dr_smp_to_buf(p_smp, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_dr_smp_v2(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, + IN const int file_id, IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_dr_smp_to_buf(p_smp, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_sa_mad_to_buf(IN const ib_sa_mad_t * p_mad, OUT char * buf) +{ + if (!buf || !p_mad) + return; + else { /* make sure the mad is valid */ if (p_mad == NULL) { - osm_log(p_log, log_level, "NULL MAD POINTER\n"); + sprintf(buf, "NULL MAD POINTER\n"); return; } @@ -2033,16 +2760,39 @@ void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_mad, cl_ntoh16(p_mad->resv3), cl_ntoh64(p_mad->comp_mask)); strcat(buf, "\n"); - - osm_log(p_log, log_level, "%s\n", buf); } } -void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path, - IN osm_log_level_t log_level) +void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_mad, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { char buf[BUF_SIZE]; + + osm_dump_sa_mad_to_buf(p_mad, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_sa_mad_v2(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_mad, + IN const int file_id, IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_sa_mad_to_buf(p_mad, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_dr_path_to_buf(IN const osm_dr_path_t * p_path, + OUT char * buf) +{ + if (!buf || !p_path) + return; + else { unsigned n = 0; n = sprintf(buf, "Directed Path Dump of %u hop path: " @@ -2050,15 +2800,39 @@ void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path, sprint_uint8_arr(buf + n, sizeof(buf) - n, p_path->path, p_path->hop_count + 1); - osm_log(p_log, log_level, "%s\n", buf); } } -void osm_dump_smp_dr_path(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, - IN osm_log_level_t log_level) +void osm_dump_dr_path(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path, + IN osm_log_level_t log_level) { if (osm_log_is_active(p_log, log_level)) { char buf[BUF_SIZE]; + + osm_dump_dr_path_to_buf(p_path, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_dr_path_v2(IN osm_log_t * p_log, IN const osm_dr_path_t * p_path, + IN const int file_id, IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_dr_path_to_buf(p_path, buf); + + osm_log_v2(p_log, log_level, file_id, buf); + } +} + +static void osm_dump_smp_dr_path_to_buf(IN const ib_smp_t * p_smp, + OUT char * buf) +{ + if (!buf || !p_smp) + return; + else { unsigned n; n = sprintf(buf, "Received SMP on a %u hop path: " @@ -2070,8 +2844,30 @@ void osm_dump_smp_dr_path(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, n += sprintf(buf + n, ", Return path = "); n += sprint_uint8_arr(buf + n, sizeof(buf) - n, p_smp->return_path, p_smp->hop_count + 1); + } +} + +void osm_dump_smp_dr_path(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, + IN osm_log_level_t log_level) +{ + if (osm_log_is_active(p_log, log_level)) { + char buf[BUF_SIZE]; + + osm_dump_smp_dr_path_to_buf(p_smp, buf); + + osm_log(p_log, log_level, buf); + } +} + +void osm_dump_smp_dr_path_v2(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, + IN const int file_id, IN osm_log_level_t log_level) +{ + if (osm_log_is_active_v2(p_log, log_level, file_id)) { + char buf[BUF_SIZE]; + + osm_dump_smp_dr_path_to_buf(p_smp, buf); - osm_log(p_log, log_level, "%s\n", buf); + osm_log_v2(p_log, log_level, file_id, buf); } } diff --git a/opensm/osm_inform.c b/opensm/osm_inform.c index 8444baa..2eb646a 100644 --- a/opensm/osm_inform.c +++ b/opensm/osm_inform.c @@ -88,9 +88,9 @@ static void dump_all_informs(IN const osm_subn_t * p_subn, IN osm_log_t * p_log) p_list_item = cl_qlist_head(&p_subn->sa_infr_list); while (p_list_item != cl_qlist_end(&p_subn->sa_infr_list)) { - osm_dump_inform_info(p_log, - &((osm_infr_t *) p_list_item)-> - inform_record.inform_info, OSM_LOG_DEBUG); + osm_dump_inform_info_v2(p_log, + &((osm_infr_t *) p_list_item)-> + inform_record.inform_info, FILE_ID, OSM_LOG_DEBUG); p_list_item = cl_qlist_next(p_list_item); } } @@ -217,8 +217,8 @@ osm_infr_t *osm_infr_get_by_rec(IN osm_subn_t const *p_subn, dump_all_informs(p_subn, p_log); OSM_LOG(p_log, OSM_LOG_DEBUG, "Looking for Inform Record\n"); - osm_dump_inform_info(p_log, &(p_infr_rec->inform_record.inform_info), - OSM_LOG_DEBUG); + osm_dump_inform_info_v2(p_log, &(p_infr_rec->inform_record.inform_info), + FILE_ID, OSM_LOG_DEBUG); OSM_LOG(p_log, OSM_LOG_DEBUG, "InformInfo list size %d\n", cl_qlist_count(&p_subn->sa_infr_list)); @@ -244,9 +244,9 @@ void osm_infr_insert_to_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log, dump_all_informs(p_subn, p_log); #if 0 - osm_dump_inform_info(p_log, - &(p_infr->inform_record.inform_info), - OSM_LOG_DEBUG); + osm_dump_inform_info_v2(p_log, + &(p_infr->inform_record.inform_info), + FILE_ID, OSM_LOG_DEBUG); #endif cl_qlist_insert_head(&p_subn->sa_infr_list, &p_infr->list_item); @@ -270,8 +270,8 @@ void osm_infr_remove_from_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log, gid_str, sizeof gid_str), p_infr->inform_record.subscriber_enum); - osm_dump_inform_info(p_log, &(p_infr->inform_record.inform_info), - OSM_LOG_DEBUG); + osm_dump_inform_info_v2(p_log, &(p_infr->inform_record.inform_info), + FILE_ID, OSM_LOG_DEBUG); cl_qlist_remove_item(&p_subn->sa_infr_list, &p_infr->list_item); p_subn->p_osm->sa.dirty = TRUE; diff --git a/opensm/osm_mlnx_ext_port_info_rcv.c b/opensm/osm_mlnx_ext_port_info_rcv.c index abf6fd4..8151bbc 100644 --- a/opensm/osm_mlnx_ext_port_info_rcv.c +++ b/opensm/osm_mlnx_ext_port_info_rcv.c @@ -89,8 +89,8 @@ void osm_mlnx_epi_rcv_process(IN void *context, IN void *data) port_guid = p_context->port_guid; node_guid = p_context->node_guid; - osm_dump_mlnx_ext_port_info(sm->p_log, node_guid, port_guid, port_num, - p_pi, OSM_LOG_DEBUG); + osm_dump_mlnx_ext_port_info_v2(sm->p_log, node_guid, port_guid, port_num, + p_pi, FILE_ID, OSM_LOG_DEBUG); CL_PLOCK_EXCL_ACQUIRE(sm->p_lock); p_port = osm_get_port_by_guid(sm->p_subn, port_guid); diff --git a/opensm/osm_node_info_rcv.c b/opensm/osm_node_info_rcv.c index dcf2456..beeef7d 100644 --- a/opensm/osm_node_info_rcv.c +++ b/opensm/osm_node_info_rcv.c @@ -84,15 +84,15 @@ static void report_duplicated_guid(IN osm_sm_t * sm, osm_physp_t * p_physp, cl_ntoh64(p_old->p_node->node_info.node_guid), p_old->port_num, cl_ntoh64(p_new->p_node->node_info.node_guid), p_new->port_num); - osm_dump_dr_path(sm->p_log, osm_physp_get_dr_path_ptr(p_physp), - OSM_LOG_ERROR); + osm_dump_dr_path_v2(sm->p_log, osm_physp_get_dr_path_ptr(p_physp), + FILE_ID, OSM_LOG_ERROR); path = *osm_physp_get_dr_path_ptr(p_new); if (osm_dr_path_extend(&path, port_num)) OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D05: " "DR path with hop count %d couldn't be extended\n", path.hop_count); - osm_dump_dr_path(sm->p_log, &path, OSM_LOG_ERROR); + osm_dump_dr_path_v2(sm->p_log, &path, FILE_ID, OSM_LOG_ERROR); } static void requery_dup_node_info(IN osm_sm_t * sm, osm_physp_t * p_physp, @@ -218,8 +218,8 @@ static void ni_rcv_set_links(IN osm_sm_t * sm, osm_node_t * p_node, "node 0x%" PRIx64 ", port number %u\n", cl_ntoh64(osm_node_get_node_guid(p_node)), port_num); p_physp = osm_node_get_physp_ptr(p_node, port_num); - osm_dump_dr_path(sm->p_log, osm_physp_get_dr_path_ptr(p_physp), - OSM_LOG_VERBOSE); + osm_dump_dr_path_v2(sm->p_log, osm_physp_get_dr_path_ptr(p_physp), + FILE_ID, OSM_LOG_VERBOSE); if (sm->p_subn->opt.exit_on_fatal == TRUE) { osm_log_v2(sm->p_log, OSM_LOG_SYS, FILE_ID, @@ -609,7 +609,7 @@ static void ni_rcv_process_new(IN osm_sm_t * sm, IN const osm_madw_t * p_madw) p_ni_context = osm_madw_get_ni_context_ptr(p_madw); port_num = ib_node_info_get_local_port_num(p_ni); - osm_dump_smp_dr_path(sm->p_log, p_smp, OSM_LOG_VERBOSE); + osm_dump_smp_dr_path_v2(sm->p_log, p_smp, FILE_ID, OSM_LOG_VERBOSE); OSM_LOG(sm->p_log, OSM_LOG_VERBOSE, "Discovered new %s node," @@ -651,13 +651,13 @@ static void ni_rcv_process_new(IN osm_sm_t * sm, IN const osm_madw_t * p_madw) "Duplicate Port GUID 0x%" PRIx64 "! Found by the two directed routes:\n", cl_ntoh64(p_ni->port_guid)); - osm_dump_dr_path(sm->p_log, - osm_physp_get_dr_path_ptr(p_port->p_physp), - OSM_LOG_ERROR); - osm_dump_dr_path(sm->p_log, - osm_physp_get_dr_path_ptr(p_port_check-> + osm_dump_dr_path_v2(sm->p_log, + osm_physp_get_dr_path_ptr(p_port->p_physp), + FILE_ID, OSM_LOG_ERROR); + osm_dump_dr_path_v2(sm->p_log, + osm_physp_get_dr_path_ptr(p_port_check-> p_physp), - OSM_LOG_ERROR); + FILE_ID, OSM_LOG_ERROR); osm_port_delete(&p_port); osm_node_delete(&p_node); goto Exit; @@ -834,14 +834,14 @@ void osm_ni_rcv_process(IN void *context, IN void *data) if (p_ni->node_guid == 0) { OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D16: " "Got Zero Node GUID! Found on the directed route:\n"); - osm_dump_smp_dr_path(sm->p_log, p_smp, OSM_LOG_ERROR); + osm_dump_smp_dr_path_v2(sm->p_log, p_smp, FILE_ID, OSM_LOG_ERROR); goto Exit; } if (p_ni->port_guid == 0) { OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D17: " "Got Zero Port GUID! Found on the directed route:\n"); - osm_dump_smp_dr_path(sm->p_log, p_smp, OSM_LOG_ERROR); + osm_dump_smp_dr_path_v2(sm->p_log, p_smp, FILE_ID, OSM_LOG_ERROR); goto Exit; } @@ -854,7 +854,7 @@ void osm_ni_rcv_process(IN void *context, IN void *data) CL_PLOCK_EXCL_ACQUIRE(sm->p_lock); p_node = osm_get_node_by_guid(sm->p_subn, p_ni->node_guid); - osm_dump_node_info(sm->p_log, p_ni, OSM_LOG_DEBUG); + osm_dump_node_info_v2(sm->p_log, p_ni, FILE_ID, OSM_LOG_DEBUG); if (!p_node) ni_rcv_process_new(sm, p_madw); diff --git a/opensm/osm_pkey_rcv.c b/opensm/osm_pkey_rcv.c index 6682c5a..b818485 100644 --- a/opensm/osm_pkey_rcv.c +++ b/opensm/osm_pkey_rcv.c @@ -130,8 +130,8 @@ void osm_pkey_rcv_process(IN void *context, IN void *data) goto Exit; } - osm_dump_pkey_block(sm->p_log, port_guid, block_num, port_num, - p_pkey_tbl, OSM_LOG_DEBUG); + osm_dump_pkey_block_v2(sm->p_log, port_guid, block_num, port_num, + p_pkey_tbl, FILE_ID, OSM_LOG_DEBUG); osm_physp_set_pkey_tbl(sm->p_log, sm->p_subn, p_physp, p_pkey_tbl, block_num); diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c index ca2808c..726ebad 100644 --- a/opensm/osm_port_info_rcv.c +++ b/opensm/osm_port_info_rcv.c @@ -462,8 +462,8 @@ static void pi_rcv_process_set(IN osm_sm_t * sm, IN osm_node_t * p_node, OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0F10: " "Received error status for SetResp()\n"); } - osm_dump_port_info(sm->p_log, osm_node_get_node_guid(p_node), - port_guid, port_num, p_pi, level); + osm_dump_port_info_v2(sm->p_log, osm_node_get_node_guid(p_node), + port_guid, port_num, p_pi, FILE_ID, level); } OSM_LOG(sm->p_log, OSM_LOG_DEBUG, @@ -510,8 +510,8 @@ void osm_pi_rcv_process(IN void *context, IN void *data) port_guid = p_context->port_guid; node_guid = p_context->node_guid; - osm_dump_port_info(sm->p_log, node_guid, port_guid, port_num, p_pi, - OSM_LOG_DEBUG); + osm_dump_port_info_v2(sm->p_log, node_guid, port_guid, port_num, p_pi, + FILE_ID, OSM_LOG_DEBUG); /* On receipt of client reregister, clear the reregister bit so reregistering won't be sent again and again */ diff --git a/opensm/osm_sa.c b/opensm/osm_sa.c index 1af9fdf..674b913 100644 --- a/opensm/osm_sa.c +++ b/opensm/osm_sa.c @@ -371,7 +371,7 @@ void osm_sa_send_error(IN osm_sa_t * sa, IN const osm_madw_t * p_madw, p_resp_sa_mad->attr_id = IB_MAD_ATTR_PATH_RECORD; if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_FRAMES)) - osm_dump_sa_mad(sa->p_log, p_resp_sa_mad, OSM_LOG_FRAMES); + osm_dump_sa_mad_v2(sa->p_log, p_resp_sa_mad, FILE_ID, OSM_LOG_FRAMES); osm_sa_send(sa, p_resp_madw, FALSE); @@ -483,7 +483,7 @@ void osm_sa_respond(osm_sa_t *sa, osm_madw_t *madw, size_t attr_size, free(item); } - osm_dump_sa_mad(sa->p_log, resp_sa_mad, OSM_LOG_FRAMES); + osm_dump_sa_mad_v2(sa->p_log, resp_sa_mad, FILE_ID, OSM_LOG_FRAMES); osm_sa_send(sa, resp_madw, FALSE); Exit: diff --git a/opensm/osm_sa_class_port_info.c b/opensm/osm_sa_class_port_info.c index c384b37..8027ebc 100644 --- a/opensm/osm_sa_class_port_info.c +++ b/opensm/osm_sa_class_port_info.c @@ -173,7 +173,7 @@ static void cpi_rcv_respond(IN osm_sa_t * sa, IN const osm_madw_t * p_madw) p_resp_cpi->cap_mask = cl_hton16(p_resp_cpi->cap_mask); if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_FRAMES)) - osm_dump_sa_mad(sa->p_log, p_resp_sa_mad, OSM_LOG_FRAMES); + osm_dump_sa_mad_v2(sa->p_log, p_resp_sa_mad, FILE_ID, OSM_LOG_FRAMES); osm_sa_send(sa, p_resp_madw, FALSE); diff --git a/opensm/osm_sa_guidinfo_record.c b/opensm/osm_sa_guidinfo_record.c index 83ce990..f9d7d3d 100644 --- a/opensm/osm_sa_guidinfo_record.c +++ b/opensm/osm_sa_guidinfo_record.c @@ -353,7 +353,7 @@ static void gir_respond(IN osm_sa_t *sa, IN osm_madw_t *p_madw) p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw); p_rcvd_rec = (ib_guidinfo_record_t *) ib_sa_mad_get_payload_ptr(p_sa_mad); if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_guidinfo_record(sa->p_log, p_rcvd_rec, OSM_LOG_DEBUG); + osm_dump_guidinfo_record_v2(sa->p_log, p_rcvd_rec, FILE_ID, OSM_LOG_DEBUG); guidinfo_rec = *p_rcvd_rec; guidinfo_respond(sa, p_madw, &guidinfo_rec); @@ -526,7 +526,7 @@ static void set_guidinfo(IN osm_sa_t *sa, IN osm_madw_t *p_madw, if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) { OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Dump of incoming record\n"); - osm_dump_guidinfo_record(sa->p_log, p_rcvd_rec, OSM_LOG_DEBUG); + osm_dump_guidinfo_record_v2(sa->p_log, p_rcvd_rec, FILE_ID, OSM_LOG_DEBUG); } set_mask = coalesce_comp_mask(p_madw); diff --git a/opensm/osm_sa_informinfo.c b/opensm/osm_sa_informinfo.c index eaffcd5..ce37372 100644 --- a/opensm/osm_sa_informinfo.c +++ b/opensm/osm_sa_informinfo.c @@ -339,8 +339,8 @@ static void infr_rcv_process_get_method(osm_sa_t * sa, IN osm_madw_t * p_madw) } if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_inform_info_record(sa->p_log, p_rcvd_rec, - OSM_LOG_DEBUG); + osm_dump_inform_info_record_v2(sa->p_log, p_rcvd_rec, + FILE_ID, OSM_LOG_DEBUG); cl_qlist_init(&rec_list); @@ -404,8 +404,8 @@ static void infr_rcv_process_set_method(osm_sa_t * sa, IN osm_madw_t * p_madw) #if 0 if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_inform_info(sa->p_log, p_recvd_inform_info, - OSM_LOG_DEBUG); + osm_dump_inform_info_v2(sa->p_log, p_recvd_inform_info, + FILE_ID, OSM_LOG_DEBUG); #endif /* Grab the lock */ diff --git a/opensm/osm_sa_link_record.c b/opensm/osm_sa_link_record.c index 69b0b1a..6c426be 100644 --- a/opensm/osm_sa_link_record.c +++ b/opensm/osm_sa_link_record.c @@ -456,7 +456,7 @@ void osm_lr_rcv_process(IN void *context, IN void *data) } if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_link_record(sa->p_log, p_lr, OSM_LOG_DEBUG); + osm_dump_link_record_v2(sa->p_log, p_lr, FILE_ID, OSM_LOG_DEBUG); cl_qlist_init(&lr_list); diff --git a/opensm/osm_sa_mad_ctrl.c b/opensm/osm_sa_mad_ctrl.c index a1a430d..fceaac8 100644 --- a/opensm/osm_sa_mad_ctrl.c +++ b/opensm/osm_sa_mad_ctrl.c @@ -218,7 +218,7 @@ static void sa_mad_ctrl_process(IN osm_sa_mad_ctrl_t * p_ctrl, OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 1A01: " "Unsupported attribute 0x%X\n", cl_ntoh16(p_sa_mad->attr_id)); - osm_dump_sa_mad(p_ctrl->p_log, p_sa_mad, OSM_LOG_ERROR); + osm_dump_sa_mad_v2(p_ctrl->p_log, p_sa_mad, FILE_ID, OSM_LOG_ERROR); } if (msg_id != CL_DISP_MSGID_NONE) { @@ -320,7 +320,7 @@ static void sa_mad_ctrl_rcv_callback(IN osm_madw_t * p_madw, IN void *context, p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw); if (OSM_LOG_IS_ACTIVE_V2(p_ctrl->p_log, OSM_LOG_FRAMES)) - osm_dump_sa_mad(p_ctrl->p_log, p_sa_mad, OSM_LOG_FRAMES); + osm_dump_sa_mad_v2(p_ctrl->p_log, p_sa_mad, FILE_ID, OSM_LOG_FRAMES); /* * C15-0.1.5 - Table 185: SA Header - p884 @@ -417,8 +417,8 @@ static void sa_mad_ctrl_send_err_callback(IN void *context, cl_ntoh16(p_madw->mad_addr.dest_lid), cl_ntoh64(p_madw->p_mad->trans_id)); - osm_dump_sa_mad(p_ctrl->p_log, osm_madw_get_sa_mad_ptr(p_madw), - OSM_LOG_ERROR); + osm_dump_sa_mad_v2(p_ctrl->p_log, osm_madw_get_sa_mad_ptr(p_madw), + FILE_ID, OSM_LOG_ERROR); /* An error occurred. No response was received to a request MAD. diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c index a4a7573..651bc95 100644 --- a/opensm/osm_sa_mcmember_record.c +++ b/opensm/osm_sa_mcmember_record.c @@ -914,7 +914,7 @@ static void mcmr_rcv_leave_mgrp(IN osm_sa_t * sa, IN osm_madw_t * p_madw) if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) { OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Dump of record\n"); - osm_dump_mc_record(sa->p_log, &mcmember_rec, OSM_LOG_DEBUG); + osm_dump_mc_record_v2(sa->p_log, &mcmember_rec, FILE_ID, OSM_LOG_DEBUG); } CL_PLOCK_EXCL_ACQUIRE(sa->p_lock); @@ -989,7 +989,7 @@ static void mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN osm_madw_t * p_madw) if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) { OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Dump of incoming record\n"); - osm_dump_mc_record(sa->p_log, &mcmember_rec, OSM_LOG_DEBUG); + osm_dump_mc_record_v2(sa->p_log, &mcmember_rec, FILE_ID, OSM_LOG_DEBUG); } CL_PLOCK_EXCL_ACQUIRE(sa->p_lock); @@ -1172,7 +1172,7 @@ static void mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN osm_madw_t * p_madw) CL_PLOCK_RELEASE(sa->p_lock); if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_mc_record(sa->p_log, &mcmember_rec, OSM_LOG_DEBUG); + osm_dump_mc_record_v2(sa->p_log, &mcmember_rec, FILE_ID, OSM_LOG_DEBUG); mcmr_rcv_respond(sa, p_madw, &mcmember_rec); diff --git a/opensm/osm_sa_multipath_record.c b/opensm/osm_sa_multipath_record.c index e80bfc2..712bd4f 100644 --- a/opensm/osm_sa_multipath_record.c +++ b/opensm/osm_sa_multipath_record.c @@ -1560,7 +1560,7 @@ void osm_mpr_rcv_process(IN void *context, IN void *data) } if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_multipath_record(sa->p_log, p_mpr, OSM_LOG_DEBUG); + osm_dump_multipath_record_v2(sa->p_log, p_mpr, FILE_ID, OSM_LOG_DEBUG); /* Validatg rate if supplied */ if ((p_sa_mad->comp_mask & IB_MPR_COMPMASK_RATESELEC) && diff --git a/opensm/osm_sa_node_record.c b/opensm/osm_sa_node_record.c index 441fe76..5cb64b5 100644 --- a/opensm/osm_sa_node_record.c +++ b/opensm/osm_sa_node_record.c @@ -206,8 +206,8 @@ static void nr_rcv_by_comp_mask(IN cl_map_item_t * p_map_item, IN void *context) OSM_LOG_ENTER(p_ctxt->sa->p_log); - osm_dump_node_info(p_ctxt->sa->p_log, &p_node->node_info, - OSM_LOG_DEBUG); + osm_dump_node_info_v2(p_ctxt->sa->p_log, &p_node->node_info, + FILE_ID, OSM_LOG_DEBUG); if (comp_mask & IB_NR_COMPMASK_LID) match_lid = p_rcvd_rec->lid; @@ -325,7 +325,7 @@ void osm_nr_rcv_process(IN void *ctx, IN void *data) } if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_node_record(sa->p_log, p_rcvd_rec, OSM_LOG_DEBUG); + osm_dump_node_record_v2(sa->p_log, p_rcvd_rec, FILE_ID, OSM_LOG_DEBUG); cl_qlist_init(&rec_list); diff --git a/opensm/osm_sa_path_record.c b/opensm/osm_sa_path_record.c index e205694..70e7b61 100644 --- a/opensm/osm_sa_path_record.c +++ b/opensm/osm_sa_path_record.c @@ -1680,7 +1680,7 @@ void osm_pr_rcv_process(IN void *context, IN void *data) } if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_path_record(sa->p_log, p_pr, OSM_LOG_DEBUG); + osm_dump_path_record_v2(sa->p_log, p_pr, FILE_ID, OSM_LOG_DEBUG); /* Validate rate if supplied */ if ((p_sa_mad->comp_mask & IB_PR_COMPMASK_RATESELEC) && diff --git a/opensm/osm_sa_portinfo_record.c b/opensm/osm_sa_portinfo_record.c index 4a97ef2..38c52f2 100644 --- a/opensm/osm_sa_portinfo_record.c +++ b/opensm/osm_sa_portinfo_record.c @@ -200,9 +200,9 @@ static void sa_pir_check_physp(IN osm_sa_t * sa, IN const osm_physp_t * p_physp, p_comp_pi = &p_rcvd_rec->port_info; p_pi = &p_physp->port_info; - osm_dump_port_info(sa->p_log, osm_node_get_node_guid(p_physp->p_node), - p_physp->port_guid, p_physp->port_num, - &p_physp->port_info, OSM_LOG_DEBUG); + osm_dump_port_info_v2(sa->p_log, osm_node_get_node_guid(p_physp->p_node), + p_physp->port_guid, p_physp->port_num, + &p_physp->port_info, FILE_ID, OSM_LOG_DEBUG); /* We have to re-check the base_lid, since if the given base_lid in p_pi is zero - we are comparing on all ports. */ @@ -551,7 +551,7 @@ void osm_pir_rcv_process(IN void *ctx, IN void *data) } if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_portinfo_record(sa->p_log, p_rcvd_rec, OSM_LOG_DEBUG); + osm_dump_portinfo_record_v2(sa->p_log, p_rcvd_rec, FILE_ID, OSM_LOG_DEBUG); cl_qlist_init(&rec_list); diff --git a/opensm/osm_sa_service_record.c b/opensm/osm_sa_service_record.c index 781792a..b274878 100644 --- a/opensm/osm_sa_service_record.c +++ b/opensm/osm_sa_service_record.c @@ -466,8 +466,8 @@ static void sr_rcv_process_get_method(osm_sa_t * sa, IN osm_madw_t * p_madw) (ib_service_record_t *) ib_sa_mad_get_payload_ptr(p_sa_mad); if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_service_record(sa->p_log, p_recvd_service_rec, - OSM_LOG_DEBUG); + osm_dump_service_record_v2(sa->p_log, p_recvd_service_rec, + FILE_ID, OSM_LOG_DEBUG); cl_qlist_init(&sr_match_item.sr_list); sr_match_item.p_service_rec = p_recvd_service_rec; @@ -519,8 +519,8 @@ static void sr_rcv_process_set_method(osm_sa_t * sa, IN osm_madw_t * p_madw) comp_mask = p_sa_mad->comp_mask; if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_service_record(sa->p_log, p_recvd_service_rec, - OSM_LOG_DEBUG); + osm_dump_service_record_v2(sa->p_log, p_recvd_service_rec, + FILE_ID, OSM_LOG_DEBUG); if ((comp_mask & (IB_SR_COMPMASK_SID | IB_SR_COMPMASK_SGID)) != (IB_SR_COMPMASK_SID | IB_SR_COMPMASK_SGID)) { @@ -617,8 +617,8 @@ static void sr_rcv_process_delete_method(osm_sa_t * sa, IN osm_madw_t * p_madw) (ib_service_record_t *) ib_sa_mad_get_payload_ptr(p_sa_mad); if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_service_record(sa->p_log, p_recvd_service_rec, - OSM_LOG_DEBUG); + osm_dump_service_record_v2(sa->p_log, p_recvd_service_rec, + FILE_ID, OSM_LOG_DEBUG); /* Grab the lock */ cl_plock_excl_acquire(sa->p_lock); diff --git a/opensm/osm_sa_sminfo_record.c b/opensm/osm_sa_sminfo_record.c index 852fb9e..e549046 100644 --- a/opensm/osm_sa_sminfo_record.c +++ b/opensm/osm_sa_sminfo_record.c @@ -213,7 +213,7 @@ void osm_smir_rcv_process(IN void *ctx, IN void *data) } if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_sm_info_record(sa->p_log, p_rcvd_rec, OSM_LOG_DEBUG); + osm_dump_sm_info_record_v2(sa->p_log, p_rcvd_rec, FILE_ID, OSM_LOG_DEBUG); p_smi = &p_rcvd_rec->sm_info; diff --git a/opensm/osm_sa_sw_info_record.c b/opensm/osm_sa_sw_info_record.c index e1161d8..ee0ef81 100644 --- a/opensm/osm_sa_sw_info_record.c +++ b/opensm/osm_sa_sw_info_record.c @@ -177,8 +177,8 @@ static void sir_rcv_by_comp_mask(IN cl_map_item_t * p_map_item, IN void *cxt) OSM_LOG_ENTER(p_ctxt->sa->p_log); - osm_dump_switch_info(p_ctxt->sa->p_log, &p_sw->switch_info, - OSM_LOG_VERBOSE); + osm_dump_switch_info_v2(p_ctxt->sa->p_log, &p_sw->switch_info, + FILE_ID, OSM_LOG_VERBOSE); if (comp_mask & IB_SWIR_COMPMASK_LID) { match_lid = p_rcvd_rec->lid; @@ -235,8 +235,8 @@ void osm_sir_rcv_process(IN void *ctx, IN void *data) } if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) - osm_dump_switch_info_record(sa->p_log, p_rcvd_rec, - OSM_LOG_DEBUG); + osm_dump_switch_info_record_v2(sa->p_log, p_rcvd_rec, + FILE_ID, OSM_LOG_DEBUG); cl_qlist_init(&rec_list); diff --git a/opensm/osm_slvl_map_rcv.c b/opensm/osm_slvl_map_rcv.c index fd8681e..f5f4240 100644 --- a/opensm/osm_slvl_map_rcv.c +++ b/opensm/osm_slvl_map_rcv.c @@ -145,10 +145,10 @@ void osm_slvl_rcv_process(IN void *context, IN void *p_data) cl_ntoh64(port_guid), cl_ntoh64(node_guid), cl_ntoh64(p_smp->trans_id)); - osm_dump_slvl_map_table(sm->p_log, port_guid, - startinport == endinport ? startinport : 0xff, - startoutport == endoutport ? startoutport : 0xff, - p_slvl_tbl, OSM_LOG_DEBUG); + osm_dump_slvl_map_table_v2(sm->p_log, port_guid, + startinport == endinport ? startinport : 0xff, + startoutport == endoutport ? startoutport : 0xff, + p_slvl_tbl, FILE_ID, OSM_LOG_DEBUG); for (out_port = startoutport; out_port <= endoutport; out_port++) { p_physp = osm_node_get_physp_ptr(p_node, out_port); diff --git a/opensm/osm_sm_mad_ctrl.c b/opensm/osm_sm_mad_ctrl.c index fbc551d..e4c8d94 100644 --- a/opensm/osm_sm_mad_ctrl.c +++ b/opensm/osm_sm_mad_ctrl.c @@ -198,7 +198,7 @@ static void sm_mad_ctrl_process_get_resp(IN osm_sm_mad_ctrl_t * p_ctrl, if (p_smp->mgmt_class == IB_MCLASS_SUBN_DIR && !ib_smp_is_d(p_smp)) { OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3102: " "'D' bit not set in returned SMP\n"); - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR); + osm_dump_dr_smp_v2(p_ctrl->p_log, p_smp, FILE_ID, OSM_LOG_ERROR); } p_old_madw = transaction_context; @@ -264,7 +264,7 @@ static void sm_mad_ctrl_process_get_resp(IN osm_sm_mad_ctrl_t * p_ctrl, OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3103: " "Unsupported attribute 0x%X\n", cl_ntoh16(p_smp->attr_id)); - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR); + osm_dump_dr_smp_v2(p_ctrl->p_log, p_smp, FILE_ID, OSM_LOG_ERROR); osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw); goto Exit; } @@ -394,7 +394,7 @@ static void sm_mad_ctrl_process_set(IN osm_sm_mad_ctrl_t * p_ctrl, OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3107: " "Unsupported attribute 0x%X\n", cl_ntoh16(p_smp->attr_id)); - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR); + osm_dump_dr_smp_v2(p_ctrl->p_log, p_smp, FILE_ID, OSM_LOG_ERROR); osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw); goto Exit; } @@ -473,7 +473,7 @@ static void sm_mad_ctrl_process_trap(IN osm_sm_mad_ctrl_t * p_ctrl, OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3109: " "Unsupported attribute 0x%X\n", cl_ntoh16(p_smp->attr_id)); - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR); + osm_dump_dr_smp_v2(p_ctrl->p_log, p_smp, FILE_ID, OSM_LOG_ERROR); osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw); goto Exit; } @@ -541,7 +541,7 @@ static void sm_mad_ctrl_process_trap_repress(IN osm_sm_mad_ctrl_t * p_ctrl, OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3105: " "Unsupported attribute 0x%X\n", cl_ntoh16(p_smp->attr_id)); - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR); + osm_dump_dr_smp_v2(p_ctrl->p_log, p_smp, FILE_ID, OSM_LOG_ERROR); osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw); break; } @@ -575,7 +575,7 @@ static void log_rcv_cb_error(osm_log_t *p_log, ib_smp_t *p_smp, ib_net16_t statu cl_ntoh64(p_smp->trans_id), p_smp->mgmt_class == IB_MCLASS_SUBN_DIR ? buf : ""); - osm_dump_dr_smp(p_log, p_smp, OSM_LOG_VERBOSE); + osm_dump_dr_smp_v2(p_log, p_smp, FILE_ID, OSM_LOG_VERBOSE); } /* @@ -624,7 +624,7 @@ static void sm_mad_ctrl_rcv_callback(IN osm_madw_t * p_madw, OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "Ignoring received mad - since we are exiting\n"); - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_DEBUG); + osm_dump_dr_smp_v2(p_ctrl->p_log, p_smp, FILE_ID, OSM_LOG_DEBUG); /* retire the mad or put it back */ if (ib_smp_is_response(p_smp)) { @@ -639,7 +639,7 @@ static void sm_mad_ctrl_rcv_callback(IN osm_madw_t * p_madw, } if (OSM_LOG_IS_ACTIVE_V2(p_ctrl->p_log, OSM_LOG_FRAMES)) - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_FRAMES); + osm_dump_dr_smp_v2(p_ctrl->p_log, p_smp, FILE_ID, OSM_LOG_FRAMES); if (p_smp->mgmt_class == IB_MCLASS_SUBN_DIR) status = ib_smp_get_status(p_smp); @@ -677,7 +677,7 @@ static void sm_mad_ctrl_rcv_callback(IN osm_madw_t * p_madw, cl_atomic_inc(&p_ctrl->p_stats->qp0_mads_rcvd_unknown); OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3112: " "Unsupported method = 0x%X\n", p_smp->method); - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR); + osm_dump_dr_smp_v2(p_ctrl->p_log, p_smp, FILE_ID, OSM_LOG_ERROR); osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw); goto Exit; } @@ -745,7 +745,7 @@ static void sm_mad_ctrl_send_err_cb(IN void *context, IN osm_madw_t * p_madw) p_ctrl->p_subn->subnet_initialization_error = TRUE; } - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_VERBOSE); + osm_dump_dr_smp_v2(p_ctrl->p_log, p_smp, FILE_ID, OSM_LOG_VERBOSE); /* Since we did not get any response we suspect the DR path diff --git a/opensm/osm_sminfo_rcv.c b/opensm/osm_sminfo_rcv.c index b474932..4ee4f17 100644 --- a/opensm/osm_sminfo_rcv.c +++ b/opensm/osm_sminfo_rcv.c @@ -449,7 +449,7 @@ static void smi_rcv_process_get_response(IN osm_sm_t * sm, p_sm_tbl = &sm->p_subn->sm_guid_tbl; port_guid = p_smi->guid; - osm_dump_sm_info(sm->p_log, p_smi, OSM_LOG_DEBUG); + osm_dump_sm_info_v2(sm->p_log, p_smi, FILE_ID, OSM_LOG_DEBUG); /* Check that the sm_key of the found SM is the same as ours, or is zero. If not - OpenSM cannot continue with configuration!. */ @@ -535,7 +535,7 @@ static void smi_rcv_process_set_response(IN osm_sm_t * sm, } p_smi = ib_smp_get_payload_ptr(p_smp); - osm_dump_sm_info(sm->p_log, p_smi, OSM_LOG_DEBUG); + osm_dump_sm_info_v2(sm->p_log, p_smi, FILE_ID, OSM_LOG_DEBUG); /* Check the AttributeModifier */ if (p_smp->attr_mod != IB_SMINFO_ATTR_MOD_HANDOVER) { diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c index a2b2b96..e37976c 100644 --- a/opensm/osm_state_mgr.c +++ b/opensm/osm_state_mgr.c @@ -656,9 +656,9 @@ static ib_api_status_t state_mgr_light_sweep_start(IN osm_sm_t * sm) (p_node)), p_node->print_desc, port_num); - osm_dump_dr_path(sm->p_log, - osm_physp_get_dr_path_ptr - (p_physp), OSM_LOG_ERROR); + osm_dump_dr_path_v2(sm->p_log, + osm_physp_get_dr_path_ptr + (p_physp), FILE_ID, OSM_LOG_ERROR); state_mgr_get_remote_port_info(sm, p_physp); } diff --git a/opensm/osm_sw_info_rcv.c b/opensm/osm_sw_info_rcv.c index 398b5a4..84e7fe0 100644 --- a/opensm/osm_sw_info_rcv.c +++ b/opensm/osm_sw_info_rcv.c @@ -212,7 +212,7 @@ static void si_rcv_process_new(IN osm_sm_t * sm, IN osm_node_t * p_node, p_smp = osm_madw_get_smp_ptr(p_madw); p_si = ib_smp_get_payload_ptr(p_smp); - osm_dump_switch_info(sm->p_log, p_si, OSM_LOG_DEBUG); + osm_dump_switch_info_v2(sm->p_log, p_si, FILE_ID, OSM_LOG_DEBUG); p_sw = osm_switch_new(p_node, p_madw); if (p_sw == NULL) { @@ -312,7 +312,7 @@ static boolean_t si_rcv_process_existing(IN osm_sm_t * sm, "Commencing heavy sweep\n"); is_change_detected = TRUE; } else if (ib_switch_info_get_state_change(p_si)) { - osm_dump_switch_info(sm->p_log, p_si, OSM_LOG_DEBUG); + osm_dump_switch_info_v2(sm->p_log, p_si, FILE_ID, OSM_LOG_DEBUG); is_change_detected = TRUE; } } diff --git a/opensm/osm_trap_rcv.c b/opensm/osm_trap_rcv.c index f79bb6b..e90ad5e 100644 --- a/opensm/osm_trap_rcv.c +++ b/opensm/osm_trap_rcv.c @@ -402,7 +402,7 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, log_trap_info(sm->p_log, p_ntci, source_lid, p_smp->trans_id); } - osm_dump_notice(sm->p_log, p_ntci, OSM_LOG_VERBOSE); + osm_dump_notice_v2(sm->p_log, p_ntci, FILE_ID, OSM_LOG_VERBOSE); p_physp = osm_get_physp_by_mad_addr(sm->p_log, sm->p_subn, &tmp_madw.mad_addr); diff --git a/opensm/osm_vl15intf.c b/opensm/osm_vl15intf.c index 3f19c5c..253578b 100644 --- a/opensm/osm_vl15intf.c +++ b/opensm/osm_vl15intf.c @@ -148,9 +148,9 @@ static void vl15_poller(IN void *p_ptr) OSM_LOG(p_vl->p_log, OSM_LOG_DEBUG, "Servicing p_madw = %p\n", p_madw); if (OSM_LOG_IS_ACTIVE_V2(p_vl->p_log, OSM_LOG_FRAMES)) - osm_dump_dr_smp(p_vl->p_log, - osm_madw_get_smp_ptr(p_madw), - OSM_LOG_FRAMES); + osm_dump_dr_smp_v2(p_vl->p_log, + osm_madw_get_smp_ptr(p_madw), + FILE_ID, OSM_LOG_FRAMES); vl15_send_mad(p_vl, p_madw); } else diff --git a/opensm/osm_vl_arb_rcv.c b/opensm/osm_vl_arb_rcv.c index b8b6136..3967574 100644 --- a/opensm/osm_vl_arb_rcv.c +++ b/opensm/osm_vl_arb_rcv.c @@ -142,8 +142,8 @@ void osm_vla_rcv_process(IN void *context, IN void *data) goto Exit; } - osm_dump_vl_arb_table(sm->p_log, port_guid, block_num, port_num, - p_vla_tbl, OSM_LOG_DEBUG); + osm_dump_vl_arb_table_v2(sm->p_log, port_guid, block_num, port_num, + p_vla_tbl, FILE_ID, OSM_LOG_DEBUG); osm_physp_set_vla_tbl(p_physp, p_vla_tbl, block_num); Exit: -- 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