From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753965AbcANL1k (ORCPT ); Thu, 14 Jan 2016 06:27:40 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33130 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753477AbcANL1i (ORCPT ); Thu, 14 Jan 2016 06:27:38 -0500 Date: Thu, 14 Jan 2016 12:27:34 +0100 From: Ingo Molnar To: Peter Zijlstra Cc: Arnaldo Carvalho de Melo , Stephane Eranian , Namhyung Kim , LKML , Jiri Olsa , Namhyung Kim , Adrian Hunter , "ak@linux.intel.com" Subject: Re: [RFC] perf record: missing buildid for callstack modules Message-ID: <20160114112733.GB17869@gmail.com> References: <20160112121805.GA32199@gmail.com> <20160112134012.GF6357@twins.programming.kicks-ass.net> <20160112143805.GX18367@kernel.org> <20160112153440.GJ6357@twins.programming.kicks-ass.net> <20160112154812.GH18367@kernel.org> <20160112161027.GN6357@twins.programming.kicks-ass.net> <20160112162719.GX6373@twins.programming.kicks-ass.net> <20160112171517.GI18367@kernel.org> <20160113102107.GA9644@gmail.com> <20160113124039.GA3421@worktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160113124039.GA3421@worktop> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra wrote: > The current problem with that is that we use the 'remaining' size as > the length field for a string (with the PERF_RECORD_MMAP* records). > > We could of course fix that no problem. > > > --- > include/uapi/linux/perf_event.h | 27 ++++++++++++++++++++++++++- > kernel/events/core.c | 35 ++++++++++++++++++++++++----------- > 2 files changed, 50 insertions(+), 12 deletions(-) > > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h > index 1afe9623c1a7..b7b673387581 100644 > --- a/include/uapi/linux/perf_event.h > +++ b/include/uapi/linux/perf_event.h > @@ -340,7 +340,8 @@ struct perf_event_attr { > comm_exec : 1, /* flag comm events that are due to an exec */ > use_clockid : 1, /* use @clockid for time fields */ > context_switch : 1, /* context switch data */ > - __reserved_1 : 37; > + mmap3 : 1, /* include mmap with mtime */ > + __reserved_1 : 36; > > union { > __u32 wakeup_events; /* wakeup every n events */ > @@ -856,6 +857,30 @@ enum perf_event_type { > */ > PERF_RECORD_SWITCH_CPU_WIDE = 15, > > + /* > + * The MMAP3 records are an augmented version of MMAP2, they add > + * mtime and filename_len, allowing for size based extensions. > + * > + * struct { > + * struct perf_event_header header; > + * > + * u32 pid, tid; > + * u64 addr; > + * u64 len; > + * u64 pgoff; > + * u32 maj; > + * u32 min; > + * u64 ino; > + * u64 ino_generation; > + * u32 prot, flags; > + * u64 mtime; > + * u32 filename_len; > + * char filename[2+]; > + * struct sample_id sample_id; > + * } > + */ > + PERF_RECORD_MMAP3 = 16, > + > PERF_RECORD_MAX, /* non-ABI */ > }; Yeah, very nice! And this means v3 should be the last ever version - all future extensions can happen via the length field. Acked-by: Ingo Molnar Thanks, Ingo