All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Jackie Liu <liu.yun@linux.dev>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, bristot@redhat.com
Subject: Re: [PATCH] tracing: fix missing osnoise tracer on max_latency
Date: Tue, 21 Sep 2021 22:40:48 -0400	[thread overview]
Message-ID: <20210921224048.4c5b414d@oasis.local.home> (raw)
In-Reply-To: <650206a9-500d-2dcf-69d1-946c470dac25@linux.dev>

On Wed, 22 Sep 2021 10:26:24 +0800
Jackie Liu <liu.yun@linux.dev> wrote:

> >> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> >> index 7896d30d90f7..d7e3ed82fafd 100644
> >> --- a/kernel/trace/trace.c
> >> +++ b/kernel/trace/trace.c
> >> @@ -1744,11 +1744,7 @@ 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
> >> +#else /* LATENCY_FS_NOTIFY  >>
> >>   #define trace_create_maxlat_file(tr, d_tracer)				\
> >>   	trace_create_file("tracing_max_latency", 0644, d_tracer,	\  
> > 
> > To clean this up even better, we should add here:
> > 
> > #elif defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) \
> > 	|| defined(CONFIG_OSNOISE_TRACER)  
> 
> This place should need to use LATENCY_FS_NOTIFY, because not only these
> three Traces, we also need to pay attention to CONFIG_FSNOTIFY, at
> least, we should not change the original meaning.
> 
> How about this:
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 7896d30d90f7..6a88d03c6d3b 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -1744,16 +1744,14 @@ 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(LATENCY_FS_NOTIFY)

Um, but isn't the #if before the #else:

  #ifdef LATENCY_FS_NOTIFY

?

Then, here we have:


#ifdef LATENCY_FS_NOTIFY

[..]

#elif defined(LATENCY_FS_NOTIFY)

// this will never be called.

That doesn't make any sense.

-- Steve

> 
>   #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 +9471,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");
> 
> 
> ==
> What do you think? If there is no problem, I will send V2.
> 

  reply	other threads:[~2021-09-22  2:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-18  5:11 [PATCH] tracing: fix missing osnoise tracer on max_latency Jackie Liu
2021-09-19 16:01 ` Steven Rostedt
2021-09-22  2:26   ` Jackie Liu
2021-09-22  2:40     ` Steven Rostedt [this message]
2021-09-22  2:45       ` Jackie Liu

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=20210921224048.4c5b414d@oasis.local.home \
    --to=rostedt@goodmis.org \
    --cc=bristot@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.yun@linux.dev \
    --cc=mingo@redhat.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 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.