Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933891AbcLPS1O (ORCPT ); Fri, 16 Dec 2016 13:27:14 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34308 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933253AbcLPS0z (ORCPT ); Fri, 16 Dec 2016 13:26:55 -0500 Subject: Re: [PATCH v4 0/3] perf: add support for analyzing events for containers To: Alban Crequy References: Cc: ananth@in.ibm.com, daniel@iogearbox.net, Linux Containers , "linux-kernel@vger.kernel.org" , acme@kernel.org, alexander.shishkin@linux.intel.com, mingo@redhat.com, paulus@samba.org, rostedt@goodmis.org, aravinda@linux.vnet.ibm.com, kernel@kyup.com, Alexander Viro , "Eric W. Biederman" From: Hari Bathini Date: Fri, 16 Dec 2016 23:56:40 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16121618-0048-0000-0000-000001EDF172 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16121618-0049-0000-0000-00004731D603 Message-Id: <52383a1b-39aa-c9db-89bc-2dba5369489b@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-16_10:,, 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-1612050000 definitions=main-1612160277 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1628 Lines: 39 Hi Alban, On Friday 16 December 2016 05:44 PM, Alban Crequy wrote: > Hi, > >> 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 device & inode numbers are 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 contains the cgroup namespace's device and >> inode numbers. > I have a question for the pid namespace: does the new perf event gives > the pid namespace of the task, or the pid_ns_for_children from the > nsproxy? From my limited understanding, v4 seems to do the former, as > opposed to v3. Ah! How did I miss that?! > When synthesizing events from /proc/$PID/ns/pid, it cannot take the > pid_ns_for_children, so I wanted to make sure it is consistent. > So, eventually this version sounds like the right way of doing it..? Thanks Hari