Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752252AbcL2Blo (ORCPT ); Wed, 28 Dec 2016 20:41:44 -0500 Received: from sub5.mail.dreamhost.com ([208.113.200.129]:51000 "EHLO homiemail-a56.g.dreamhost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752104AbcL2Bln (ORCPT ); Wed, 28 Dec 2016 20:41:43 -0500 Date: Wed, 28 Dec 2016 17:41:38 -0800 From: Krister Johansen To: Hari Bathini 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 , ebiederm@xmission.com, sargun@sargun.me, Aravinda Prasad , brendan.d.gregg@gmail.com Subject: Re: [PATCH v4 0/3] perf: add support for analyzing events for containers Message-ID: <20161229014138.GB2341@templeofstupid.com> References: <148182699546.5314.279803283347257825.stgit@hbathini.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <148182699546.5314.279803283347257825.stgit@hbathini.in.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1623 Lines: 32 On Fri, Dec 16, 2016 at 12:06:55AM +0530, Hari Bathini wrote: > 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. Why choose cgroups when the kernel dispenses namespace-unique identifiers. Cgroup membership can be arbitrary. Moreover, cgroup and namespace destruction are handled by separate subsystems. It's possible to have a cgroup notifier run prior to network namespace teardown occurring. If it were me, I'd re-use existing convention to identify the namespaces you want to monitor. The code in nsenter(1) can take a namespace that's been bind mount'd on a file, or extract the ns information from a task in /procfs. My biggest concern is how the sample data is handled after it has been collected. Both namespaces and cgroups don't survive reboots. Will the records will contain all the persistent state needed to run a report or script command at a later date? Does this code attempt to enter alternate namespaces in order to record stack/symbol information for a '-g' style trace? If so, how are you holding on to that information? There's no guarantee that a particular container will be alive or have its filesystems reachable from the host if the trace data is evaluated at a later time. -K