* [PATCH v3 0/1] Tracing: Compile error with qla2xxx @ 2022-09-07 23:33 Arun Easi 2022-09-07 23:33 ` [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Arun Easi 0 siblings, 1 reply; 8+ messages in thread From: Arun Easi @ 2022-09-07 23:33 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. 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(-) -- 2.9.5 base-commit: efca52749564601de2045eb71dbe756b7bade4e8 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled 2022-09-07 23:33 [PATCH v3 0/1] Tracing: Compile error with qla2xxx Arun Easi @ 2022-09-07 23:33 ` Arun Easi 2022-09-08 16:55 ` Bart Van Assche 2022-09-16 1:32 ` Martin K. Petersen 0 siblings, 2 replies; 8+ messages in thread From: Arun Easi @ 2022-09-07 23:33 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 | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/include/linux/trace.h b/include/linux/trace.h index bf16961..b5e16e4 100644 --- a/include/linux/trace.h +++ b/include/linux/trace.h @@ -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 */ -- 2.9.5 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled 2022-09-07 23:33 ` [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Arun Easi @ 2022-09-08 16:55 ` Bart Van Assche 2022-09-08 19:12 ` [EXT] " Arun Easi 2022-09-16 1:32 ` Martin K. Petersen 1 sibling, 1 reply; 8+ messages in thread From: Bart Van Assche @ 2022-09-08 16:55 UTC (permalink / raw) To: Arun Easi, Steven Rostedt, Martin Petersen, Sudip Mukherjee, James Bottomley, linux-scsi, linux-kernel, linux-next, GR-QLogic-Storage-Upstream On 9/7/22 16:33, Arun Easi wrote: > diff --git a/include/linux/trace.h b/include/linux/trace.h > index bf16961..b5e16e4 100644 > --- a/include/linux/trace.h > +++ b/include/linux/trace.h > @@ -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 */ 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. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [EXT] Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled 2022-09-08 16:55 ` Bart Van Assche @ 2022-09-08 19:12 ` Arun Easi 0 siblings, 0 replies; 8+ messages in thread From: Arun Easi @ 2022-09-08 19:12 UTC (permalink / raw) To: Bart Van Assche, Steven Rostedt Cc: Martin Petersen, Sudip Mukherjee, James Bottomley, linux-scsi, linux-kernel, linux-next, GR-QLogic-Storage-Upstream On Thu, 8 Sep 2022, 9:55am, Bart Van Assche wrote: > > ---------------------------------------------------------------------- > On 9/7/22 16:33, Arun Easi wrote: > > diff --git a/include/linux/trace.h b/include/linux/trace.h > > index bf16961..b5e16e4 100644 > > --- a/include/linux/trace.h > > +++ b/include/linux/trace.h > > @@ -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 */ > > 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled 2022-09-07 23:33 ` [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Arun Easi 2022-09-08 16:55 ` Bart Van Assche @ 2022-09-16 1:32 ` Martin K. Petersen 2022-09-16 21:22 ` [EXT] " Arun Easi 2022-09-22 21:02 ` Steven Rostedt 1 sibling, 2 replies; 8+ messages in thread From: Martin K. Petersen @ 2022-09-16 1:32 UTC (permalink / raw) To: Steven Rostedt Cc: Arun Easi, Martin Petersen, Sudip Mukherjee, James Bottomley, linux-scsi, linux-kernel, linux-next, GR-QLogic-Storage-Upstream Steven, Can you please review Arun's patch? > 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); > | ^~~~~~~~~~~~~~~ > -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [EXT] Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled 2022-09-16 1:32 ` Martin K. Petersen @ 2022-09-16 21:22 ` Arun Easi 2022-09-22 21:02 ` Steven Rostedt 1 sibling, 0 replies; 8+ messages in thread From: Arun Easi @ 2022-09-16 21:22 UTC (permalink / raw) To: Ingo Molnar, Martin K. Petersen Cc: Steven Rostedt, Sudip Mukherjee, James Bottomley, linux-scsi, linux-kernel, linux-next, GR-QLogic-Storage-Upstream 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/20220907233308.4153-2-aeasi@marvell.com/ Steve suggesting to take the patch via SCSI tree: https://lore.kernel.org/linux-scsi/20220906174140.41b46a5f@gandalf.local.home/ Regards, -Arun On Thu, 15 Sep 2022, 6:32pm, Martin K. Petersen wrote: > External Email > > ---------------------------------------------------------------------- > > Steven, > > Can you please review Arun's patch? > > > 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); > > | ^~~~~~~~~~~~~~~ > > > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled 2022-09-16 1:32 ` Martin K. Petersen 2022-09-16 21:22 ` [EXT] " Arun Easi @ 2022-09-22 21:02 ` Steven Rostedt 2022-09-22 22:34 ` [EXT] " Arun Easi 1 sibling, 1 reply; 8+ messages in thread From: Steven Rostedt @ 2022-09-22 21:02 UTC (permalink / raw) To: Martin K. Petersen Cc: Arun Easi, Sudip Mukherjee, James Bottomley, linux-scsi, linux-kernel, linux-next, GR-QLogic-Storage-Upstream On Thu, 15 Sep 2022 21:32:59 -0400 "Martin K. Petersen" <martin.petersen@oracle.com> wrote: > Steven, > > Can you please review Arun's patch? Sorry, was busy running a conference ;-) > > > 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); > > | ^~~~~~~~~~~~~~~ > > > The patch looks good to me. Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> -- Steve ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [EXT] Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled 2022-09-22 21:02 ` Steven Rostedt @ 2022-09-22 22:34 ` Arun Easi 0 siblings, 0 replies; 8+ messages in thread From: Arun Easi @ 2022-09-22 22:34 UTC (permalink / raw) To: Steven Rostedt Cc: Martin K. Petersen, Sudip Mukherjee, James Bottomley, linux-scsi, linux-kernel, linux-next, GR-QLogic-Storage-Upstream Thanks for the review, Steve. Regards, -Arun On Thu, 22 Sep 2022, 2:02pm, Steven Rostedt wrote: > External Email > > ---------------------------------------------------------------------- > On Thu, 15 Sep 2022 21:32:59 -0400 > "Martin K. Petersen" <martin.petersen@oracle.com> wrote: > > > Steven, > > > > Can you please review Arun's patch? > > Sorry, was busy running a conference ;-) > > > > > > 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); > > > | ^~~~~~~~~~~~~~~ > > > > > > > The patch looks good to me. > > Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> > > -- Steve > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-09-22 22:35 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-09-07 23:33 [PATCH v3 0/1] Tracing: Compile error with qla2xxx Arun Easi 2022-09-07 23:33 ` [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled Arun Easi 2022-09-08 16:55 ` Bart Van Assche 2022-09-08 19:12 ` [EXT] " Arun Easi 2022-09-16 1:32 ` Martin K. Petersen 2022-09-16 21:22 ` [EXT] " Arun Easi 2022-09-22 21:02 ` Steven Rostedt 2022-09-22 22:34 ` [EXT] " Arun Easi
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.