lkml.org 
[lkml]   [2020]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] tracing: Skip software disabled event at __synth_event_trace_end()
From
Date
Hi Masami,

You're right, this is a bug, thanks for sending the patch to fix it.

Tom

Reviewed-by: Tom Zanussi <zanussi@kernel.org>


On Wed, 2020-02-12 at 14:54 +0900, Masami Hiramatsu wrote:
> When the synthetic event is software disabled,
> __synth_event_trace_start() does not allocate an event buffer.
> In this case __synth_event_trace_end() also should not commit
> the buffer.
>
> Check the trace_state->disabled at __synth_event_trace_end()
> and if it is disabled, skip it.
>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> kernel/trace/trace_events_hist.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/trace/trace_events_hist.c
> b/kernel/trace/trace_events_hist.c
> index 483b3fd1094f..781e4b55e117 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -1847,6 +1847,9 @@ __synth_event_trace_start(struct
> trace_event_file *file,
> static inline void
> __synth_event_trace_end(struct synth_event_trace_state *trace_state)
> {
> + if (trace_state->disabled)
> + return;
> +
> trace_event_buffer_commit(&trace_state->fbuffer);
>
> ring_buffer_nest_end(trace_state->buffer);
>

\
 
 \ /
  Last update: 2020-02-12 17:04    [W:0.062 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site