From patchwork Tue Jan 22 16:41:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Domke X-Patchwork-Id: 2019231 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 636D2DF2EB for ; Tue, 22 Jan 2013 16:44:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754728Ab3AVQoc (ORCPT ); Tue, 22 Jan 2013 11:44:32 -0500 Received: from mail02.nap.gsic.titech.ac.jp ([131.112.13.21]:58853 "HELO mail02.nap.gsic.titech.ac.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754730Ab3AVQo0 (ORCPT ); Tue, 22 Jan 2013 11:44:26 -0500 Received: from 131.112.13.36 by mail02.nap.gsic.titech.ac.jp with Mail2000 ESMTP Server V6.00S(11232:0:AUTH_RELAY) (envelope-from ); Wed, 23 Jan 2013 01:41:42 +0900 (JST) Received: from [131.112.13.20] (mail01.nap.gsic.titech.ac.jp) by drweb1.nap.gsic.titech.ac.jp (Dr.Web MailD 6.0.2.0) with SMTP id 0167C4E4; Wed, 23 Jan 2013 01:41:42 Received: from 131.112.29.201 by mail01.nap.gsic.titech.ac.jp with Mail2000 ESMTP Server V6.00S(799:0:AUTH_LOGIN) (envelope-from ); Wed, 23 Jan 2013 01:41:39 +0900 (JST) From: Jens Domke To: linux-rdma@vger.kernel.org Cc: Alex Netes , Torsten Hoefler , Jens Domke Subject: [PATCH 08/10] OpenSM: dfsssp - avoid unnecessary nested loop in vltable_print for OSM_LOG_INFO Date: Wed, 23 Jan 2013 01:41:31 +0900 Message-Id: <1358872891-17049-1-git-send-email-domke.j.aa@m.titech.ac.jp> X-Mailer: git-send-email 1.7.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org for OSM_LOG_INFO the debug function vltable_print was called, which iterates in a nested loop over all LIDs and only prints stuff for OSM_LOG_DEBUG; therefor we move vltable_print into a separated if clause Signed-off-by: Jens Domke --- opensm/osm_ucast_dfsssp.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/opensm/osm_ucast_dfsssp.c b/opensm/osm_ucast_dfsssp.c index b82d8c8..32bc8f1 100644 --- a/opensm/osm_ucast_dfsssp.c +++ b/opensm/osm_ucast_dfsssp.c @@ -1940,10 +1940,13 @@ static int dfsssp_remove_deadlocks(dfsssp_context_t * dfsssp_ctx) goto ERROR; } /* else { no balancing } */ - if (OSM_LOG_IS_ACTIVE_V2(p_mgr->p_log, OSM_LOG_INFO)) { + + if (OSM_LOG_IS_ACTIVE_V2(p_mgr->p_log, OSM_LOG_DEBUG)) { OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG, "Virtual Lanes per src/dest combination after balancing:\n"); vltable_print(p_mgr, srcdest2vl_table); + } + if (OSM_LOG_IS_ACTIVE_V2(p_mgr->p_log, OSM_LOG_INFO)) { OSM_LOG(p_mgr->p_log, OSM_LOG_INFO, "Paths per VL (after balancing):\n"); for (i = 0; i < vl_avail; i++)