From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933329AbdCaQoa (ORCPT ); Fri, 31 Mar 2017 12:44:30 -0400 Received: from foss.arm.com ([217.140.101.70]:34010 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933217AbdCaQo3 (ORCPT ); Fri, 31 Mar 2017 12:44:29 -0400 Subject: Re: [PATCH 08/10] perf/core: Add PERF_AUX_FLAG_COLLISION to report colliding samples References: <1485540470-11469-1-git-send-email-will.deacon@arm.com> <1485540470-11469-9-git-send-email-will.deacon@arm.com> To: Will Deacon , linux-arm-kernel@lists.infradead.org Cc: mark.rutland@arm.com, robh@kernel.org, kim.phillips@arm.com, mathieu.poirier@linaro.org, pawel.moll@arm.com, suzuki.poulose@arm.com, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, peterz@infradead.org, mingo@redhat.com, tglx@linutronix.de, alex.bennee@linaro.org, christoffer.dall@linaro.org From: Robin Murphy Message-ID: <72e0e51c-9abf-641f-f13e-ee07e12c02c1@arm.com> Date: Fri, 31 Mar 2017 17:44:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1485540470-11469-9-git-send-email-will.deacon@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Will, On 27/01/17 18:07, Will Deacon wrote: > The ARM SPE architecture permits an implementation to ignore a sample > if the sample is due to be taken whilst another sample is already being > produced. In this case, it is desirable to report the collision to > userspace, as they may want to lower the sample period. > > This patch adds a PERF_AUX_FLAG_COLLISION flag, so that such events can > be relayed to userspace. > > Signed-off-by: Will Deacon > --- > include/uapi/linux/perf_event.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h > index c66a485a24ac..68a4e542968e 100644 > --- a/include/uapi/linux/perf_event.h > +++ b/include/uapi/linux/perf_event.h > @@ -885,6 +885,7 @@ enum perf_callchain_context { > */ > #define PERF_AUX_FLAG_TRUNCATED 0x01 /* record was truncated to fit */ > #define PERF_AUX_FLAG_OVERWRITE 0x02 /* snapshot from overwrite mode */ > +#define PERF_AUX_FLAG_COLLISION 0x03 /* sample collided with another */ Does COLLISION really represent the combination of both TRUNCATED and OVERWRITE, or does that want to be 0x04? (The way they get ORed together at one point in the following patch makes me suspicious.) Robin. > > #define PERF_FLAG_FD_NO_GROUP (1UL << 0) > #define PERF_FLAG_FD_OUTPUT (1UL << 1) >