From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753205AbdESMLH (ORCPT ); Fri, 19 May 2017 08:11:07 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:57097 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750728AbdESMLF (ORCPT ); Fri, 19 May 2017 08:11:05 -0400 Date: Fri, 19 May 2017 14:10:56 +0200 From: Peter Zijlstra To: "Jin, Yao" Cc: acme@kernel.org, jolsa@kernel.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, Will Deacon , Mark Rutland Subject: Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is specified Message-ID: <20170519121056.c45jbsfgcdjfuoow@hirez.programming.kicks-ass.net> References: <1495189152-5766-1-git-send-email-yao.jin@linux.intel.com> <20170519092905.yivnfjyhblm5wiap@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 19, 2017 at 08:06:09PM +0800, Jin, Yao wrote: > SNIP > > > I would much rather see this in generic code, somewhere around > > __perf_event_overflow() I suppose. That would retain proper accounting > > for the interrupt rate etc.. > > > > Also it would work for all architectures. Because I'm thinking more than > > just x86 will suffer from skid. > Yes, moving to generic code is better. Thanks for the suggestion! I will do > that. > > > If you're really worried, I suppose you can put it behind a PERF_PMU_CAP > > flag or something. > I guess what you are suggesting is to add checking like: > > if (is_sampling_event(event)) { > if (event->pmu->capabilities & PERF_PMU_CAP_NO_INTERRUPT) { > return; > } > } Ah, I was more thinking of something like PERF_PMU_CAP_NO_SKID or something that would skip the test and preserve current behaviour.