Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426AbcLFLUk (ORCPT ); Tue, 6 Dec 2016 06:20:40 -0500 Received: from merlin.infradead.org ([205.233.59.134]:36306 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbcLFLUj (ORCPT ); Tue, 6 Dec 2016 06:20:39 -0500 Date: Tue, 6 Dec 2016 12:20:13 +0100 From: Peter Zijlstra To: kan.liang@intel.com Cc: mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, tglx@linutronix.de, namhyung@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com, wangnan0@huawei.com, mark.rutland@arm.com, andi@firstfloor.org Subject: Re: [PATCH V2 03/13] perf/x86: output sampling overhead Message-ID: <20161206112013.GJ3124@twins.programming.kicks-ass.net> References: <1480713561-6617-1-git-send-email-kan.liang@intel.com> <1480713561-6617-4-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1480713561-6617-4-git-send-email-kan.liang@intel.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: 1167 Lines: 34 On Fri, Dec 02, 2016 at 04:19:11PM -0500, kan.liang@intel.com wrote: > From: Kan Liang > > On x86, NMI handler is the most important part which brings overhead > for sampling. Adding a pmu specific overhead type > PERF_PMU_SAMPLE_OVERHEAD for it. > > For other architectures which may don't have NMI, the overhead type can > be reused. > > Signed-off-by: Kan Liang > --- > arch/x86/events/core.c | 17 ++++++++++++++++- > arch/x86/events/perf_event.h | 2 ++ > include/uapi/linux/perf_event.h | 1 + > 3 files changed, 19 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c > index 9d4bf3a..de40f96 100644 > --- a/arch/x86/events/core.c > +++ b/arch/x86/events/core.c > @@ -1397,6 +1397,9 @@ static void x86_pmu_del(struct perf_event *event, int flags) > > perf_event_update_userpage(event); > > + if ((flags & PERF_EF_LOG) && cpuc->nmi_overhead.nr) > + perf_log_overhead(event, PERF_PMU_SAMPLE_OVERHEAD, &cpuc->nmi_overhead); > + > do_del: > if (x86_pmu.del) { > /* That's not at all mentioned in the changelog, and it clearly isn't nmi_overhead.