From patchwork Thu Aug 13 20:05:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Marciniszyn, Mike" X-Patchwork-Id: 7010661 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5D023C05AC for ; Thu, 13 Aug 2015 20:05:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 677C620661 for ; Thu, 13 Aug 2015 20:05:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 380B62060E for ; Thu, 13 Aug 2015 20:05:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753800AbbHMUFa (ORCPT ); Thu, 13 Aug 2015 16:05:30 -0400 Received: from mga01.intel.com ([192.55.52.88]:2956 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752183AbbHMUFa (ORCPT ); Thu, 13 Aug 2015 16:05:30 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 13 Aug 2015 13:05:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,672,1432623600"; d="scan'208";a="783669045" Received: from sedona.ch.intel.com ([143.182.228.65]) by orsmga002.jf.intel.com with ESMTP; 13 Aug 2015 13:05:26 -0700 Received: from phlsvsles11.ph.intel.com (phlsvsles11.ph.intel.com [10.228.195.43]) by sedona.ch.intel.com (8.13.6/8.14.3/Standard MailSET/Hub) with ESMTP id t7DK5P0S020615; Thu, 13 Aug 2015 13:05:25 -0700 Received: from phlsvslse11.ph.intel.com (localhost [127.0.0.1]) by phlsvsles11.ph.intel.com with ESMTP id t7DK5Olv028672; Thu, 13 Aug 2015 16:05:24 -0400 Subject: [PATCH v2] IB/hfi1: Remove inline from trace functions To: dledford@redhat.com From: Mike Marciniszyn Cc: linux-rdma@vger.kernel.org Date: Thu, 13 Aug 2015 16:05:24 -0400 Message-ID: <20150813200524.28650.91753.stgit@phlsvslse11.ph.intel.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dennis Dalessandro Inline in trace functions causes the following build error when CONFIG_OPTIMIZE_INLINING is not defined in the kernel config: error: function can never be inlined because it uses variable argument lists Reported by 0-day build: https://lists.01.org/pipermail/kbuild-all/2015-August/011215.html This patch converts to a non-inline version of the hfi1 trace functions Reviewed-by: Jubin John Reviewed-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/staging/hfi1/trace.c | 15 ++++++++++- drivers/staging/hfi1/trace.h | 56 +++++++++++++++++------------------------- 2 files changed, 35 insertions(+), 36 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/hfi1/trace.c b/drivers/staging/hfi1/trace.c index afbb212..ea95591 100644 --- a/drivers/staging/hfi1/trace.c +++ b/drivers/staging/hfi1/trace.c @@ -48,7 +48,6 @@ * */ #define CREATE_TRACE_POINTS -#define HFI1_TRACE_DO_NOT_CREATE_INLINES #include "trace.h" u8 ibhdr_exhdr_len(struct hfi1_ib_header *hdr) @@ -208,4 +207,16 @@ const char *print_u64_array( return ret; } -#undef HFI1_TRACE_DO_NOT_CREATE_INLINES +__hfi1_trace_fn(PKT); +__hfi1_trace_fn(PROC); +__hfi1_trace_fn(SDMA); +__hfi1_trace_fn(LINKVERB); +__hfi1_trace_fn(DEBUG); +__hfi1_trace_fn(SNOOP); +__hfi1_trace_fn(CNTR); +__hfi1_trace_fn(PIO); +__hfi1_trace_fn(DC8051); +__hfi1_trace_fn(FIRMWARE); +__hfi1_trace_fn(RCVCTRL); +__hfi1_trace_fn(TID); + diff --git a/drivers/staging/hfi1/trace.h b/drivers/staging/hfi1/trace.h index 5c34606..d7851c0 100644 --- a/drivers/staging/hfi1/trace.h +++ b/drivers/staging/hfi1/trace.h @@ -1339,22 +1339,17 @@ DECLARE_EVENT_CLASS(hfi1_trace_template, /* * It may be nice to macroize the __hfi1_trace but the va_* stuff requires an - * actual function to work and can not be in a macro. Also the fmt can not be a - * constant char * because we need to be able to manipulate the \n if it is - * present. + * actual function to work and can not be in a macro. */ -#define __hfi1_trace_event(lvl) \ +#define __hfi1_trace_def(lvl) \ +void __hfi1_trace_##lvl(const char *funct, char *fmt, ...); \ + \ DEFINE_EVENT(hfi1_trace_template, hfi1_ ##lvl, \ TP_PROTO(const char *function, struct va_format *vaf), \ TP_ARGS(function, vaf)) -#ifdef HFI1_TRACE_DO_NOT_CREATE_INLINES -#define __hfi1_trace_fn(fn) __hfi1_trace_event(fn) -#else -#define __hfi1_trace_fn(fn) \ -__hfi1_trace_event(fn); \ -__printf(2, 3) \ -static inline void __hfi1_trace_##fn(const char *func, char *fmt, ...) \ +#define __hfi1_trace_fn(lvl) \ +void __hfi1_trace_##lvl(const char *func, char *fmt, ...) \ { \ struct va_format vaf = { \ .fmt = fmt, \ @@ -1363,36 +1358,29 @@ static inline void __hfi1_trace_##fn(const char *func, char *fmt, ...) \ \ va_start(args, fmt); \ vaf.va = &args; \ - trace_hfi1_ ##fn(func, &vaf); \ + trace_hfi1_ ##lvl(func, &vaf); \ va_end(args); \ return; \ } -#endif /* - * To create a new trace level simply define it as below. This will create all - * the hooks for calling hfi1_cdbg(LVL, fmt, ...); as well as take care of all + * To create a new trace level simply define it below and as a __hfi1_trace_fn + * in trace.c. This will create all the hooks for calling + * hfi1_cdbg(LVL, fmt, ...); as well as take care of all * the debugfs stuff. */ -__hfi1_trace_fn(RVPKT); -__hfi1_trace_fn(INIT); -__hfi1_trace_fn(VERB); -__hfi1_trace_fn(PKT); -__hfi1_trace_fn(PROC); -__hfi1_trace_fn(MM); -__hfi1_trace_fn(ERRPKT); -__hfi1_trace_fn(SDMA); -__hfi1_trace_fn(VPKT); -__hfi1_trace_fn(LINKVERB); -__hfi1_trace_fn(VERBOSE); -__hfi1_trace_fn(DEBUG); -__hfi1_trace_fn(SNOOP); -__hfi1_trace_fn(CNTR); -__hfi1_trace_fn(PIO); -__hfi1_trace_fn(DC8051); -__hfi1_trace_fn(FIRMWARE); -__hfi1_trace_fn(RCVCTRL); -__hfi1_trace_fn(TID); +__hfi1_trace_def(PKT); +__hfi1_trace_def(PROC); +__hfi1_trace_def(SDMA); +__hfi1_trace_def(LINKVERB); +__hfi1_trace_def(DEBUG); +__hfi1_trace_def(SNOOP); +__hfi1_trace_def(CNTR); +__hfi1_trace_def(PIO); +__hfi1_trace_def(DC8051); +__hfi1_trace_def(FIRMWARE); +__hfi1_trace_def(RCVCTRL); +__hfi1_trace_def(TID); #define hfi1_cdbg(which, fmt, ...) \ __hfi1_trace_##which(__func__, fmt, ##__VA_ARGS__)