From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751966AbdJCOkl (ORCPT ); Tue, 3 Oct 2017 10:40:41 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:47976 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbdJCOkk (ORCPT ); Tue, 3 Oct 2017 10:40:40 -0400 Date: Tue, 3 Oct 2017 16:40:34 +0200 From: Peter Zijlstra To: Alexander Shishkin Cc: Ingo Molnar , linux-kernel@vger.kernel.org, acme@redhat.com, kirill.shutemov@linux.intel.com, Borislav Petkov , rric@kernel.org Subject: Re: [RFC PATCH 07/17] perf: Add pmu_info to user page Message-ID: <20171003144034.um4fjtxza2qb42ei@hirez.programming.kicks-ass.net> References: <20170905133026.13689-1-alexander.shishkin@linux.intel.com> <20170905133026.13689-8-alexander.shishkin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170905133026.13689-8-alexander.shishkin@linux.intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 05, 2017 at 04:30:16PM +0300, Alexander Shishkin wrote: > Allow PMUs to supply additional static information that may be required > by their decoders. Most of what Intel PT driver exports as capability > attributes (timing packet freqencies, frequency ratios etc), its decoder > needs to be able to correctly decode its binary stream. However, when > decoding Intel PT stream from a core dump, we can't rely on the sysfs > attributes, so we need to pack this information into the perf buffer, > so that the resulting core dump is self-contained. > > In order to do this, we append a PMU-specific structure to the user > page. Such structures will include size, for versioning. > > @@ -508,6 +513,18 @@ struct perf_addr_filters_head { > unsigned int nr_file_filters; > }; > > +struct pmu_info { > + /* > + * Size of this structure, for versioning. > + */ > + u32 note_size; > + > + /* > + * Size of the container structure, not including this one > + */ > + u32 pmu_descsz; > +}; > + > /** > * enum perf_event_active_state - the states of a event > */ > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h > index 3d64d9ea80..4cdd4fab9d 100644 > --- a/include/uapi/linux/perf_event.h > +++ b/include/uapi/linux/perf_event.h > @@ -599,6 +599,16 @@ struct perf_event_mmap_page { > __u64 aux_tail; > __u64 aux_offset; > __u64 aux_size; > + > + /* > + * PMU data: static info that (AUX) decoder wants to know in order to > + * decode correctly: > + * > + * pmu_offset >= sizeof(struct perf_event_mmap_page) > + * pmu_offset + pmu_size <= PAGE_SIZE > + */ > + __u64 pmu_offset; > + __u64 pmu_size; > }; Why like this? Why not dump the data as part of PERF_RECORD_ITRACE_START/PERF_RECORD_AUX ?