[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c31bbbfd58d1e1021457f257e064f0775659e5e2.1470345772.git.jpoimboe@redhat.com>
Date: Thu, 4 Aug 2016 17:22:12 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
"H . Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Andy Lutomirski <luto@...capital.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Brian Gerst <brgerst@...il.com>,
Kees Cook <keescook@...omium.org>,
Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Byungchul Park <byungchul.park@....com>,
Robert Richter <rric@...nel.org>
Subject: [PATCH v2 16/44] oprofile/x86: add regs->ip to oprofile trace
dump_trace() doesn't add the interrupted instruction's address to the
trace, so add it manually.
Cc: Robert Richter <rric@...nel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
---
arch/x86/oprofile/backtrace.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/x86/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c
index c594768..d950f9e 100644
--- a/arch/x86/oprofile/backtrace.c
+++ b/arch/x86/oprofile/backtrace.c
@@ -113,8 +113,14 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
struct stack_frame *head = (struct stack_frame *)frame_pointer(regs);
if (!user_mode(regs)) {
- if (depth)
- dump_trace(NULL, regs, NULL, 0, &backtrace_ops, &depth);
+ if (!depth)
+ return;
+
+ oprofile_add_trace(regs->ip);
+ if (!--depth)
+ return;
+
+ dump_trace(NULL, regs, NULL, 0, &backtrace_ops, &depth);
return;
}
--
2.7.4
Powered by blists - more mailing lists