linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, rostedt@goodmis.org,
	mingo@redhat.com, paulus@samba.org, acme@kernel.org,
	ebiederm@xmission.com, hbathini@linux.vnet.ibm.com,
	ananth@in.ibm.com
Subject: Re: [RFC PATCH 2/2] perf: Filter events based on perf-namespace
Date: Tue, 12 Jul 2016 13:47:34 +0200	[thread overview]
Message-ID: <20160712114734.GL30154@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <5784B7B9.5020901@linux.vnet.ibm.com>

On Tue, Jul 12, 2016 at 02:56:17PM +0530, Aravinda Prasad wrote:
> 
> 
> On Monday 27 June 2016 09:20 PM, Peter Zijlstra wrote:
> > On Tue, Jun 14, 2016 at 10:19:51PM +0530, Aravinda Prasad wrote:
> >> Whenever perf tool is executed inside a container, this
> >> patch restricts the events to the perf-namespace in which
> >> the perf tool is executing.
> >>
> >> This patch is based on the existing support available
> >> for tracing with cgroups.
> >>
> >> TODO:
> >>     - Avoid code duplication.
> > 
> > Can't you, at perf_event_open() time, convert a per-cpu event into a
> > per-cpu-per-cgroup event for these namespace thingies?
> > 
> > That seems to immediately and completely remove all that duplication.
> 
> Sorry for the delay in the response.
> 
> I was looking into a way how a per-cpu event can be converted to
> per-cpu-per-cgroup event at perf_event_open() but could not figure out
> how to do this conversion. The cgroup event expects the fd of the cgroup
> directory in cgroupfs and in this case we don't have any fd passed in.
> Not sure if I am missing anything.

Would not the current namespace have a link to the correct cgroup?
Wasn't that the entire point of the namespace thing?

  reply	other threads:[~2016-07-12 11:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 16:49 [RFC PATCH 0/2] perf: Container-aware tracing support Aravinda Prasad
2016-06-14 16:49 ` [RFC PATCH 1/2] perf/namespaces: Add a new namespace for isolated tracing Aravinda Prasad
2016-06-14 16:49 ` [RFC PATCH 2/2] perf: Filter events based on perf-namespace Aravinda Prasad
2016-06-27 15:50   ` Peter Zijlstra
2016-06-28 11:39     ` Aravinda Prasad
2016-07-12  9:26     ` Aravinda Prasad
2016-07-12 11:47       ` Peter Zijlstra [this message]
2016-07-12 12:41         ` Nikolay Borisov
2016-07-12 13:04           ` Peter Zijlstra
2016-07-12 13:55             ` Eric W. Biederman
2016-07-12 14:27               ` Peter Zijlstra
2016-07-12 16:04                 ` Aravinda Prasad
2016-07-12 16:19             ` Aravinda Prasad

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=20160712114734.GL30154@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=ananth@in.ibm.com \
    --cc=aravinda@linux.vnet.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=rostedt@goodmis.org \
    /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;
as well as URLs for NNTP newsgroup(s).