Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5141122rwb; Tue, 6 Sep 2022 20:03:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR6n/2YWlXoqtWXo+2pGvG52LK6nCHcuSb1/nAwNTNLr09GmS4WLjsFNWqmuIYlcRnfl7VoK X-Received: by 2002:aa7:c545:0:b0:44e:a7a7:bc66 with SMTP id s5-20020aa7c545000000b0044ea7a7bc66mr1265206edr.70.1662519795355; Tue, 06 Sep 2022 20:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662519795; cv=none; d=google.com; s=arc-20160816; b=0wytrEjYBjdfwmKRJhuoxzqF6HM7HwE8OCVaYYjloRcjEEsk/RmLvqhUEf9Niqhwb1 8mumX7aIgrOjZTCSx6hfC9qyMue2K7THqzJlasWnOtGhe5DrlzMilGEyA5iN7mzS1q7M UoxkTAJRJIVdxuu0McQHv57myF8cnAQeFPCSTsJIOWZSlJzuvGZwTnNt5dL7s1v/A1xX /WEF9pVwcoPh4hlrggizvYZXW/zL+8eVLLc+TtIdaHNYd9ORuezOfABdHQ/SAfOuinpe HDXD2UgtMjmSCvqAj7NA2W3DNjoB8avJqCiwPciZGojLibC3s+pMKy2jt5vAjfhWThPG cXnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=7eYWRfySvx4QPVUM0ST2+coBcx69vXmiAx4YOqRCVsQ=; b=xPvIYqIUB3SOaB9Anp3iL7g7KIIEL1KTnOoMEG1eTvwSi9PJhmtBgtEl5wWiVBj8RT Hua8NJksuqE8Rv+n62c8+JzOf7FkpnAlK+H21WTa66GTyxw3QNJYvl3K9UVEYSll9YdI POyiDXTMHZHpr0ZFbTGu456i7KchFA3gfPyn+Kq+Y/7F1Bq+s12OM50xqatUBojuVm06 q2oM98fn4LjKjbNi91b8v++0N4u2s5X49YeGkeodO5WU/saWgTUleV33RKxBe2vEs9AM GyQZSmUiGsZ3XBRAeQssg8CQvCx0Cb1EZPkxMSGkUf5GJ87bt4jZy29MI99NczuUNXA5 iBvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020a056402358400b004486d90c931si12835514edc.49.2022.09.06.20.02.50; Tue, 06 Sep 2022 20:03:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229644AbiIGCsN (ORCPT + 99 others); Tue, 6 Sep 2022 22:48:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbiIGCsL (ORCPT ); Tue, 6 Sep 2022 22:48:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3250898D37; Tue, 6 Sep 2022 19:48:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3666A61700; Wed, 7 Sep 2022 02:48:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0281C433C1; Wed, 7 Sep 2022 02:48:06 +0000 (UTC) Date: Tue, 6 Sep 2022 22:48:45 -0400 From: Steven Rostedt To: Arun Easi Cc: Martin Petersen , Sudip Mukherjee , James Bottomley , , , , Subject: Re: [PATCH 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Message-ID: <20220906224845.64bc7afd@gandalf.local.home> In-Reply-To: <20220907023800.4095-2-aeasi@marvell.com> References: <20220907023800.4095-1-aeasi@marvell.com> <20220907023800.4095-2-aeasi@marvell.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 6 Sep 2022 19:38:00 -0700 Arun Easi wrote: > Fix this compilation error seen when CONFIG_TRACING is not enabled: > > drivers/scsi/qla2xxx/qla_os.c: In function 'qla_trace_init': > drivers/scsi/qla2xxx/qla_os.c:2854:25: error: implicit declaration of function > 'trace_array_get_by_name'; did you mean 'trace_array_set_clr_event'? > [-Werror=implicit-function-declaration] > 2854 | qla_trc_array = trace_array_get_by_name("qla2xxx"); > | ^~~~~~~~~~~~~~~~~~~~~~~ > | trace_array_set_clr_event > > drivers/scsi/qla2xxx/qla_os.c: In function 'qla_trace_uninit': > drivers/scsi/qla2xxx/qla_os.c:2869:9: error: implicit declaration of function > 'trace_array_put' [-Werror=implicit-function-declaration] > 2869 | trace_array_put(qla_trc_array); > | ^~~~~~~~~~~~~~~ > > Reported-by: kernel test robot > Signed-off-by: Arun Easi > --- > include/linux/trace.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/include/linux/trace.h b/include/linux/trace.h > index bf16961..bf206c3 100644 > --- a/include/linux/trace.h > +++ b/include/linux/trace.h > @@ -48,6 +48,23 @@ void osnoise_arch_unregister(void); > void osnoise_trace_irq_entry(int id); > void osnoise_trace_irq_exit(int id, const char *desc); > > +#else /* CONFIG_TRACING */ > +#define TRACE_EXPORT_FUNCTION 0 > +#define TRACE_EXPORT_EVENT 0 > +#define TRACE_EXPORT_MARKER 0 > +struct trace_export { }; The original for the above can just be moved out of the #ifdef CONFIG_TRACING. No need to "hide" them. > +#define register_ftrace_export(export) -EINVAL > +#define unregister_ftrace_export(export) 0 > +#define trace_printk_init_buffers() > +#define trace_array_printk(tr, ip, fmt, ...) 0 > +#define trace_array_init_printk(tr) -EINVAL > +#define trace_array_put(tr) > +#define trace_array_get_by_name(name) NULL > +#define trace_array_destroy(tr) 0 With the data outside the #ifdef, the above should be converted into static inlines. > +#define osnoise_arch_register() -EINVAL > +#define osnoise_arch_unregister() > +#define osnoise_trace_irq_entry(id) > +#define osnoise_trace_irq_exit(id, desc) No need to define the osnoise functions. These are only here to allow archs to define them. They should never be referenced when CONFIG_TRACING is not set. > #endif /* CONFIG_TRACING */ > > #endif /* _LINUX_TRACE_H */