lkml.org 
[lkml]   [2013]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] tracing/kprobes: Kill probe_enable_lock
On 06/17, Masami Hiramatsu wrote:
>
> (2013/06/17 2:21), Oleg Nesterov wrote:
> > enable_trace_probe() and disable_trace_probe() should not worry about
> > serialization, the caller (perf_trace_init or __ftrace_set_clr_event)
> > holds event_mutex.
> >
> > They are also called by kprobe_trace_self_tests_init(), but this __init
> > function can't race with itself or trace_events.c
>
> Right,
> For safety, we should comment this at the caller side,

Which caller do you mean?

The patch adds

/*
* This and enable_trace_probe/disable_trace_probe rely on event_mutex
* held by the caller, __ftrace_set_clr_event().
*/

above trace_probe_nr_files() but the next patch removes this function
with the comment...

Will you agree with this patch if I add something like

/*
* called by perf_trace_init() or __ftrace_set_clr_event() under event_mutex
*/

above kprobe_register() ? Perhaps it makes sense to add
lockdep_assert_held(&event_mutex) into the body?

And:

> because
> those calls are the reason why I have introduced this lock.

Please do not hesitate to nack this patch if you think that we should
keep probe_enable_lock for safety even if it is not currently needed.
In this case I'd suggest to move lock/unlock into kprobe_register()
but this is minor.

Oleg.



\
 
 \ /
  Last update: 2013-06-17 18:41    [W:0.054 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site