diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2007-02-13 07:26:21 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-02-13 07:26:21 -0500 |
commit | 006e84ee3a54e393ec6bef2a9bc891dc5bde2843 (patch) | |
tree | 1b30e4a1128ca880d7b91a7b994e0b268686bf06 /arch/x86_64 | |
parent | 5558870bfbcca10cfc7b13ab866687012ea3c9af (diff) |
[PATCH] x86-64: do not always end the stack trace with ULONG_MAX
It makes more sense to end the stack trace with ULONG_MAX only if
nr_entries < max_entries. Otherwise, we lose one entry in the long stack
traces and cannot know whether the trace was complete or not.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Cc: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/stacktrace.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86_64/kernel/stacktrace.c b/arch/x86_64/kernel/stacktrace.c index 6026b31d037e..65ac2c6b34a6 100644 --- a/arch/x86_64/kernel/stacktrace.c +++ b/arch/x86_64/kernel/stacktrace.c | |||
@@ -32,7 +32,7 @@ static void save_stack_address(void *data, unsigned long addr) | |||
32 | trace->skip--; | 32 | trace->skip--; |
33 | return; | 33 | return; |
34 | } | 34 | } |
35 | if (trace->nr_entries < trace->max_entries - 1) | 35 | if (trace->nr_entries < trace->max_entries) |
36 | trace->entries[trace->nr_entries++] = addr; | 36 | trace->entries[trace->nr_entries++] = addr; |
37 | } | 37 | } |
38 | 38 | ||
@@ -49,7 +49,8 @@ static struct stacktrace_ops save_stack_ops = { | |||
49 | void save_stack_trace(struct stack_trace *trace, struct task_struct *task) | 49 | void save_stack_trace(struct stack_trace *trace, struct task_struct *task) |
50 | { | 50 | { |
51 | dump_trace(task, NULL, NULL, &save_stack_ops, trace); | 51 | dump_trace(task, NULL, NULL, &save_stack_ops, trace); |
52 | trace->entries[trace->nr_entries++] = ULONG_MAX; | 52 | if (trace->nr_entries < trace->max_entries) |
53 | trace->entries[trace->nr_entries++] = ULONG_MAX; | ||
53 | } | 54 | } |
54 | EXPORT_SYMBOL(save_stack_trace); | 55 | EXPORT_SYMBOL(save_stack_trace); |
55 | 56 | ||