lkml.org 
[lkml]   [2010]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/10] perf, trace: Use per-tracepoint-per-cpu hlist to track events
From
Date
On Fri, 2010-05-21 at 10:04 -0400, Steven Rostedt wrote:
> On Fri, 2010-05-21 at 11:02 +0200, Peter Zijlstra wrote:
> > plain text document attachment (perf-trace-per-cpu-fold.patch)
> > Avoid the swevent hash-table by using per-tracepoint hlists.
> >
> > Also, avoid conditionals on the fast path by ordering with probe unregister
> > so that we should never get on the callback path without the data being there.
> >
>
> > -void perf_trace_disable(int event_id)
> > +void perf_trace_destroy(struct perf_event *p_event)
> > {
> > - struct ftrace_event_call *event;
> > + struct ftrace_event_call *tp_event = p_event->tp_event;
> > + int i;
> >
> > - mutex_lock(&event_mutex);
> > - list_for_each_entry(event, &ftrace_events, list) {
> > - if (event->id == event_id) {
> > - perf_trace_event_disable(event);
> > - module_put(event->mod);
> > - break;
> > + if (--tp_event->perf_refcount > 0)
> > + return;
> > +
>
> You remove the event_mutex and then update the tp_event->perf_refcount
> without any protection.
>
> That tp_event->perf_refcount is global to the event not to the perf
> event.

Oh, bugger, yes. I seem to have lost it on destroy..

Thanks!



\
 
 \ /
  Last update: 2010-05-21 16:21    [W:0.373 / U:2.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site