From patchwork Mon Feb 4 13:20:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 2091961 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 813553FD56 for ; Mon, 4 Feb 2013 13:20:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755313Ab3BDNU3 (ORCPT ); Mon, 4 Feb 2013 08:20:29 -0500 Received: from mail-vb0-f53.google.com ([209.85.212.53]:39312 "EHLO mail-vb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755236Ab3BDNU1 (ORCPT ); Mon, 4 Feb 2013 08:20:27 -0500 Received: by mail-vb0-f53.google.com with SMTP id fj18so3823737vbb.40 for ; Mon, 04 Feb 2013 05:20:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=oaf7qEJsDPpPPv4XHAgi6yJpfYbDX4PWseVLOwWpr0A=; b=SYZDgXBxdpJ+QFbhQLzwMeQbGXoXQbBWgoCtwLVBMIQv2M72Fmu0coopeeK1E96f5f RXoE4wM4Mt4Y1m5qQ8ouPlxLHoFfSrVt2w/e4ngxWJr1fnKDkdKlhZ1uwDhzPsez+wRV 46RWP9Xyloo7vmO3L+c/XxH77Sdq1OtmqzmL8jyPVgSTNRZg2mmc6SFFibIu2UBCkfsL F/rqBgFpihVxPhfbcGSOZURnEkevOzYpiG9FSMb4H0ld8pFyv5bPpPZa15x8HCVE1lcs tsH7WXCncBUX1LPgyY4ZFnNloObYAVYKoU2gdr+kaz29J9B2eaSv8eIjB/wUU/Foqh2d FzLQ== X-Received: by 10.52.27.241 with SMTP id w17mr19605786vdg.96.1359984026450; Mon, 04 Feb 2013 05:20:26 -0800 (PST) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPS id x17sm21646707vdi.1.2013.02.04.05.20.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Feb 2013 05:20:25 -0800 (PST) From: Alex Netes To: linux-rdma@vger.kernel.org Cc: Alex Netes Subject: [PATCH] opensm: Changed #if to #ifdef when using ENABLE_OSM_PERF_MGR_PROFILE Date: Mon, 4 Feb 2013 15:20:04 +0200 Message-Id: <1359984011-30753-3-git-send-email-alexne@mellanox.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1359984011-30753-1-git-send-email-alexne@mellanox.com> References: <1359984011-30753-1-git-send-email-alexne@mellanox.com> X-Gm-Message-State: ALoCoQlGHoINOvN/3oAh+6LW8wSg/ZxtkMzDgrVohCabrXvjBiBQeT1f7J/5VjXoZtfMHN9UKH2m Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org If some plugins include opensm/osm_madw.h, ENABLE_OSM_PERF_MGR_PROFILE might be undefined and using #if will cause cause compilation error. Signed-off-by: Alex Netes --- include/opensm/osm_madw.h | 2 +- opensm/osm_perfmgr.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/opensm/osm_madw.h b/include/opensm/osm_madw.h index afc3680..c450a1d 100644 --- a/include/opensm/osm_madw.h +++ b/include/opensm/osm_madw.h @@ -334,7 +334,7 @@ typedef struct osm_perfmgr_context { uint64_t node_guid; uint16_t port; uint8_t mad_method; /* was this a get or a set */ -#if ENABLE_OSM_PERF_MGR_PROFILE +#ifdef ENABLE_OSM_PERF_MGR_PROFILE struct timeval query_start; #endif } osm_perfmgr_context_t; diff --git a/opensm/osm_perfmgr.c b/opensm/osm_perfmgr.c index d8f933e..5207245 100644 --- a/opensm/osm_perfmgr.c +++ b/opensm/osm_perfmgr.c @@ -70,7 +70,7 @@ #define PERFMGR_INITIAL_TID_VALUE 0xcafe -#if ENABLE_OSM_PERF_MGR_PROFILE +#ifdef ENABLE_OSM_PERF_MGR_PROFILE struct { double fastest_us; double slowest_us; @@ -557,7 +557,7 @@ static void perfmgr_query_counters(cl_map_item_t * p_map_item, void *context) mad_context.perfmgr_context.node_guid = node_guid; mad_context.perfmgr_context.port = port; mad_context.perfmgr_context.mad_method = IB_MAD_METHOD_GET; -#if ENABLE_OSM_PERF_MGR_PROFILE +#ifdef ENABLE_OSM_PERF_MGR_PROFILE gettimeofday(&mad_context.perfmgr_context.query_start, NULL); #endif OSM_LOG(pm->log, OSM_LOG_VERBOSE, "Getting stats for node 0x%" @@ -800,7 +800,7 @@ _exit: **********************************************************************/ void osm_perfmgr_process(osm_perfmgr_t * pm) { -#if ENABLE_OSM_PERF_MGR_PROFILE +#ifdef ENABLE_OSM_PERF_MGR_PROFILE struct timeval before, after; #endif @@ -835,7 +835,7 @@ void osm_perfmgr_process(osm_perfmgr_t * pm) CL_PLOCK_RELEASE(pm->sm->p_lock); } -#if ENABLE_OSM_PERF_MGR_PROFILE +#ifdef ENABLE_OSM_PERF_MGR_PROFILE gettimeofday(&before, NULL); #endif /* With the global lock held, collect the node guids */ @@ -853,7 +853,7 @@ void osm_perfmgr_process(osm_perfmgr_t * pm) /* clean out any nodes found to be removed during the sweep */ remove_marked_nodes(pm); -#if ENABLE_OSM_PERF_MGR_PROFILE +#ifdef ENABLE_OSM_PERF_MGR_PROFILE /* spin on outstanding queries */ while (pm->outstanding_queries > 0) cl_event_wait_on(&pm->sig_sweep, 1000, TRUE); @@ -1333,7 +1333,7 @@ static void pc_recv_process(void *context, void *data) perfmgr_check_overflow(pm, p_mon_node, pkey_ix, port, wire_read); -#if ENABLE_OSM_PERF_MGR_PROFILE +#ifdef ENABLE_OSM_PERF_MGR_PROFILE do { struct timeval proc_time; gettimeofday(&proc_time, NULL);