From patchwork Sun Jun 20 11:35:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 107045 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5KBZLIM008112 for ; Sun, 20 Jun 2010 11:35:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751930Ab0FTLfU (ORCPT ); Sun, 20 Jun 2010 07:35:20 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:40590 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225Ab0FTLfT (ORCPT ); Sun, 20 Jun 2010 07:35:19 -0400 Received: by wwb22 with SMTP id 22so1133138wwb.19 for ; Sun, 20 Jun 2010 04:35:17 -0700 (PDT) Received: by 10.216.88.72 with SMTP id z50mr2444656wee.60.1277033717352; Sun, 20 Jun 2010 04:35:17 -0700 (PDT) Received: from [10.4.1.29] ([62.219.166.71]) by mx.google.com with ESMTPS id w27sm3574583weq.22.2010.06.20.04.35.16 (version=SSLv3 cipher=RC4-MD5); Sun, 20 Jun 2010 04:35:16 -0700 (PDT) Message-ID: <4C1DFCF2.1090907@dev.mellanox.co.il> Date: Sun, 20 Jun 2010 14:35:14 +0300 From: Yevgeny Kliteynik User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: Sasha Khapyorsky CC: Linux RDMA , Yevgeny Kliteynik Subject: [PATCH v5] opensm/osmeventplugin: added new events to monitor SM Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 20 Jun 2010 11:35:21 +0000 (UTC) diff --git a/opensm/include/opensm/osm_event_plugin.h b/opensm/include/opensm/osm_event_plugin.h index 33d1920..0b3464e 100644 --- a/opensm/include/opensm/osm_event_plugin.h +++ b/opensm/include/opensm/osm_event_plugin.h @@ -72,6 +72,10 @@ typedef enum { OSM_EVENT_ID_PORT_SELECT, OSM_EVENT_ID_TRAP, OSM_EVENT_ID_SUBNET_UP, + OSM_EVENT_ID_HEAVY_SWEEP_DONE, + OSM_EVENT_ID_UCAST_ROUTING_DONE, + OSM_EVENT_ID_STATE_CHANGE, + OSM_EVENT_ID_SA_DB_DUMPED, OSM_EVENT_ID_MAX } osm_epi_event_id_t; diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c index 81c8f54..299514b 100644 --- a/opensm/opensm/osm_state_mgr.c +++ b/opensm/opensm/osm_state_mgr.c @@ -1107,8 +1107,10 @@ static void do_sweep(osm_sm_t * sm) if (wait_for_pending_transactions(&sm->p_subn->p_osm->stats)) return; if (!sm->p_subn->force_heavy_sweep) { - if (sm->p_subn->opt.sa_db_dump) - osm_sa_db_file_dump(sm->p_subn->p_osm); + if (sm->p_subn->opt.sa_db_dump && + !osm_sa_db_file_dump(sm->p_subn->p_osm)) + osm_opensm_report_event(sm->p_subn->p_osm, + OSM_EVENT_ID_SA_DB_DUMPED, NULL); OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, "LIGHT SWEEP COMPLETE"); return; @@ -1151,6 +1153,8 @@ static void do_sweep(osm_sm_t * sm) if (!sm->p_subn->subnet_initialization_error) { OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, "REROUTE COMPLETE"); + osm_opensm_report_event(sm->p_subn->p_osm, + OSM_EVENT_ID_UCAST_ROUTING_DONE, NULL); return; } } @@ -1185,6 +1189,8 @@ repeat_discovery: /* Move to DISCOVERING state */ osm_sm_state_mgr_process(sm, OSM_SM_SIGNAL_DISCOVER); + osm_opensm_report_event(sm->p_subn->p_osm, + OSM_EVENT_ID_STATE_CHANGE, NULL); return; } @@ -1205,6 +1211,8 @@ repeat_discovery: "ENTERING STANDBY STATE"); /* notify master SM about us */ osm_send_trap144(sm, 0); + osm_opensm_report_event(sm->p_subn->p_osm, + OSM_EVENT_ID_STATE_CHANGE, NULL); return; } @@ -1212,6 +1220,9 @@ repeat_discovery: if (sm->p_subn->force_heavy_sweep) goto repeat_discovery; + osm_opensm_report_event(sm->p_subn->p_osm, + OSM_EVENT_ID_HEAVY_SWEEP_DONE, NULL); + OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, "HEAVY SWEEP COMPLETE"); /* If we are MASTER - get the highest remote_sm, and @@ -1314,6 +1325,8 @@ repeat_discovery: OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, "SWITCHES CONFIGURED FOR UNICAST"); + osm_opensm_report_event(sm->p_subn->p_osm, + OSM_EVENT_ID_UCAST_ROUTING_DONE, NULL); if (!sm->p_subn->opt.disable_multicast) { osm_mcast_mgr_process(sm); diff --git a/opensm/osmeventplugin/src/osmeventplugin.c b/opensm/osmeventplugin/src/osmeventplugin.c index b4d9ce9..f40f7fe 100644 --- a/opensm/osmeventplugin/src/osmeventplugin.c +++ b/opensm/osmeventplugin/src/osmeventplugin.c @@ -176,6 +176,18 @@ static void report(void *_log, osm_epi_event_id_t event_id, void *event_data) case OSM_EVENT_ID_SUBNET_UP: fprintf(log->log_file, "Subnet up reported\n"); break; + case OSM_EVENT_ID_HEAVY_SWEEP_DONE: + fprintf(log->log_file, "Heavy sweep completed\n"); + break; + case OSM_EVENT_ID_UCAST_ROUTING_DONE: + fprintf(log->log_file, "Unicast routing completed\n"); + break; + case OSM_EVENT_ID_STATE_CHANGE: + fprintf(log->log_file, "SM state changed\n"); + break; + case OSM_EVENT_ID_SA_DB_DUMPED: + fprintf(log->log_file, "SA DB dump file updated\n"); + break; case OSM_EVENT_ID_MAX: default: osm_log(log->osmlog, OSM_LOG_ERROR,