Commit d3b060231b2e1eb7e7e9680ff93326a4ae576720
Committed by
Benjamin Herrenschmidt
1 parent
d65d830ca0
Exists in
master
and in
7 other branches
powerpc: Removed duplicated include in stacktrace.c
Removed duplicated include file <linux/module.h> in arch/powerpc/kernel/stacktrace.c. Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Showing 1 changed file with 0 additions and 1 deletions Inline Diff
arch/powerpc/kernel/stacktrace.c
1 | /* | 1 | /* |
2 | * Stack trace utility | 2 | * Stack trace utility |
3 | * | 3 | * |
4 | * Copyright 2008 Christoph Hellwig, IBM Corp. | 4 | * Copyright 2008 Christoph Hellwig, IBM Corp. |
5 | * | 5 | * |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU General Public License | 8 | * modify it under the terms of the GNU General Public License |
9 | * as published by the Free Software Foundation; either version | 9 | * as published by the Free Software Foundation; either version |
10 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
15 | #include <linux/stacktrace.h> | 15 | #include <linux/stacktrace.h> |
16 | #include <linux/module.h> | ||
17 | #include <asm/ptrace.h> | 16 | #include <asm/ptrace.h> |
18 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
19 | 18 | ||
20 | /* | 19 | /* |
21 | * Save stack-backtrace addresses into a stack_trace buffer. | 20 | * Save stack-backtrace addresses into a stack_trace buffer. |
22 | */ | 21 | */ |
23 | static void save_context_stack(struct stack_trace *trace, unsigned long sp, | 22 | static void save_context_stack(struct stack_trace *trace, unsigned long sp, |
24 | struct task_struct *tsk, int savesched) | 23 | struct task_struct *tsk, int savesched) |
25 | { | 24 | { |
26 | for (;;) { | 25 | for (;;) { |
27 | unsigned long *stack = (unsigned long *) sp; | 26 | unsigned long *stack = (unsigned long *) sp; |
28 | unsigned long newsp, ip; | 27 | unsigned long newsp, ip; |
29 | 28 | ||
30 | if (!validate_sp(sp, tsk, STACK_FRAME_OVERHEAD)) | 29 | if (!validate_sp(sp, tsk, STACK_FRAME_OVERHEAD)) |
31 | return; | 30 | return; |
32 | 31 | ||
33 | newsp = stack[0]; | 32 | newsp = stack[0]; |
34 | ip = stack[STACK_FRAME_LR_SAVE]; | 33 | ip = stack[STACK_FRAME_LR_SAVE]; |
35 | 34 | ||
36 | if (savesched || !in_sched_functions(ip)) { | 35 | if (savesched || !in_sched_functions(ip)) { |
37 | if (!trace->skip) | 36 | if (!trace->skip) |
38 | trace->entries[trace->nr_entries++] = ip; | 37 | trace->entries[trace->nr_entries++] = ip; |
39 | else | 38 | else |
40 | trace->skip--; | 39 | trace->skip--; |
41 | } | 40 | } |
42 | 41 | ||
43 | if (trace->nr_entries >= trace->max_entries) | 42 | if (trace->nr_entries >= trace->max_entries) |
44 | return; | 43 | return; |
45 | 44 | ||
46 | sp = newsp; | 45 | sp = newsp; |
47 | } | 46 | } |
48 | } | 47 | } |
49 | 48 | ||
50 | void save_stack_trace(struct stack_trace *trace) | 49 | void save_stack_trace(struct stack_trace *trace) |
51 | { | 50 | { |
52 | unsigned long sp; | 51 | unsigned long sp; |
53 | 52 | ||
54 | asm("mr %0,1" : "=r" (sp)); | 53 | asm("mr %0,1" : "=r" (sp)); |
55 | 54 | ||
56 | save_context_stack(trace, sp, current, 1); | 55 | save_context_stack(trace, sp, current, 1); |
57 | } | 56 | } |
58 | EXPORT_SYMBOL_GPL(save_stack_trace); | 57 | EXPORT_SYMBOL_GPL(save_stack_trace); |
59 | 58 | ||
60 | void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) | 59 | void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) |
61 | { | 60 | { |
62 | save_context_stack(trace, tsk->thread.ksp, tsk, 0); | 61 | save_context_stack(trace, tsk->thread.ksp, tsk, 0); |
63 | } | 62 | } |
64 | EXPORT_SYMBOL_GPL(save_stack_trace_tsk); | 63 | EXPORT_SYMBOL_GPL(save_stack_trace_tsk); |
65 | 64 |