Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938571AbcKNVAH (ORCPT ); Mon, 14 Nov 2016 16:00:07 -0500 Received: from out02.mta.xmission.com ([166.70.13.232]:47600 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936591AbcKNU75 (ORCPT ); Mon, 14 Nov 2016 15:59:57 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Peter Zijlstra Cc: Hari Bathini , ast@fb.com, lkml , acme@kernel.org, alexander.shishkin@linux.intel.com, mingo@redhat.com, daniel@iogearbox.net, rostedt@goodmis.org, Ananth N Mavinakayanahalli , sargun@sargun.me, Aravinda Prasad , brendan.d.gregg@gmail.com References: <147877784354.29988.8570048236764105701.stgit@hbathini.in.ibm.com> <147877788475.29988.17221764769834489874.stgit@hbathini.in.ibm.com> <20161110131905.GU3117@twins.programming.kicks-ass.net> <334ecc4f-aacf-4cbe-8858-7ec674f98b24@linux.vnet.ibm.com> <20161114104612.GA3102@twins.programming.kicks-ass.net> Date: Mon, 14 Nov 2016 14:57:17 -0600 In-Reply-To: <20161114104612.GA3102@twins.programming.kicks-ass.net> (Peter Zijlstra's message of "Mon, 14 Nov 2016 11:46:12 +0100") Message-ID: <87inrpkceq.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1c6OM1-0003st-7Q;;;mid=<87inrpkceq.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=75.170.125.99;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/lF6uz4VA4rJ+mcrJ5Iax69SyTcvn4n4g= X-SA-Exim-Connect-IP: 75.170.125.99 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Peter Zijlstra X-Spam-Relay-Country: X-Spam-Timing: total 5838 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 7 (0.1%), b_tie_ro: 4.3 (0.1%), parse: 0.89 (0.0%), extract_message_metadata: 12 (0.2%), get_uri_detail_list: 1.38 (0.0%), tests_pri_-1000: 5.0 (0.1%), tests_pri_-950: 1.14 (0.0%), tests_pri_-900: 0.97 (0.0%), tests_pri_-400: 20 (0.3%), check_bayes: 19 (0.3%), b_tokenize: 6 (0.1%), b_tok_get_all: 6 (0.1%), b_comp_prob: 1.90 (0.0%), b_tok_touch_all: 2.9 (0.1%), b_finish: 0.64 (0.0%), tests_pri_0: 456 (7.8%), check_dkim_signature: 0.45 (0.0%), check_dkim_adsp: 3.6 (0.1%), tests_pri_500: 5332 (91.3%), poll_dns_idle: 5326 (91.2%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1630 Lines: 51 Peter Zijlstra writes: > On Mon, Nov 14, 2016 at 04:02:30PM +0530, Hari Bathini wrote: > >> >> PERF_RECORD_SWITCH_CPU_WIDE = 15, >> >>+ /* >> >>+ * struct { >> >>+ * struct perf_event_header header; >> >>+ * >> >>+ * u32 pid, tid; >> >>+ * u64 time; >> >>+ * u32 uts_ns_inum; >> >>+ * u32 ipc_ns_inum; >> >>+ * u32 mnt_ns_inum; >> >>+ * u32 pid_ns_inum; >> >>+ * u32 net_ns_inum; >> >>+ * u32 cgroup_ns_inum; >> >>+ * u32 user_ns_inum; >> >>+ * struct sample_id sample_id; >> >>+ * }; >> >>+ */ >> >>+ PERF_RECORD_NAMESPACES = 16, >> >So this format is not extensible, that is, if someone adds yet another >> >namespace, we'll need to introduce PERF_RECORD_NAMESPACES2. >> > >> >Is there a 'natural' and exposed namespace index that we can use to >> >change it like: >> > >> > u32 nr_nss; >> > u32 namespace[nr_nss]; >> > >> >? >> >> Nothing of that sort exists, currently. >> Maybe, time to introduce with this patch-set..? > > Would be good, but you'll have to sort that with the namespace folks. The somewhat easy answer is to use the unshare flags. AKA CLONE_NEWNS, CLONE_NEWUSER, ... In the worst case things may get extended to the point where perf would have to use a different set of values than we use to unshare, clone, and setns (as the clone flags are effectively all used up) but for the existing namespaces that index should work just fine. That won't allow for a natural array in the record but it will allow for an array with that has a tag for which namespace it is in, or alternative it will allow for one record per namespace. Eric