public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	"eranian@google.com" <eranian@google.com>,
	"vincent.weaver@maine.edu" <vincent.weaver@maine.edu>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@kernel.org" <mingo@kernel.org>,
	"acme@redhat.com" <acme@redhat.com>,
	"jolsa@redhat.com" <jolsa@redhat.com>,
	"ying.huang@linux.intel.com" <ying.huang@linux.intel.com>,
	"alexander.shishkin@linux.intel.com" 
	<alexander.shishkin@linux.intel.com>
Subject: Re: [PATCH 1/1] perf/core: find auxiliary events in running pmus list
Date: Mon, 29 Feb 2016 13:23:20 +0100	[thread overview]
Message-ID: <20160229122320.GL6356@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F0770589E368@SHSMSX103.ccr.corp.intel.com>

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

      reply	other threads:[~2016-02-29 12:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 21:20 [PATCH 1/1] perf/core: find auxiliary events in running pmus list kan.liang
2016-02-25  8:17 ` Peter Zijlstra
2016-02-25 13:29 ` Alexander Shishkin
2016-02-25 15:38   ` Liang, Kan
2016-02-26 10:36 ` Peter Zijlstra
2016-02-28 16:31   ` Liang, Kan
2016-02-29 12:23     ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160229122320.GL6356@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.weaver@maine.edu \
    --cc=ying.huang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox