Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756447AbcJYX4T (ORCPT ); Tue, 25 Oct 2016 19:56:19 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:32921 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756046AbcJYX4P (ORCPT ); Tue, 25 Oct 2016 19:56:15 -0400 From: Alexis Berlemont To: linux-kernel@vger.kernel.org Cc: Alexis Berlemont , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com Subject: [PATCH 1/2] perf, x86-mm: Add exit-fault tracing Date: Wed, 26 Oct 2016 01:51:59 +0200 Message-Id: <20161025235200.28781-2-alexis.berlemont@gmail.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161025235200.28781-1-alexis.berlemont@gmail.com> References: <20161025235200.28781-1-alexis.berlemont@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1486 Lines: 52 Signed-off-by: Alexis Berlemont --- arch/x86/include/asm/trace/exceptions.h | 21 +++++++++++++++++++++ arch/x86/mm/fault.c | 1 + 2 files changed, 22 insertions(+) diff --git a/arch/x86/include/asm/trace/exceptions.h b/arch/x86/include/asm/trace/exceptions.h index 2fbc66c..39f78bb 100644 --- a/arch/x86/include/asm/trace/exceptions.h +++ b/arch/x86/include/asm/trace/exceptions.h @@ -43,6 +43,27 @@ DEFINE_EVENT_FN(x86_exceptions, name, \ DEFINE_PAGE_FAULT_EVENT(page_fault_user); DEFINE_PAGE_FAULT_EVENT(page_fault_kernel); +TRACE_EVENT_FN(page_fault_exit, + + TP_PROTO(unsigned long address), + + TP_ARGS(address), + + TP_STRUCT__entry( + __field(unsigned long, address) + ), + + TP_fast_assign( + __entry->address = address; + ), + + TP_printk("address=%lx", __entry->address), + + trace_irq_vector_regfunc, + + trace_irq_vector_unregfunc +); + #undef TRACE_INCLUDE_PATH #define TRACE_INCLUDE_PATH . #define TRACE_INCLUDE_FILE exceptions 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); exception_exit(prev_state); } NOKPROBE_SYMBOL(trace_do_page_fault); -- 2.10.1