From: lauraa@codeaurora.org (Laura Abbott)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm: add dump_stack_regs to dump stack from registers
Date: Wed, 24 Aug 2011 10:21:46 -0700 [thread overview]
Message-ID: <1314206507-6487-2-git-send-email-lauraa@codeaurora.org> (raw)
In-Reply-To: <1314206507-6487-1-git-send-email-lauraa@codeaurora.org>
Currently, there is no API to be able to dump a stack
from registers. Use dump_backtrace to walk the stack
with a given set of registers.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
arch/arm/include/asm/stacktrace.h | 4 ++++
arch/arm/kernel/traps.c | 7 +++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/stacktrace.h b/arch/arm/include/asm/stacktrace.h
index 4d0a164..614b017 100644
--- a/arch/arm/include/asm/stacktrace.h
+++ b/arch/arm/include/asm/stacktrace.h
@@ -1,6 +1,8 @@
#ifndef __ASM_STACKTRACE_H
#define __ASM_STACKTRACE_H
+#include <asm/system.h>
+
struct stackframe {
unsigned long fp;
unsigned long sp;
@@ -12,4 +14,6 @@ extern int unwind_frame(struct stackframe *frame);
extern void walk_stackframe(struct stackframe *frame,
int (*fn)(struct stackframe *, void *), void *data);
+void dump_stack_regs(struct pt_regs *regs);
+
#endif /* __ASM_STACKTRACE_H */
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index bc9f9da..983ba41 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -209,6 +209,13 @@ void dump_stack(void)
EXPORT_SYMBOL(dump_stack);
+
+void dump_stack_regs(struct pt_regs *regs)
+{
+ dump_backtrace(regs, NULL);
+}
+EXPORT_SYMBOL(dump_stack_regs);
+
void show_stack(struct task_struct *tsk, unsigned long *sp)
{
dump_backtrace(NULL, tsk);
--
1.7.3.3
next prev parent reply other threads:[~2011-08-24 17:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-24 17:21 [PATCH] Fix show_regs to give a backtrace Laura Abbott
2011-08-24 17:21 ` Laura Abbott [this message]
2011-08-24 17:21 ` [PATCH 2/2] process: change from __backtrace to dump_stack_regs in show_regs Laura Abbott
2011-08-24 18:57 ` Nicolas Pitre
2011-08-24 20:58 ` Laura Abbott
2011-08-24 23:27 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314206507-6487-2-git-send-email-lauraa@codeaurora.org \
--to=lauraa@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).