Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752451AbdGDKXC (ORCPT ); Tue, 4 Jul 2017 06:23:02 -0400 Received: from foss.arm.com ([217.140.101.70]:43212 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752403AbdGDKXA (ORCPT ); Tue, 4 Jul 2017 06:23:00 -0400 Date: Tue, 4 Jul 2017 11:21:59 +0100 From: Mark Rutland To: Peter Zijlstra Cc: Kyle Huey , Vince Weaver , "Jin, Yao" , Ingo Molnar , stable@vger.kernel.org, Alexander Shishkin , Arnaldo Carvalho de Melo , Jiri Olsa , Linus Torvalds , Namhyung Kim , Stephane Eranian , Thomas Gleixner , acme@kernel.org, jolsa@kernel.org, kan.liang@intel.com, Will Deacon , gregkh@linuxfoundation.org, "Robert O'Callahan" , open list Subject: Re: [PATCH] perf/core: generate overflow signal when samples are dropped (WAS: Re: [REGRESSION] perf/core: PMU interrupts dropped if we entered the kernel in the "skid" region) Message-ID: <20170704102159.GB20062@leverpostej> References: <2256f9b5-1277-c4b1-1472-61a10cd1db9a@linux.intel.com> <20170628101248.GB5981@leverpostej> <20170628105600.GC5981@leverpostej> <20170628174900.GG8252@leverpostej> <20170704090313.xyb5lntyy55ga7dm@hirez.programming.kicks-ass.net> <20170704093345.GB19649@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170704093345.GB19649@leverpostej> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1151 Lines: 42 On Tue, Jul 04, 2017 at 10:33:45AM +0100, Mark Rutland wrote: > On Tue, Jul 04, 2017 at 11:03:13AM +0200, Peter Zijlstra wrote: > > Faking data gets a wee bit tricky in how much data we need to clear > > through, its not only IP, pretty much everything we get from the > > interrupt context, like the branch stack and registers is also suspect. > > Indeed. I'll take a run through __perf_event_output() and callees, and > see what we need to drop. Looking at perf_event_sample_format in uapi/linux/perf_event.h, there are samples that are obviously sensitive, and should be dropped: * PERF_SAMPLE_IP * PERF_SAMPLE_CALLCHAIN * PERF_SAMPLE_BRANCH_STACK * PERF_SAMPLE_REGS_INTR ... samples that look benign: * PERF_SAMPLE_TID * PERF_SAMPLE_TIME * PERF_SAMPLE_CPU * PERF_SAMPLE_PERIOD * PERF_SAMPLE_REGS_USER * PERF_SAMPLE_STACK_USER * PERF_SAMPLE_READ * PERF_SAMPLE_ID * PERF_SAMPLE_STREAM_ID * PERF_SAMPLE_IDENTIFIER .. and samples that I have no idea about: * PERF_SAMPLE_ADDR * PERF_SAMPLE_RAW * PERF_SAMPLE_WEIGHT * PERF_SAMPLE_DATA_SRC * PERF_SAMPLE_TRANSACTION Should any of those be moved into the "should be dropped" pile? Thanks, Mark.