mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Bristot de Oliveira <bristot@redhat.com>
To: Jackie Liu <liu.yun@linux.dev>, rostedt@goodmis.org, mingo@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] tracing: fix missing osnoise tracer on max_latency
Date: Wed, 22 Sep 2021 12:05:38 +0200	[thread overview]
Message-ID: <1bd5f7fe-5f55-5bcf-7fa5-a52c62127994@redhat.com> (raw)
In-Reply-To: <20210922025122.3268022-1-liu.yun@linux.dev>

On 9/22/21 4:51 AM, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
> 
> The compiler warns when the data are actually unused:
> 
>   kernel/trace/trace.c:1712:13: error: ‘trace_create_maxlat_file’ defined but not used [-Werror=unused-function]
>    1712 | static void trace_create_maxlat_file(struct trace_array *tr,
>         |             ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> [Why]
> CONFIG_HWLAT_TRACER=n, CONFIG_TRACER_MAX_TRACE=n, CONFIG_OSNOISE_TRACER=y
> gcc report warns.
> 
> [How]
> Now trace_create_maxlat_file will only take effect when
> CONFIG_HWLAT_TRACER=y or CONFIG_TRACER_MAX_TRACE=y. In fact, after
> adding osnoise trace, it also needs to take effect.
> 
> Fixes: bce29ac9ce0b ("trace: Add osnoise tracer")
> Cc: Daniel Bristot de Oliveira <bristot@redhat.com>

Reviewed-by: Daniel Bristot de Oliveira <bristot@kernel.org>

Thanks!
-- Daniel
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
> ---
>  kernel/trace/trace.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 7896d30d90f7..bc677cd64224 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -1744,16 +1744,15 @@ void latency_fsnotify(struct trace_array *tr)
>  	irq_work_queue(&tr->fsnotify_irqwork);
>  }
>  
> -/*
> - * (defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)) && \
> - *  defined(CONFIG_FSNOTIFY)
> - */
> -#else
> +#elif defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)	\
> +	|| defined(CONFIG_OSNOISE_TRACER)
>  
>  #define trace_create_maxlat_file(tr, d_tracer)				\
>  	trace_create_file("tracing_max_latency", 0644, d_tracer,	\
>  			  &tr->max_latency, &tracing_max_lat_fops)
>  
> +#else
> +#define trace_create_maxlat_file(tr, d_tracer)	 do { } while (0)
>  #endif
>  
>  #ifdef CONFIG_TRACER_MAX_TRACE
> @@ -9473,9 +9472,7 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer)
>  
>  	create_trace_options_dir(tr);
>  
> -#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
>  	trace_create_maxlat_file(tr, d_tracer);
> -#endif
>  
>  	if (ftrace_create_function_files(tr, d_tracer))
>  		MEM_FAIL(1, "Could not allocate function filter files");
> 


      reply	other threads:[~2021-09-22 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22  2:51 Jackie Liu
2021-09-22 10:05 ` Daniel Bristot de Oliveira [this message]

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=1bd5f7fe-5f55-5bcf-7fa5-a52c62127994@redhat.com \
    --to=bristot@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.yun@linux.dev \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /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®