All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Easi <aeasi@marvell.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Martin Petersen <martin.petersen@oracle.com>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	James Bottomley <jejb@linux.ibm.com>,
	<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-next@vger.kernel.org>,
	<GR-QLogic-Storage-Upstream@marvell.com>,
	Arun Easi <aeasi@marvell.com>
Subject: [PATCH 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
Date: Tue, 6 Sep 2022 19:38:00 -0700	[thread overview]
Message-ID: <20220907023800.4095-2-aeasi@marvell.com> (raw)
In-Reply-To: <20220907023800.4095-1-aeasi@marvell.com>

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 <lkp@intel.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
---
 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 { };
+#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
+#define osnoise_arch_register() -EINVAL
+#define osnoise_arch_unregister()
+#define osnoise_trace_irq_entry(id)
+#define osnoise_trace_irq_exit(id, desc)
 #endif	/* CONFIG_TRACING */
 
 #endif	/* _LINUX_TRACE_H */
-- 
2.9.5


  reply	other threads:[~2022-09-07  2:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07  2:37 [PATCH 0/1] Tracing: Compile error with qla2xxx Arun Easi
2022-09-07  2:38 ` Arun Easi [this message]
2022-09-07  2:48   ` [PATCH 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220907023800.4095-2-aeasi@marvell.com \
    --to=aeasi@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=rostedt@goodmis.org \
    --cc=sudipm.mukherjee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.