Messages in this thread | | | Date | Mon, 29 Feb 2016 13:23:20 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH 1/1] perf/core: find auxiliary events in running pmus list |
| |
On Sun, Feb 28, 2016 at 04:31:49PM +0000, Liang, Kan wrote: > > static void account_pmu_sb_event(struct perf_event *event) { > > if (event->parent) > > return; > > > > if (event->attach & ATTACH_TASK) > > return;
^^^^ this
> > if (event->attr.mmap || event->attr.mmap_data || event->attr.mmap2) > > attach_sb_event(event, sb_mmap); > > > > if (event->attr.comm || event->attr.comm_exec) > > attach_sb_event(event, sb_comm); > > > > if (event->attr.task) > > attach_sb_event(event, sb_task); > > > > if (event->attr.context_switch) > > attach_sb_event(event, sb_switch); > > }
> > And then you can replace the whole global part of perf_event_aux (which I > > would rename to perf_event_sb), with this. > > > > You still have to do something like: > > > > for_each_task_context_nr(ctxn) { > > ctx = rcu_dereference(current->perf_event_ctxp[ctxn]); > > if (!ctx) > > continue; > > perf_event_sb_ctx(ctx, output, data); > > } > > > > I'm not sure why we need something like for_each_task_context_nr(ctxn) in > perf_event_aux/perf_event_sb. > Isn't perf_event_sb_mask enough? > It looks perf_event_sb_mask will go through all possible interested events > (includes both per cpu and per task events).
See sites marked "^^^ this"
This stuff explicitly does not handle task events, because of the below:
> > To get at the per task events, because I don't think we want to go update > > more global state on context switch, nor am I entirely sure its worth it to > > keep per sb ctx->event_list[]s.
^^^ this
| |