Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1545753

Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!news.in-chemnitz.de!news2.arglkargh.de!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Hari Bathini <hbathini@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info
Date Wed, 21 Dec 2016 14:10:03 +0100
Message-ID <sQOOD-3SW-63@gated-at.bofh.it> (permalink)
References <sOJ6F-Ms-5@gated-at.bofh.it> <sOJ6F-Ms-9@gated-at.bofh.it> <sOJgl-PQ-1@gated-at.bofh.it> <sOUOt-ep-3@gated-at.bofh.it> <sOW3U-10d-7@gated-at.bofh.it> <sP5qy-7cn-17@gated-at.bofh.it> <sP6Zk-8fR-7@gated-at.bofh.it>
X-Original-To Peter Zijlstra <peterz@infradead.org>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Tm-As-Mml disable
X-Content-Scanned Fidelis XPS MAILER
X-Cbid 16122113-0008-0000-0000-000004F89E30
X-Ibm-Av-Detection SAVI=unused REMOTE=unused XFE=unused
X-Cbparentid 16122113-0009-0000-0000-0000129B16C6
X-Proofpoint-Virus-Version vendor=fsecure engine=2.50.10432:,, definitions=2016-12-21_09:,, signatures=0
X-Proofpoint-Spam-Details rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1612210212
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 74
Organization linux.* mail to news gateway
X-Original-Cc ast@fb.com, lkml <linux-kernel@vger.kernel.org>, acme@kernel.org, alexander.shishkin@linux.intel.com, mingo@redhat.com, daniel@iogearbox.net, rostedt@goodmis.org, Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>, ebiederm@xmission.com, sargun@sargun.me, Aravinda Prasad <aravinda@linux.vnet.ibm.com>, brendan.d.gregg@gmail.com
X-Original-Date Wed, 21 Dec 2016 18:39:01 +0530
X-Original-Message-ID <1702a267-0ce6-86da-7755-11a375e450e2@linux.vnet.ibm.com>
X-Original-References <148182699546.5314.279803283347257825.stgit@hbathini.in.ibm.com> <148182702692.5314.556699668213767056.stgit@hbathini.in.ibm.com> <20161215184646.GP3107@twins.programming.kicks-ass.net> <e75ee5d4-9fdc-f73f-c883-1394b2962bbd@linux.vnet.ibm.com> <20161216075703.GE3124@twins.programming.kicks-ass.net> <2c0e3bbb-90a1-b5a4-b6d4-19c419ef5411@linux.vnet.ibm.com> <20161216200536.GI3124@twins.programming.kicks-ass.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1545753

Show key headers only | View raw


Hi Peter,


On Saturday 17 December 2016 01:35 AM, Peter Zijlstra wrote:
> On Fri, Dec 16, 2016 at 11:51:20PM +0530, Hari Bathini wrote:
>> Hi Peter,
>>
>>
>> On Friday 16 December 2016 01:27 PM, Peter Zijlstra wrote:
>>> On Fri, Dec 16, 2016 at 11:57:47AM +0530, Hari Bathini wrote:
>>>> On Friday 16 December 2016 12:16 AM, Peter Zijlstra wrote:
>>>>> 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?
>>>>>
>>>> No impact unless NAMESPACES_MAX in include/uapi/linux/perf_event.h is
>>>> updated to accommodate that..
>>>> And if it is updated, the corresponding change is expected in perf-tool as
>>>> well..
>>> And what happens if you try and process old data files with the new
>>> tools or the other way around?
>> It works fine either way. I tested that..
> I don't see how the tool can parse old records (with NAMESPACES_MAX ==
> 7) if you set its NAMESPACES_MAX to say 10.
>
> Then it will expect the link_info array to be 10 entries and either read
> past the end of the record (if !sample_all) or try and interpret
> sample_id as link_info records.
>

Right. There will be inconsistency with data the perf tool tries to read 
beyond
what the kernel supports. IIUC, you mean, include nr_namespaces field in the
record and warn the user if it doesn't match with the one perf-tool supports
before proceeding..?

Thanks
Hari

PS: I am on vacation. Will post next version early January.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/3] perf: add support for analyzing events for containers Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-15 19:40 +0100
  [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-15 19:40 +0100
    Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-15 19:50 +0100
      Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-16 08:10 +0100
        Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-16 09:30 +0100
          Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-16 19:30 +0100
            Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-16 21:10 +0100
              Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-21 14:10 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-21 14:30 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-21 17:00 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info ebiederm@xmission.com (Eric W. Biederman) - 2016-12-22 08:30 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-22 09:00 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info ebiederm@xmission.com (Eric W. Biederman) - 2016-12-22 11:30 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-22 14:30 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info ebiederm@xmission.com (Eric W. Biederman) - 2016-12-22 19:30 +0100
  [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-15 19:40 +0100
    Re: [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include  namespaces related info Jiri Olsa <jolsa@redhat.com> - 2016-12-17 18:50 +0100
      Re: [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-21 14:20 +0100
  Re: [PATCH v4 0/3] perf: add support for analyzing events for  containers Krister Johansen <kjlx@templeofstupid.com> - 2016-12-29 02:50 +0100
    Re: [PATCH v4 0/3] perf: add support for analyzing events for  containers Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-03 12:30 +0100

csiph-web