Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941204AbcLVNY7 (ORCPT ); Thu, 22 Dec 2016 08:24:59 -0500 Received: from merlin.infradead.org ([205.233.59.134]:35322 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932927AbcLVNY6 (ORCPT ); Thu, 22 Dec 2016 08:24:58 -0500 Date: Thu, 22 Dec 2016 14:24:49 +0100 From: Peter Zijlstra To: "Eric W. Biederman" Cc: Hari Bathini , ast@fb.com, 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 Subject: Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info Message-ID: <20161222132449.GL3107@twins.programming.kicks-ass.net> References: <20161216075703.GE3124@twins.programming.kicks-ass.net> <2c0e3bbb-90a1-b5a4-b6d4-19c419ef5411@linux.vnet.ibm.com> <20161216200536.GI3124@twins.programming.kicks-ass.net> <1702a267-0ce6-86da-7755-11a375e450e2@linux.vnet.ibm.com> <20161221132452.GT3124@twins.programming.kicks-ass.net> <2af6cd8b-46f3-b60d-581f-30269ea65d53@linux.vnet.ibm.com> <87d1gkig3w.fsf@xmission.com> <20161222075327.GV3124@twins.programming.kicks-ass.net> <87r350gtay.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r350gtay.fsf@xmission.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1135 Lines: 32 On Thu, Dec 22, 2016 at 11:19:17PM +1300, Eric W. Biederman wrote: > Peter Zijlstra writes: > > > On Thu, Dec 22, 2016 at 08:21:23PM +1300, Eric W. Biederman wrote: > >> > >> And please make the array the last item in the structure so that > >> expanding or contracting it does not affect the ability to read the rest > >> of the structure. > > > > Sorry, sample_id must be last, because hysterical crud :/ > > > > (basically because that was the only way to add a field to records like > > PERF_RECORD_MMAP which used the record length to determine the > > filename[] length, yes I know, we won't ever do that again). > > Why does historical crud need to affect new records? Because now the userspace parser expects sample_id to be the tail field. Basically decoding a record now looks like: if (sample_id_all) { sample_id = (sample_id *)((char *)record + record->size - sizeof(sample_id)); record->size -= sizeof(sample_id); } /* process record */ We could of course create more exceptions.. > Totally confused. This looks like a major mess. Not major, but yes, its ugly, but its also ABI :-(