Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756304AbcLOSrH (ORCPT ); Thu, 15 Dec 2016 13:47:07 -0500 Received: from merlin.infradead.org ([205.233.59.134]:44118 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756257AbcLOSq7 (ORCPT ); Thu, 15 Dec 2016 13:46:59 -0500 Date: Thu, 15 Dec 2016 19:46:46 +0100 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 v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info Message-ID: <20161215184646.GP3107@twins.programming.kicks-ass.net> References: <148182699546.5314.279803283347257825.stgit@hbathini.in.ibm.com> <148182702692.5314.556699668213767056.stgit@hbathini.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <148182702692.5314.556699668213767056.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 Content-Length: 866 Lines: 40 On Fri, Dec 16, 2016 at 12:07:06AM +0530, Hari Bathini wrote: > +struct perf_ns_link_info { > + __u64 dev; > + __u64 ino; > +}; > + > +enum { > + NET_NS_INDEX = 0, > + UTS_NS_INDEX = 1, > + IPC_NS_INDEX = 2, > + PID_NS_INDEX = 3, > + USER_NS_INDEX = 4, > + MNT_NS_INDEX = 5, > + CGROUP_NS_INDEX = 6, > + > + NAMESPACES_MAX, /* maximum available namespaces */ > +}; > + > enum perf_event_type { > > /* > @@ -862,6 +880,17 @@ enum perf_event_type { > */ > PERF_RECORD_SWITCH_CPU_WIDE = 15, > > + /* > + * struct { > + * struct perf_event_header header; > + * u32 pid; > + * u32 tid; > + * struct namespace_link_info link_info[NAMESPACES_MAX]; > + * struct sample_id sample_id; > + * }; > + */ > + PERF_RECORD_NAMESPACES = 16, > + > PERF_RECORD_MAX, /* non-ABI */ > }; What happens if a future kernel adds another namespace?