[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-3e344a0db900757caaf0beeb749de4c7b59bfd60@git.kernel.org>
Date: Thu, 8 Sep 2016 02:48:45 -0700
From: tip-bot for Josh Poimboeuf <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: torvalds@...ux-foundation.org, mingo@...nel.org,
nilayvaish@...il.com, linux-kernel@...r.kernel.org,
byungchul.park@....com, peterz@...radead.org, brgerst@...il.com,
rostedt@...dmis.org, rric@...nel.org, keescook@...omium.org,
fweisbec@...il.com, hpa@...or.com, tglx@...utronix.de,
jpoimboe@...hat.com, luto@...capital.net
Subject: [tip:x86/asm] oprofile/x86: Add regs->ip to oprofile trace
Commit-ID: 3e344a0db900757caaf0beeb749de4c7b59bfd60
Gitweb: http://git.kernel.org/tip/3e344a0db900757caaf0beeb749de4c7b59bfd60
Author: Josh Poimboeuf <jpoimboe@...hat.com>
AuthorDate: Wed, 24 Aug 2016 11:50:15 -0500
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 8 Sep 2016 08:58:40 +0200
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. This makes the profile more useful, and also
makes it more consistent with what perf profiling does.
Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
Acked-by: Robert Richter <rric@...nel.org>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Byungchul Park <byungchul.park@....com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Kees Cook <keescook@...omium.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Nilay Vaish <nilayvaish@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/6c745a83dbd69fc6857ef9b2f8be0f011d775936.1472057064.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/oprofile/backtrace.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/arch/x86/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c
index cb31a44..2ef6c8b 100644
--- a/arch/x86/oprofile/backtrace.c
+++ b/arch/x86/oprofile/backtrace.c
@@ -114,9 +114,16 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
if (!user_mode(regs)) {
unsigned long stack = kernel_stack_pointer(regs);
- if (depth)
- dump_trace(NULL, regs, (unsigned long *)stack, 0,
- &backtrace_ops, &depth);
+
+ if (!depth)
+ return;
+
+ oprofile_add_trace(regs->ip);
+ if (!--depth)
+ return;
+
+ dump_trace(NULL, regs, (unsigned long *)stack, 0,
+ &backtrace_ops, &depth);
return;
}
Powered by blists - more mailing lists