From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757647AbbGQKT7 (ORCPT ); Fri, 17 Jul 2015 06:19:59 -0400 Received: from casper.infradead.org ([85.118.1.10]:48477 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757352AbbGQKT5 (ORCPT ); Fri, 17 Jul 2015 06:19:57 -0400 Date: Fri, 17 Jul 2015 12:19:50 +0200 From: Peter Zijlstra To: Aravinda Prasad Cc: linux-kernel@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, paulus@samba.org, acme@kernel.org, hbathini@linux.vnet.ibm.com, ananth@in.ibm.com Subject: Re: [RFC PATCH] perf: Container-aware tracing support Message-ID: <20150717101950.GS3644@twins.programming.kicks-ass.net> References: <20150715090836.16376.80760.stgit@aravindap> <20150715124741.GL2859@worktop.programming.kicks-ass.net> <55A688A0.7070507@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55A688A0.7070507@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2015 at 09:51:52PM +0530, Aravinda Prasad wrote: > >> + } else if (task_active_pid_ns(current) != &init_pid_ns) { > > > > Why the pid namespace? > > This comes from my understanding of container -- having at least a > separate PID namespace with processes inside a container grouped into a > single perf_event cgroups subsystem. > > I know there are other ways to define a container, however, I thought I > start with the above one. Right, but you should at least mention this, preferably in a comment. > > > >> + /* Don't set event->cgrp if task belongs to root cgroup */ > >> + if (task_css_is_root(current, perf_event_cgrp_id)) > >> + return ret; > > > > So if you have the root perf_cgroup inside your container you can > > escape? > > If we have root perf_cgroup inside the container then even if we set > event->cgrp we will be including all processes in the system. Yes, that's what I said. Why does that make sense?