From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752363AbcF1Lla (ORCPT ); Tue, 28 Jun 2016 07:41:30 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38494 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbcF1Ll0 (ORCPT ); Tue, 28 Jun 2016 07:41:26 -0400 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: aravinda@linux.vnet.ibm.com Subject: Re: [RFC PATCH 2/2] perf: Filter events based on perf-namespace To: Peter Zijlstra References: <20160614164530.4192.79560.stgit@aravindap> <20160614164951.4192.66724.stgit@aravindap> <20160627155002.GD30909@twins.programming.kicks-ass.net> 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 From: Aravinda Prasad Date: Tue, 28 Jun 2016 17:09:38 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160627155002.GD30909@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062811-8235-0000-0000-000008AF5A13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062811-8236-0000-0000-000032A2241F Message-Id: <577261FA.1020108@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-28_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606280109 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > Yes.. that seems possible. Let me check that out. -- Regards, Aravinda