Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932280AbcLLVzE (ORCPT ); Mon, 12 Dec 2016 16:55:04 -0500 Received: from out01.mta.xmission.com ([166.70.13.231]:45738 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbcLLVzC (ORCPT ); Mon, 12 Dec 2016 16:55:02 -0500 From: ebiederm@xmission.com (Eric W. Biederman) 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 , sargun@sargun.me, Aravinda Prasad , brendan.d.gregg@gmail.com References: <148156671980.4651.13017595439842763683.stgit@hbathini.in.ibm.com> <148156678709.4651.2627099783639142957.stgit@hbathini.in.ibm.com> Date: Tue, 13 Dec 2016 10:51:56 +1300 In-Reply-To: <148156678709.4651.2627099783639142957.stgit@hbathini.in.ibm.com> (Hari Bathini's message of "Mon, 12 Dec 2016 23:49:55 +0530") Message-ID: <87zik095oj.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=1cGYYl-0007ZM-1H;;;mid=<87zik095oj.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=101.100.131.98;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+6PiwwbD1haYsMkCRD/U6Uk2Nkip0kgn0= X-SA-Exim-Connect-IP: 101.100.131.98 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 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 * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.2 T_XMDrugObfuBody_14 obfuscated drug references X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Hari Bathini X-Spam-Relay-Country: X-Spam-Timing: total 363 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 4.4 (1.2%), b_tie_ro: 3.1 (0.9%), parse: 1.25 (0.3%), extract_message_metadata: 4.2 (1.2%), get_uri_detail_list: 1.71 (0.5%), tests_pri_-1000: 3.5 (1.0%), tests_pri_-950: 1.10 (0.3%), tests_pri_-900: 0.93 (0.3%), tests_pri_-400: 24 (6.5%), check_bayes: 22 (6.2%), b_tokenize: 5 (1.5%), b_tok_get_all: 7 (1.9%), b_comp_prob: 3.3 (0.9%), b_tok_touch_all: 3.9 (1.1%), b_finish: 1.01 (0.3%), tests_pri_0: 308 (84.8%), check_dkim_signature: 0.67 (0.2%), check_dkim_adsp: 4.3 (1.2%), tests_pri_500: 6 (1.5%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v3 2/3] perf tool: 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 in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1209 Lines: 34 Hari Bathini writes: > This patch updates perf tool to examine PERF_RECORD_NAMESPACES events > emitted by the kernel when fork, clone, setns or unshare are invoked. > Also, it synthesizes PERF_RECORD_NAMESPACES events for processes that > were running prior to invocation of perf record, the data for which > is taken from /proc/$PID/ns. These changes make way for analyzing > events with regard to namespaces. > diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h > index 8d363d5..a73bc8e 100644 > --- a/tools/perf/util/event.h > +++ b/tools/perf/util/event.h > @@ -39,6 +39,13 @@ struct comm_event { > char comm[16]; > }; > > +struct namespaces_event { > + struct perf_event_header header; > + u32 pid, tid; > + u64 dev_num; > + u64 inode_num[NAMESPACES_MAX]; > +}; This suffers from the same issue I pointed out with the kernel interface. We need one device number per inode. Today we only have one device number but that may change in the future. These are st_dev and st_inode from stat, and you need both of them per namespace to be unique. I do not want to get into a situation where I have to implement a namespace of namespaces in the future. Eric