From patchwork Thu Oct 28 18:28:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arlin Davis X-Patchwork-Id: 288162 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9SISYiL003391 for ; Thu, 28 Oct 2010 18:28:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934011Ab0J1S2e (ORCPT ); Thu, 28 Oct 2010 14:28:34 -0400 Received: from mga02.intel.com ([134.134.136.20]:18897 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934045Ab0J1S2d convert rfc822-to-8bit (ORCPT ); Thu, 28 Oct 2010 14:28:33 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 28 Oct 2010 11:28:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.58,253,1286175600"; d="scan'208";a="671913724" Received: from orsmsx602.amr.corp.intel.com ([10.22.226.211]) by orsmga001.jf.intel.com with ESMTP; 28 Oct 2010 11:28:31 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.226.128) by orsmsx602.amr.corp.intel.com (10.22.226.211) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 28 Oct 2010 11:28:30 -0700 Received: from orsmsx506.amr.corp.intel.com ([10.22.226.44]) by orsmsx606.amr.corp.intel.com ([10.22.226.128]) with mapi; Thu, 28 Oct 2010 11:28:30 -0700 From: "Davis, Arlin R" To: linux-rdma , "ofw@lists.openfabrics.org" CC: "Smith, Stan" Date: Thu, 28 Oct 2010 11:28:29 -0700 Subject: [PATCH] DAPL v2.0: debug build: only timestamp if sending message to stdout to avoid performance hit Thread-Topic: [PATCH] DAPL v2.0: debug build: only timestamp if sending message to stdout to avoid performance hit Thread-Index: Act2zesXF1S++wn1ToWzvfN0qbfBHA== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 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 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Oct 2010 18:28:35 +0000 (UTC) diff --git a/dapl/common/dapl_debug.c b/dapl/common/dapl_debug.c index e1a940c..7a0a199 100644 --- a/dapl/common/dapl_debug.c +++ b/dapl/common/dapl_debug.c @@ -49,13 +49,13 @@ void dapl_internal_dbg_log(DAPL_DBG_TYPE type, const char *fmt, ...) dapl_os_get_time(&start_t); last_t = start_t; } - dapl_os_get_time(¤t_t); - delta_t = current_t - last_t; - total_t = current_t - start_t; - last_t = current_t; if (type & g_dapl_dbg_type) { if (DAPL_DBG_DEST_STDOUT & g_dapl_dbg_dest) { + dapl_os_get_time(¤t_t); + delta_t = current_t - last_t; + total_t = current_t - start_t; + last_t = current_t; va_start(args, fmt); fprintf(stdout, "%s:%x:%x: %d us(%d us%s): ", _ptr_host_, dapl_os_getpid(), dapl_os_gettid(),