From: Bart Van Assche <bvanassche@acm.org>
To: Arun Easi <aeasi@marvell.com>,
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
Subject: Re: [PATCH v3 1/1] tracing: Fix compile error in trace_array calls when TRACING is disabled
Date: Thu, 8 Sep 2022 09:55:48 -0700 [thread overview]
Message-ID: <28bd97af-2932-f75e-ecf5-6c5e42f8d7ad@acm.org> (raw)
In-Reply-To: <20220907233308.4153-2-aeasi@marvell.com>
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.
next prev parent reply other threads:[~2022-09-08 16:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=28bd97af-2932-f75e-ecf5-6c5e42f8d7ad@acm.org \
--to=bvanassche@acm.org \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=aeasi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®