Tracing: Compile error with qla2xxx
Subsystems (3)
v3 cover Tracing: Compile error with qla2xxx
Hi Steve, et.al,
Please find a patch to fix compile error coming from qla2xxx driver when CONFIG_TRACING is disabled.
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
Changes from V2:
* Incorporated Bart's review comments (use of git clang-format)
Changes from V1:
* Incorporated Steve's review comments (change to inline etc.)
Regards,
-Arun
Arun Easi (1):
tracing: Fix compile error in trace_array calls when TRACING is
disabled
include/linux/trace.h | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-)
Signature · 3 lines
2.9.5 base-commit: efca52749564601de2045eb71dbe756b7bade4e8
PATCH v3 1/1 tracing: Fix compile error in trace_array calls when TRACING is disabled
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_eventdrivers/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);
| ^~~~~~~~~~~~~~~--- include/linux/trace.h | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-)
include/linux/trace.h +34 -2
@@ -2,8 +2,6 @@#ifndef _LINUX_TRACE_H#define _LINUX_TRACE_H -#ifdef CONFIG_TRACING -#define TRACE_EXPORT_FUNCTION BIT(0)#define TRACE_EXPORT_EVENT BIT(1)#define TRACE_EXPORT_MARKER BIT(2)
@@ -28,6 +26,8 @@ struct trace_export {int flags; }; +#ifdef CONFIG_TRACING +int register_ftrace_export (struct trace_export *export);int unregister_ftrace_export (struct trace_export *export);
@@ -48,6 +48,38 @@ 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 */ +static inline int register_ftrace_export (struct trace_export *export) +{ +return -EINVAL ; +} +static inline int unregister_ftrace_export (struct trace_export *export) +{ +return 0 ; +} +static inline void trace_printk_init_buffers (void ) +{ +} +static inline int trace_array_printk (struct trace_array *tr,unsigned long ip, +const char *fmt, ...) +{ +return 0 ; +} +static inline int trace_array_init_printk (struct trace_array *tr) +{ +return -EINVAL ; +} +static inline void trace_array_put (struct trace_array *tr) +{ +} +static inline struct trace_array *trace_array_get_by_name (const char *name) +{ +return NULL ; +} +static inline int trace_array_destroy (struct trace_array *tr) +{ +return 0 ; +}#endif /* CONFIG_TRACING */ #endif /* _LINUX_TRACE_H */
Signature · 1 line
2.9.5
Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
Quoted 51 lines · Arun Easi
include/linux/trace.h +27
-2@@ -2,8 +2,6 @@#ifndef _LINUX_TRACE_H#define _LINUX_TRACE_H -#ifdef CONFIG_TRACING -#define TRACE_EXPORT_FUNCTION BIT(0)#define TRACE_EXPORT_EVENT BIT(1)#define TRACE_EXPORT_MARKER BIT(2)@@ -28,6 +26,8 @@ struct trace_export {int flags; }; +#ifdef CONFIG_TRACING +int register_ftrace_export (struct trace_export *export);int unregister_ftrace_export (struct trace_export *export);@@ -48,6 +48,38 @@ 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 */ +static inline int register_ftrace_export (struct trace_export *export) +{ +return -EINVAL ; +} +static inline int unregister_ftrace_export (struct trace_export *export) +{ +return 0 ; +} +static inline void trace_printk_init_buffers (void ) +{ +} +static inline int trace_array_printk (struct trace_array *tr,unsigned long ip, +const char *fmt, ...) +{ +return 0 ; +} +static inline int trace_array_init_printk (struct trace_array *tr) +{ +return -EINVAL ; +} +static inline void trace_array_put (struct trace_array *tr) +{ +} +static inline struct trace_array *trace_array_get_by_name (const char *name)
include/linux/trace.h void osnoise_arch_unregister(void); · line 85
Quoted 10 lines
include/linux/trace.h +7
-0+{ +return NULL ; +} +static inline int trace_array_destroy (struct trace_array *tr) +{ +return 0 ; +}#endif /* CONFIG_TRACING */ #endif /* _LINUX_TRACE_H */
Thanks for having addressed my feedback. The above looks good to me. However, I'm not very familiar with the tracing framework so I will leave it to others to formally review this patch.
Thanks,
Bart.
Re: [EXT] Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
Quoted 56 lines · Bart Van Assche
----------------------------------------------------------------------
Quoted 53 lines · Arun Easi
include/linux/trace.h +13
-1@@ -2,8 +2,6 @@#ifndef _LINUX_TRACE_H#define _LINUX_TRACE_H -#ifdef CONFIG_TRACING -#define TRACE_EXPORT_FUNCTION BIT(0)#define TRACE_EXPORT_EVENT BIT(1)#define TRACE_EXPORT_MARKER BIT(2)@@ -28,6 +26,8 @@ struct trace_export {int flags; }; +#ifdef CONFIG_TRACING +int register_ftrace_export (struct trace_export *export);int unregister_ftrace_export (struct trace_export *export); @@ -48,6 +48,38 @@ 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 */ +static inline int register_ftrace_export (struct trace_export *export) +{ +return -EINVAL ; +} +static inline int unregister_ftrace_export (struct trace_export *export) +{ +return 0 ; +} +static inline void trace_printk_init_buffers (void ) +{ +} +static inline int trace_array_printk(struct trace_array *tr, unsigned longip,
include/linux/trace.h +17
-0+ const char *fmt, ...) +{ +return 0 ; +} +static inline int trace_array_init_printk (struct trace_array *tr) +{ +return -EINVAL ; +} +static inline void trace_array_put (struct trace_array *tr) +{ +} +static inline struct trace_array *trace_array_get_by_name (const char *name) +{ +return NULL ; +} +static inline int trace_array_destroy (struct trace_array *tr) +{
Quoted 9 lines
include/linux/trace.h void osnoise_arch_unregister(void); · line 85
Quoted 4 lines
include/linux/trace.h +2
-0+return 0 ; +}#endif /* CONFIG_TRACING */ #endif /* _LINUX_TRACE_H */ Thanks for having addressed my feedback. The above looks good to me. However, I'm not very familiar with the tracing framework so I will leave it to others to formally review this patch.
Thanks for the review and suggestion of the clang-format command line, Bart. That is a useful one to remember.
Steve, does this look ok? If so, your approval is appreciated, as this is a build blocker fix.
Regards,
-Arun
Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
In reply to Arun EasiSteven,
Can you please review Arun's patch?
Quoted 16 lines
Fix this compilation error seen when
CONFIG_TRACINGis 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); | ^~~~~~~~~~~~~~~
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Re: [EXT] Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
Since Steve is travelling, trying Ingo, who is a co-maintainer of trace stuff.
Hi Ingo,
If you could review/approve the patch, that would be very helpful, as this is a build breaker fix.
Please see the link below for more context:
Most recent (v3) patch posting:
https://lore.kernel.org/linux-scsi/[email protected]/
Steve suggesting to take the patch via SCSI tree:
https://lore.kernel.org/linux-scsi/[email protected]/
Regards,
-Arun
Quoted 26 lines · Martin K. Petersen
External Email
----------------------------------------------------------------------
Steven,
Can you please review Arun's patch?
Quoted 16 lines
Fix this compilation error seen when
CONFIG_TRACINGis 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); | ^~~~~~~~~~~~~~~
Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
In reply to Martin K. PetersenQuoted 3 lines · On Thu, 15 Sep 2022 21:32:59 -0400 "Martin K. Petersen"…
Steven,
Can you please review Arun's patch?
Sorry, was busy running a conference ;-)
Quoted 11 lines
Quoted 11 lines
Fix this compilation error seen when
CONFIG_TRACINGis 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
Quoted 7 lines
Quoted 6 lines
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); | ^~~~~~~~~~~~~~~
The patch looks good to me.
-- Steve
Re: [EXT] Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
Thanks for the review, Steve.
Regards,
-Arun
Quoted 37 lines · Steven Rostedt
External Email
----------------------------------------------------------------------
Quoted 3 lines · On Thu, 15 Sep 2022 21:32:59 -0400 "Martin K. Petersen"…
Steven,
Can you please review Arun's patch?
Sorry, was busy running a conference ;-)
Quoted 11 lines
Quoted 11 lines
Fix this compilation error seen when
CONFIG_TRACINGis 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_eventQuoted 7 lines
Quoted 6 lines
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); | ^~~~~~~~~~~~~~~The patch looks good to me.
Reviewed-by Steven Rostedt (Google) <[email protected]>-- Steve