Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755253AbcJZSxp (ORCPT ); Wed, 26 Oct 2016 14:53:45 -0400 Received: from mail.kernel.org ([198.145.29.136]:50502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754609AbcJZSxo (ORCPT ); Wed, 26 Oct 2016 14:53:44 -0400 Date: Wed, 26 Oct 2016 16:53:39 -0200 From: Arnaldo Carvalho de Melo To: Peter Zijlstra Cc: Alexis Berlemont , linux-kernel@vger.kernel.org, mingo@redhat.com, alexander.shishkin@linux.intel.com Subject: Re: [PATCH 1/2] perf, x86-mm: Add exit-fault tracing Message-ID: <20161026185339.GC4704@kernel.org> References: <20161025235200.28781-1-alexis.berlemont@gmail.com> <20161025235200.28781-2-alexis.berlemont@gmail.com> <20161026085116.GZ3102@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161026085116.GZ3102@twins.programming.kicks-ass.net> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1823 Lines: 57 Em Wed, Oct 26, 2016 at 10:51:16AM +0200, Peter Zijlstra escreveu: > On Wed, Oct 26, 2016 at 01:51:59AM +0200, Alexis Berlemont wrote: > > -ENOCHANGELOG Yeah, please add one explaining why we want this, how we can use it, for example, in 'perf trace', to measure how long each page fault took, examples of it in use, etc. > > Signed-off-by: Alexis Berlemont > > --- > > > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c > > index 9f72ca3..e31e8ef 100644 > > --- a/arch/x86/mm/fault.c > > +++ b/arch/x86/mm/fault.c > > @@ -1488,6 +1488,7 @@ trace_do_page_fault(struct pt_regs *regs, unsigned long error_code) > > prev_state = exception_enter(); > > trace_page_fault_entries(address, regs, error_code); > > __do_page_fault(regs, error_code, address); > > + trace_page_fault_exit(address); > > Aside from my general hatred of tracepoint, it bugs me that its not > symmetric like the irq vector ones. But I'll leave that to x86 people. What is the simmetry problem, you think we should have: exceptions:page_fault_kernel_exit exceptions:page_fault_user_exit To be counterparts of: [root@jouet ~]# perf list exceptions:* List of pre-defined events (to be used in -e): exceptions:page_fault_kernel [Tracepoint event] exceptions:page_fault_user [Tracepoint event] [root@jouet ~]# ? For perf usage yeah, the good thing would be to have just exceptions:page_fault_entry and exceptions:page_fault_exit, and then use perf_event_attr fields to filter what kind was desired, with a header.misc stating where it took place, just like with other events, but by now we have two for entry, so two for exit? - Arnaldo > > exception_exit(prev_state); > > } > > NOKPROBE_SYMBOL(trace_do_page_fault); > > -- > > 2.10.1 > >