* [PATCH 0/1] Tracing: Compile error with qla2xxx
@ 2022-09-07 2:37 Arun Easi
2022-09-07 2:38 ` [PATCH 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Arun Easi
0 siblings, 1 reply; 3+ messages in thread
From: Arun Easi @ 2022-09-07 2:37 UTC (permalink / raw)
To: Steven Rostedt, Martin Petersen, Sudip Mukherjee, James Bottomley,
linux-scsi, linux-kernel, linux-next, GR-QLogic-Storage-Upstream,
Arun Easi
Hi Steve, et.al,
Please find a patch to fix compile error coming from qla2xxx driver
when CONFIG_TRACING is disabled. Perhaps not all of the functions
need to be "#define-d" out, but I just did it for completeness.
Hi Martin,
Please apply this patch to the SCSI tree once Steve approves it. Here
is a link to the discussion:
https://lore.kernel.org/linux-scsi/YxdZ%2F9XOsWilvVSd@debian/T/#m6efb601ed65c907124a03cfd5f3f38f1eb8c5925
Regards,
-Arun
Arun Easi (1):
tracing: Fix compile error in trace_array calls when TRACING is
disabled
include/linux/trace.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--
2.9.5
base-commit: e699bb9765cd447ab477e9e888ddbab347dcf35a
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
2022-09-07 2:37 [PATCH 0/1] Tracing: Compile error with qla2xxx Arun Easi
@ 2022-09-07 2:38 ` Arun Easi
2022-09-07 2:48 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Arun Easi @ 2022-09-07 2:38 UTC (permalink / raw)
To: Steven Rostedt, Martin Petersen, Sudip Mukherjee, James Bottomley,
linux-scsi, linux-kernel, linux-next, GR-QLogic-Storage-Upstream,
Arun Easi
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
2022-09-07 2:38 ` [PATCH 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Arun Easi
@ 2022-09-07 2:48 ` Steven Rostedt
0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2022-09-07 2:48 UTC (permalink / raw)
To: Arun Easi
Cc: Martin Petersen, Sudip Mukherjee, James Bottomley, linux-scsi,
linux-kernel, linux-next, GR-QLogic-Storage-Upstream
On Tue, 6 Sep 2022 19:38:00 -0700
Arun Easi <aeasi@marvell.com> 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 <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 { };
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 */
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-07 2:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-07 2:37 [PATCH 0/1] Tracing: Compile error with qla2xxx Arun Easi
2022-09-07 2:38 ` [PATCH 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Arun Easi
2022-09-07 2:48 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox