From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933888AbcKOMV3 (ORCPT ); Tue, 15 Nov 2016 07:21:29 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44808 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932335AbcKOMV1 (ORCPT ); Tue, 15 Nov 2016 07:21:27 -0500 Subject: Re: [PATCH 0/3] perf: add support for analyzing events for containers To: "Eric W. Biederman" References: <147877784354.29988.8570048236764105701.stgit@hbathini.in.ibm.com> <87a8d7m805.fsf@xmission.com> Cc: ast@fb.com, peterz@infradead.org, lkml , acme@kernel.org, alexander.shishkin@linux.intel.com, mingo@redhat.com, daniel@iogearbox.net, rostedt@goodmis.org, Ananth N Mavinakayanahalli , sargun@sargun.me, Aravinda Prasad , brendan.d.gregg@gmail.com From: Hari Bathini Date: Tue, 15 Nov 2016 17:51:09 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87a8d7m805.fsf@xmission.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111512-0044-0000-0000-00000200D7C3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111512-0045-0000-0000-000005F82B16 Message-Id: <7f1d2f36-7bfc-dc97-0de8-f8a3203ca26e@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-15_04:,, 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-1609300000 definitions=main-1611150224 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 11 November 2016 01:18 AM, Eric W. Biederman wrote: > Hari Bathini writes: > >> Currently, there is no trivial mechanism to analyze events based on >> containers. perf -G can be used, but it will not filter events for the >> containers created after perf is invoked, making it difficult to assess/ >> analyze performance issues of multiple containers at once. >> >> This patch-set overcomes this limitation by using cgroup identifier as >> container unique identifier. A new PERF_RECORD_NAMESPACES event that >> records namespaces related info is introduced, from which the cgroup >> namespace's inode number is used as cgroup identifier. This is based >> on the assumption that each container is created with it's own cgroup >> namespace allowing assessment/analysis of multiple containers using >> cgroup identifier. >> >> The first patch introduces PERF_RECORD_NAMESPACES in kernel while the >> second patch makes the corresponding changes in perf tool to read this >> PERF_RECORD_NAMESPACES events. The third patch adds a cgroup identifier >> column in perf report, which is nothing but the cgroup namespace's >> inode number. This approach is based on the suggestion from Peter >> Zijlstra here: https://patchwork.kernel.org/patch/9305655/ > Where is the check that ensures that only the someone with > capable(CAP_SYS_ADMIN) can use this interface. This interface is not > namespace clean in multiple dimensions so it can not be used generally? Right. Will add the check.. > You are not allowed to move struct mount_namespace into > include/linux/mnt_namespace.h. Al Viro will crucify you with cause. > Those are implementation details the rest of the kernel should not be > digging into. Ouch! How about adding an accessor function(s) in fs/namespace.c ..? > Where are the device numbers that go with those inode numbers you are > exporting? For now all of those inodes live on the filesystem but I am > not giving guarantees to userspace that do not work for ordinary > filesystems. Sorry! I didn't get this.. Want to use these numbers as identity for namespace (like pid for process..) Thanks Hari