Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758109AbcLPSWH (ORCPT ); Fri, 16 Dec 2016 13:22:07 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34739 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758767AbcLPSVl (ORCPT ); Fri, 16 Dec 2016 13:21:41 -0500 Subject: Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info To: Peter Zijlstra References: <148182699546.5314.279803283347257825.stgit@hbathini.in.ibm.com> <148182702692.5314.556699668213767056.stgit@hbathini.in.ibm.com> <20161215184646.GP3107@twins.programming.kicks-ass.net> <20161216075703.GE3124@twins.programming.kicks-ass.net> 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 From: Hari Bathini Date: Fri, 16 Dec 2016 23:51:20 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161216075703.GE3124@twins.programming.kicks-ass.net> 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: 16121618-0040-0000-0000-000002D8F26E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16121618-0041-0000-0000-00000BE7D6EF Message-Id: <2c0e3bbb-90a1-b5a4-b6d4-19c419ef5411@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-16_10:,, 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-1612160275 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1672 Lines: 61 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.. > You must not expect lock-step updates for this to work. > Not required unless the tool is expected to process the new namespace data.. Thanks Hari