From: David Miller <davem@davemloft•net>
To: adobriyan@gmail•com
Cc: sfr@canb•auug.org.au, linux-next@vger•kernel.org,
kenchen@google•com, mingo@elte•hu
Subject: Re: linux-next: proc tree build failure
Date: Fri, 28 Nov 2008 02:25:17 -0800 (PST) [thread overview]
Message-ID: <20081128.022517.12021740.davem@davemloft.net> (raw)
In-Reply-To: <20081128.010025.224611672.davem@davemloft.net>
From: David Miller <davem@davemloft•net>
Date: Fri, 28 Nov 2008 01:00:25 -0800 (PST)
> From: Alexey Dobriyan <adobriyan@gmail•com>
> Date: Fri, 28 Nov 2008 11:05:55 +0300
>
> > David, can you implement save_stack_trace_tsk() for sparc64? I have
> > no idea how to do it or is it doable at all.
>
> Sure thing Alexey.
I just pushed the following patch into sparc-next-2.6, so it
should show up in the next tree that Stephen builds:
sparc64: Add save_stack_trace_tsk().
And this allows us to indicate HAVE_LATENCYTOP_SUPPORT.
Signed-off-by: David S. Miller <davem@davemloft•net>
---
arch/sparc/Kconfig | 4 ++++
arch/sparc64/kernel/stacktrace.c | 32 +++++++++++++++++++++++---------
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 10945c3..e162535 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -72,6 +72,10 @@ config LOCKDEP_SUPPORT
bool
default y if SPARC64
+config HAVE_LATENCYTOP_SUPPORT
+ bool
+ default y if SPARC64
+
config AUDIT_ARCH
bool
default y if SPARC64
diff --git a/arch/sparc64/kernel/stacktrace.c b/arch/sparc64/kernel/stacktrace.c
index 4e21d4a..acb12f6 100644
--- a/arch/sparc64/kernel/stacktrace.c
+++ b/arch/sparc64/kernel/stacktrace.c
@@ -7,17 +7,18 @@
#include "kstack.h"
-void save_stack_trace(struct stack_trace *trace)
+static void __save_stack_trace(struct thread_info *tp,
+ struct stack_trace *trace,
+ bool skip_sched)
{
- struct thread_info *tp = task_thread_info(current);
unsigned long ksp, fp;
- stack_trace_flush();
-
- __asm__ __volatile__(
- "mov %%fp, %0"
- : "=r" (ksp)
- );
+ if (tp == current_thread_info()) {
+ stack_trace_flush();
+ __asm__ __volatile__("mov %%fp, %0" : "=r" (ksp));
+ } else {
+ ksp = tp->ksp;
+ }
fp = ksp + STACK_BIAS;
do {
@@ -43,8 +44,21 @@ void save_stack_trace(struct stack_trace *trace)
if (trace->skip > 0)
trace->skip--;
- else
+ else if (!skip_sched || !in_sched_functions(pc))
trace->entries[trace->nr_entries++] = pc;
} while (trace->nr_entries < trace->max_entries);
}
+
+void save_stack_trace(struct stack_trace *trace)
+{
+ __save_stack_trace(current_thread_info(), trace, false);
+}
EXPORT_SYMBOL_GPL(save_stack_trace);
+
+void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
+{
+ struct thread_info *tp = task_thread_info(tsk);
+
+ __save_stack_trace(tp, trace, true);
+}
+EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
--
1.5.6.5
next prev parent reply other threads:[~2008-11-28 10:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-24 7:15 linux-next: proc tree build failure Stephen Rothwell
2008-11-28 8:05 ` Alexey Dobriyan
2008-11-28 9:00 ` David Miller
2008-11-28 10:25 ` David Miller [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-03-30 6:43 Stephen Rothwell
2009-01-23 6:15 Stephen Rothwell
2009-01-23 7:09 ` Cyrill Gorcunov
2009-01-23 18:48 ` Alexey Dobriyan
2009-01-23 19:26 ` Cyrill Gorcunov
2009-01-23 19:41 ` Cyrill Gorcunov
2009-01-23 20:26 ` Cyrill Gorcunov
2008-11-20 6:24 Stephen Rothwell
2008-11-20 8:43 ` Eric W. Biederman
2008-11-10 5:29 Stephen Rothwell
2008-11-10 5:53 ` Alexey Dobriyan
2008-11-10 7:36 ` Ingo Molnar
2008-10-21 7:21 Stephen Rothwell
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=20081128.022517.12021740.davem@davemloft.net \
--to=davem@davemloft$(echo .)net \
--cc=adobriyan@gmail$(echo .)com \
--cc=kenchen@google$(echo .)com \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=mingo@elte$(echo .)hu \
--cc=sfr@canb$(echo .)auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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