aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-11-28 04:19:41 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-04 12:17:09 -0500
commit6a5726dd6fcc330ef386016e160389e05fd0015d (patch)
tree833607b0a7be8c8946eae1d3c7cd4ee7e1224bbb /arch/sparc64
parent3a29db32220387cd66e4d02c907c8949c28c5ecb (diff)
sparc64: Add save_stack_trace_tsk().
And this allows us to indicate HAVE_LATENCYTOP_SUPPORT. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/stacktrace.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/stacktrace.c b/arch/sparc64/kernel/stacktrace.c
index 4e21d4a57d3b..acb12f673757 100644
--- a/arch/sparc64/kernel/stacktrace.c
+++ b/arch/sparc64/kernel/stacktrace.c
@@ -7,17 +7,18 @@
7 7
8#include "kstack.h" 8#include "kstack.h"
9 9
10void save_stack_trace(struct stack_trace *trace) 10static void __save_stack_trace(struct thread_info *tp,
11 struct stack_trace *trace,
12 bool skip_sched)
11{ 13{
12 struct thread_info *tp = task_thread_info(current);
13 unsigned long ksp, fp; 14 unsigned long ksp, fp;
14 15
15 stack_trace_flush(); 16 if (tp == current_thread_info()) {
16 17 stack_trace_flush();
17 __asm__ __volatile__( 18 __asm__ __volatile__("mov %%fp, %0" : "=r" (ksp));
18 "mov %%fp, %0" 19 } else {
19 : "=r" (ksp) 20 ksp = tp->ksp;
20 ); 21 }
21 22
22 fp = ksp + STACK_BIAS; 23 fp = ksp + STACK_BIAS;
23 do { 24 do {
@@ -43,8 +44,21 @@ void save_stack_trace(struct stack_trace *trace)
43 44
44 if (trace->skip > 0) 45 if (trace->skip > 0)
45 trace->skip--; 46 trace->skip--;
46 else 47 else if (!skip_sched || !in_sched_functions(pc))
47 trace->entries[trace->nr_entries++] = pc; 48 trace->entries[trace->nr_entries++] = pc;
48 } while (trace->nr_entries < trace->max_entries); 49 } while (trace->nr_entries < trace->max_entries);
49} 50}
51
52void save_stack_trace(struct stack_trace *trace)
53{
54 __save_stack_trace(current_thread_info(), trace, false);
55}
50EXPORT_SYMBOL_GPL(save_stack_trace); 56EXPORT_SYMBOL_GPL(save_stack_trace);
57
58void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
59{
60 struct thread_info *tp = task_thread_info(tsk);
61
62 __save_stack_trace(tp, trace, true);
63}
64EXPORT_SYMBOL_GPL(save_stack_trace_tsk);