From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753944AbcIBNzz (ORCPT ); Fri, 2 Sep 2016 09:55:55 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39340 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753892AbcIBNzx (ORCPT ); Fri, 2 Sep 2016 09:55:53 -0400 X-IBM-Helo: d28dlp01.in.ibm.com X-IBM-MailFrom: hbathini@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] perf: add container identifier entry in perf sample data To: Peter Zijlstra References: <147257440426.24873.5447719305627561023.stgit@hbathini.in.ibm.com> <20160901090941.GO10153@twins.programming.kicks-ass.net> Cc: ast@fb.com, lkml , acme@kernel.org, alexander.shishkin@linux.intel.com, mingo@redhat.com, daniel@iogearbox.net, rostedt@goodmis.org, Ananth N Mavinakayanahalli , ebiederm@xmission.com, sargun@sargun.me, Aravinda Prasad , brendan.d.gregg@gmail.com From: Hari Bathini Date: Fri, 2 Sep 2016 19:25:31 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160901090941.GO10153@twins.programming.kicks-ass.net> 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: 16090213-0016-0000-0000-000003142EAF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16090213-0017-0000-0000-000025EC69C8 Message-Id: <58edcf4e-80d4-3b0e-773d-29d28070392d@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-02_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-1604210000 definitions=main-1609020186 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 01 September 2016 02:39 PM, Peter Zijlstra wrote: > On Tue, Aug 30, 2016 at 09:57:02PM +0530, Hari Bathini wrote: >> Currently, there is no mechanism to filter 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 limitation can >> be overcome, if there is a standard kernel identifier for containers. >> >> This patch introduces a container identifier entry field in perf sample >> data to identify or distinguish sample data of different containers. It >> uses the cgroup namespace inode number of a given task as it's container >> identifier (cid). Alternatively, inode number of pid namespace can also >> be used as cid. This patch assumes each container is created with it's >> own cgroup namespace. Hi Peter, > I'm thinking this value is mostly the same for tasks, just like COMM and I think so, too. Namespaces aren't changed that often for tasks... > MMAP. Could we therefore not emit (sideband) events whenever a task > changes namespace and get the same information but with tons less data? You mean, something like PERF_RECORD_NAMESPACE that emits events on fork, clone, setns..? > That also gives the possibility of recording all namespaces, not just > the one. True. If we record all namespaces, container identifier interpretation can be left to the userspace to decide, which is much more flexible... Thanks Hari