Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345751

Re: [PATCH 1/1] perf/core: find auxiliary events in running pmus list

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] perf/core: find auxiliary events in running pmus list
Date 2016-02-29 13:30 +0100
Message-ID <r7v7B-2Wa-39@gated-at.bofh.it> (permalink)
References <r5Paq-1Zh-13@gated-at.bofh.it> <r6nYu-1Np-37@gated-at.bofh.it> <r7cxX-5gk-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] perf/core: find auxiliary events in running pmus list kan.liang@intel.com - 2016-02-24 22:30 +0100
  Re: [PATCH 1/1] perf/core: find auxiliary events in running pmus list Peter Zijlstra <peterz@infradead.org> - 2016-02-25 09:20 +0100
  Re: [PATCH 1/1] perf/core: find auxiliary events in running pmus list Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-02-25 14:30 +0100
    RE: [PATCH 1/1] perf/core: find auxiliary events in running pmus  list "Liang, Kan" <kan.liang@intel.com> - 2016-02-25 16:40 +0100
  Re: [PATCH 1/1] perf/core: find auxiliary events in running pmus list Peter Zijlstra <peterz@infradead.org> - 2016-02-26 11:40 +0100
    RE: [PATCH 1/1] perf/core: find auxiliary events in running pmus  list "Liang, Kan" <kan.liang@intel.com> - 2016-02-28 17:40 +0100
      Re: [PATCH 1/1] perf/core: find auxiliary events in running pmus list Peter Zijlstra <peterz@infradead.org> - 2016-02-29 13:30 +0100

csiph-web