From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753967AbcIAJJ6 (ORCPT ); Thu, 1 Sep 2016 05:09:58 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:41921 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbcIAJJy (ORCPT ); Thu, 1 Sep 2016 05:09:54 -0400 Date: Thu, 1 Sep 2016 11:09:41 +0200 From: Peter Zijlstra To: Hari Bathini 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 Subject: Re: [PATCH v2 1/2] perf: add container identifier entry in perf sample data Message-ID: <20160901090941.GO10153@twins.programming.kicks-ass.net> References: <147257440426.24873.5447719305627561023.stgit@hbathini.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <147257440426.24873.5447719305627561023.stgit@hbathini.in.ibm.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. I'm thinking this value is mostly the same for tasks, just like COMM and MMAP. Could we therefore not emit (sideband) events whenever a task changes namespace and get the same information but with tons less data? That also gives the possibility of recording all namespaces, not just the one.