From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965289AbcHDTMI (ORCPT ); Thu, 4 Aug 2016 15:12:08 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:32485 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964796AbcHDTMG (ORCPT ); Thu, 4 Aug 2016 15:12:06 -0400 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: aravinda@linux.vnet.ibm.com Subject: Re: [RFC PATCH v2 0/3] perf/tracefs: Container-aware tracing support To: "Eric W. Biederman" References: <146965470618.23765.7329786743211962695.stgit@hbathini.in.ibm.com> <87twf1ck95.fsf@x220.int.ebiederm.org> <57A355C1.4090004@linux.vnet.ibm.com> <87h9b01ja2.fsf@x220.int.ebiederm.org> Cc: Hari Bathini , daniel@iogearbox.net, peterz@infradead.org, linux-kernel@vger.kernel.org, acme@kernel.org, alexander.shishkin@linux.intel.com, mingo@redhat.com, paulus@samba.org, kernel@kyup.com, rostedt@goodmis.org, viro@zeniv.linux.org.uk, ananth@in.ibm.com, Linux Containers From: Aravinda Prasad Date: Fri, 5 Aug 2016 00:41:47 +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: <87h9b01ja2.fsf@x220.int.ebiederm.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16080419-0028-0000-0000-0000054F0AC0 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005548; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000178; SDB=6.00740007; UDB=6.00347996; IPR=6.00512605; BA=6.00004644; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012160; XFM=3.00000011; UTC=2016-08-04 19:12:04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16080419-0029-0000-0000-00002E1C761D Message-Id: <57A39373.5070803@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-04_11:,, 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-1608040209 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 04 August 2016 11:57 PM, Eric W. Biederman wrote: > Aravinda Prasad writes: > >> On Thursday 04 August 2016 08:29 AM, Eric W. Biederman wrote: >>> Hari Bathini writes: >>> >>>> This RFC patch set supports filtering container specific events >>>> when perf tool is executed inside a container. The patches apply >>>> cleanly on v4.7.0-rc7 >>>> >>>> Changes from v1: >>>> 1/3. Revived earlier approach[1] with cgroup namespace instead >>>> of pid namespace >>>> 2/3. New patch that adds instance support for uprobe events in >>>> tracefs filesystem >>>> 3/3. New patch that adds "newinstance" mount option for tracefs >>>> filesystem >>> "newinstace" ick no. >>> >>> I see no justification anywhere why the perf cgroup is not enough for >>> this. >> >> perf cgroup is not enough for uprobes, because even with perf cgroups a >> user within a container can still list/delete uprobes registered in >> other containers. > > Just to be clear, even if there is one cgroup per container? Yes. Uprobes with perf is two steps. First step is to define/add the probe (for example: "perf probe /bin/zsh zfree"), which does not require cgroup argument. Adding a probe writes an entry in /sys/kernel/debug/tracing/uprobe_events file. uprobes_events file is shared and hence users in other container can list/delete these entries. Once added, the second step is to record. We can record by specifying the cgroup argument with perf record and the events are filtered out based on the cgroup. The problem with the first step is handled (in patch 2 and 3) by creating a separate uprobes_events file per-container by exploiting already existing "instances" functionality. Regards, Aravinda > > Eric > -- Regards, Aravinda