linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hari Bathini <hbathini@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
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
Subject: Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info
Date: Wed, 21 Dec 2016 18:39:01 +0530	[thread overview]
Message-ID: <1702a267-0ce6-86da-7755-11a375e450e2@linux.vnet.ibm.com> (raw)
In-Reply-To: <20161216200536.GI3124@twins.programming.kicks-ass.net>

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.

  reply	other threads:[~2016-12-21 13:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15 18:36 [PATCH v4 0/3] perf: add support for analyzing events for containers Hari Bathini
2016-12-15 18:37 ` [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info Hari Bathini
2016-12-15 18:46   ` Peter Zijlstra
2016-12-16  6:27     ` Hari Bathini
2016-12-16  7:57       ` Peter Zijlstra
2016-12-16 18:21         ` Hari Bathini
2016-12-16 20:05           ` Peter Zijlstra
2016-12-21 13:09             ` Hari Bathini [this message]
2016-12-21 13:24               ` Peter Zijlstra
2016-12-21 15:56                 ` Hari Bathini
2016-12-22  7:21                   ` Eric W. Biederman
2016-12-22  7:53                     ` Peter Zijlstra
2016-12-22 10:19                       ` Eric W. Biederman
2016-12-22 13:24                         ` Peter Zijlstra
2016-12-22 18:20                           ` Eric W. Biederman
2016-12-15 18:37 ` [PATCH v4 2/3] perf tool: " Hari Bathini
2016-12-17 17:40   ` Jiri Olsa
2016-12-21 13:18     ` Hari Bathini
2016-12-15 18:37 ` [PATCH v4 3/3] perf tool: add cgroup identifier entry in perf report Hari Bathini
2016-12-29  1:41 ` [PATCH v4 0/3] perf: add support for analyzing events for containers Krister Johansen
2017-01-03 11:27   ` Hari Bathini
2017-01-04  9:04     ` Krister Johansen
2017-01-04 11:45       ` Hari Bathini
2017-01-11 11:16       ` Aravinda Prasad
2017-01-11 14:45         ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1702a267-0ce6-86da-7755-11a375e450e2@linux.vnet.ibm.com \
    --to=hbathini@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=aravinda@linux.vnet.ibm.com \
    --cc=ast@fb.com \
    --cc=brendan.d.gregg@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sargun@sargun.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).