diff options
author | kaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-06-04 13:51:17 +0000 |
---|---|---|
committer | kaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-06-04 13:51:17 +0000 |
commit | fc35f54386655faec7483c691ca12c00c226a813 (patch) | |
tree | b23043472ad11463f5e978310b30d1cebd104bb1 /target/linux/orion/patches/001-latencytop_support.patch | |
parent | 42bda49cb1b8eeefdeafd4dc6b37f8c80dad3942 (diff) |
add preliminary Marvell Orion support
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11352 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/orion/patches/001-latencytop_support.patch')
-rw-r--r-- | target/linux/orion/patches/001-latencytop_support.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/target/linux/orion/patches/001-latencytop_support.patch b/target/linux/orion/patches/001-latencytop_support.patch new file mode 100644 index 000000000..a1fbc17f5 --- /dev/null +++ b/target/linux/orion/patches/001-latencytop_support.patch @@ -0,0 +1,82 @@ +From: Nicolas Pitre <nico@cam.org> + +Signed-off-by: Nicolas Pitre <nico@marvell.com> +Tested-by: Lennert Buytenhek <buytenh@marvell.com> +Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> +--- + arch/arm/Kconfig | 4 ++++ + arch/arm/kernel/stacktrace.c | 26 ++++++++++++++++++++++---- + 2 files changed, 26 insertions(+), 4 deletions(-) + +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -84,6 +84,10 @@ + bool + default y + ++config HAVE_LATENCYTOP_SUPPORT ++ bool ++ default y ++ + config LOCKDEP_SUPPORT + bool + default y +--- a/arch/arm/kernel/stacktrace.c ++++ b/arch/arm/kernel/stacktrace.c +@@ -36,6 +36,7 @@ + #ifdef CONFIG_STACKTRACE + struct stack_trace_data { + struct stack_trace *trace; ++ unsigned int no_sched_functions; + unsigned int skip; + }; + +@@ -43,27 +44,44 @@ + { + struct stack_trace_data *data = d; + struct stack_trace *trace = data->trace; ++ unsigned long addr = frame->lr; + ++ if (data->no_sched_functions && in_sched_functions(addr)) ++ return 0; + if (data->skip) { + data->skip--; + return 0; + } + +- trace->entries[trace->nr_entries++] = frame->lr; ++ trace->entries[trace->nr_entries++] = addr; + + return trace->nr_entries >= trace->max_entries; + } + +-void save_stack_trace(struct stack_trace *trace) ++void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) + { + struct stack_trace_data data; + unsigned long fp, base; + + data.trace = trace; + data.skip = trace->skip; +- base = (unsigned long)task_stack_page(current); +- asm("mov %0, fp" : "=r" (fp)); ++ base = (unsigned long)task_stack_page(tsk); ++ ++ if (tsk != current) { ++ data.no_sched_functions = 1; ++ fp = thread_saved_fp(tsk); ++ } else { ++ data.no_sched_functions = 0; ++ asm("mov %0, fp" : "=r" (fp)); ++ } + + walk_stackframe(fp, base, base + THREAD_SIZE, save_trace, &data); ++ if (trace->nr_entries < trace->max_entries) ++ trace->entries[trace->nr_entries++] = ULONG_MAX; ++} ++ ++void save_stack_trace(struct stack_trace *trace) ++{ ++ save_stack_trace_tsk(current, trace); + } + #endif |