aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/stacktrace.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-08-14 12:11:37 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-08-14 12:11:37 -0400
commit606b4c992f3b28f906100f1b6eb49059909d8da7 (patch)
tree921f604e14276a2b55286fcfa13797f61e6d4240 /arch/sh/kernel/stacktrace.c
parentf9967e23c10f025d85bbf66a2a5f18f016890ccb (diff)
sh: stacktrace: Properly terminate the trace entry buffer.
This inserts a ULONG_MAX entry at the end of the valid entries in the stack trace buffer so the default code doesn't need to scan to the end of available slots. This also makes the trace buffer termination behaviour consistent with the other architectures. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/stacktrace.c')
-rw-r--r--arch/sh/kernel/stacktrace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sh/kernel/stacktrace.c b/arch/sh/kernel/stacktrace.c
index a0f497bcbb4f..c2e45c48409c 100644
--- a/arch/sh/kernel/stacktrace.c
+++ b/arch/sh/kernel/stacktrace.c
@@ -62,6 +62,8 @@ void save_stack_trace(struct stack_trace *trace)
62 unsigned long *sp = (unsigned long *)current_stack_pointer; 62 unsigned long *sp = (unsigned long *)current_stack_pointer;
63 63
64 unwind_stack(current, NULL, sp, &save_stack_ops, trace); 64 unwind_stack(current, NULL, sp, &save_stack_ops, trace);
65 if (trace->nr_entries < trace->max_entries)
66 trace->entries[trace->nr_entries++] = ULONG_MAX;
65} 67}
66EXPORT_SYMBOL_GPL(save_stack_trace); 68EXPORT_SYMBOL_GPL(save_stack_trace);
67 69
@@ -97,5 +99,7 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
97 unsigned long *sp = (unsigned long *)tsk->thread.sp; 99 unsigned long *sp = (unsigned long *)tsk->thread.sp;
98 100
99 unwind_stack(current, NULL, sp, &save_stack_ops_nosched, trace); 101 unwind_stack(current, NULL, sp, &save_stack_ops_nosched, trace);
102 if (trace->nr_entries < trace->max_entries)
103 trace->entries[trace->nr_entries++] = ULONG_MAX;
100} 104}
101EXPORT_SYMBOL_GPL(save_stack_trace_tsk); 105EXPORT_SYMBOL_GPL(save_stack_trace_tsk);