[adm5120] add button devices to several boards
[openwrt.git] / target / linux / orion / patches / 001-latencytop_support.patch
1 From: Nicolas Pitre <nico@cam.org>
2
3 Signed-off-by: Nicolas Pitre <nico@marvell.com>
4 Tested-by: Lennert Buytenhek <buytenh@marvell.com>
5 Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
6 ---
7 arch/arm/Kconfig | 4 ++++
8 arch/arm/kernel/stacktrace.c | 26 ++++++++++++++++++++++----
9 2 files changed, 26 insertions(+), 4 deletions(-)
10
11 --- a/arch/arm/Kconfig
12 +++ b/arch/arm/Kconfig
13 @@ -84,6 +84,10 @@
14 bool
15 default y
16
17 +config HAVE_LATENCYTOP_SUPPORT
18 + bool
19 + default y
20 +
21 config LOCKDEP_SUPPORT
22 bool
23 default y
24 --- a/arch/arm/kernel/stacktrace.c
25 +++ b/arch/arm/kernel/stacktrace.c
26 @@ -36,6 +36,7 @@
27 #ifdef CONFIG_STACKTRACE
28 struct stack_trace_data {
29 struct stack_trace *trace;
30 + unsigned int no_sched_functions;
31 unsigned int skip;
32 };
33
34 @@ -43,27 +44,44 @@
35 {
36 struct stack_trace_data *data = d;
37 struct stack_trace *trace = data->trace;
38 + unsigned long addr = frame->lr;
39
40 + if (data->no_sched_functions && in_sched_functions(addr))
41 + return 0;
42 if (data->skip) {
43 data->skip--;
44 return 0;
45 }
46
47 - trace->entries[trace->nr_entries++] = frame->lr;
48 + trace->entries[trace->nr_entries++] = addr;
49
50 return trace->nr_entries >= trace->max_entries;
51 }
52
53 -void save_stack_trace(struct stack_trace *trace)
54 +void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
55 {
56 struct stack_trace_data data;
57 unsigned long fp, base;
58
59 data.trace = trace;
60 data.skip = trace->skip;
61 - base = (unsigned long)task_stack_page(current);
62 - asm("mov %0, fp" : "=r" (fp));
63 + base = (unsigned long)task_stack_page(tsk);
64 +
65 + if (tsk != current) {
66 + data.no_sched_functions = 1;
67 + fp = thread_saved_fp(tsk);
68 + } else {
69 + data.no_sched_functions = 0;
70 + asm("mov %0, fp" : "=r" (fp));
71 + }
72
73 walk_stackframe(fp, base, base + THREAD_SIZE, save_trace, &data);
74 + if (trace->nr_entries < trace->max_entries)
75 + trace->entries[trace->nr_entries++] = ULONG_MAX;
76 +}
77 +
78 +void save_stack_trace(struct stack_trace *trace)
79 +{
80 + save_stack_trace_tsk(current, trace);
81 }
82 #endif
This page took 0.047219 seconds and 5 git commands to generate.