From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751896AbcF0PuP (ORCPT ); Mon, 27 Jun 2016 11:50:15 -0400 Received: from merlin.infradead.org ([205.233.59.134]:53405 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751385AbcF0PuO (ORCPT ); Mon, 27 Jun 2016 11:50:14 -0400 Date: Mon, 27 Jun 2016 17:50:02 +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, 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 Message-ID: <20160627155002.GD30909@twins.programming.kicks-ass.net> References: <20160614164530.4192.79560.stgit@aravindap> <20160614164951.4192.66724.stgit@aravindap> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160614164951.4192.66724.stgit@aravindap> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.