[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161025235200.28781-2-alexis.berlemont@gmail.com>
Date: Wed, 26 Oct 2016 01:51:59 +0200
From: Alexis Berlemont <alexis.berlemont@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Alexis Berlemont <alexis.berlemont@...il.com>,
peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com
Subject: [PATCH 1/2] perf, x86-mm: Add exit-fault tracing
Signed-off-by: Alexis Berlemont <alexis.berlemont@...il.com>
---
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
Powered by blists - more mailing lists