aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-02-10 00:10:27 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-22 18:48:53 -0500
commit6794c78243bfda020ab184d6d578944f8e90d26c (patch)
treee697b43e4b757723ed9798c9666b759d9e29ca12 /arch/powerpc/kernel/process.c
parent17be5b3ddf71d980f67fc826e49b00cd2afd724d (diff)
powerpc64: port of the function graph tracer
This is a port of the function graph tracer that was written by Frederic Weisbecker for the x86. This only works for PPC64 at the moment and only for static tracing. PPC32 and dynamic function graph tracing support will come later. The trace produces a visual calling of functions: # tracer: function_graph # # CPU DURATION FUNCTION CALLS # | | | | | | | 0) 2.224 us | } 0) ! 271.024 us | } 0) ! 320.080 us | } 0) ! 324.656 us | } 0) ! 329.136 us | } 0) | .put_prev_task_fair() { 0) | .update_curr() { 0) 2.240 us | .update_min_vruntime(); 0) 6.512 us | } 0) 2.528 us | .__enqueue_entity(); 0) + 15.536 us | } 0) | .pick_next_task_fair() { 0) 2.032 us | .__pick_next_entity(); 0) 2.064 us | .__clear_buddies(); 0) | .set_next_entity() { 0) 2.672 us | .__dequeue_entity(); 0) 6.864 us | } Geoff Lavand tested on PS3. Tested-by: Geoff Levand <geoffrey.levand@am.sony.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index fb7049c054c0..8ede428e76c0 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -33,6 +33,7 @@
33#include <linux/mqueue.h> 33#include <linux/mqueue.h>
34#include <linux/hardirq.h> 34#include <linux/hardirq.h>
35#include <linux/utsname.h> 35#include <linux/utsname.h>
36#include <linux/ftrace.h>
36#include <linux/kernel_stat.h> 37#include <linux/kernel_stat.h>
37 38
38#include <asm/pgtable.h> 39#include <asm/pgtable.h>
@@ -1008,6 +1009,14 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
1008 unsigned long sp, ip, lr, newsp; 1009 unsigned long sp, ip, lr, newsp;
1009 int count = 0; 1010 int count = 0;
1010 int firstframe = 1; 1011 int firstframe = 1;
1012#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1013 int curr_frame = current->curr_ret_stack;
1014 extern void return_to_handler(void);
1015 unsigned long addr = (unsigned long)return_to_handler;
1016#ifdef CONFIG_PPC64
1017 addr = *(unsigned long*)addr;
1018#endif
1019#endif
1011 1020
1012 sp = (unsigned long) stack; 1021 sp = (unsigned long) stack;
1013 if (tsk == NULL) 1022 if (tsk == NULL)
@@ -1030,6 +1039,13 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
1030 ip = stack[STACK_FRAME_LR_SAVE]; 1039 ip = stack[STACK_FRAME_LR_SAVE];
1031 if (!firstframe || ip != lr) { 1040 if (!firstframe || ip != lr) {
1032 printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip); 1041 printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
1042#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1043 if (ip == addr && curr_frame >= 0) {
1044 printk(" (%pS)",
1045 (void *)current->ret_stack[curr_frame].ret);
1046 curr_frame--;
1047 }
1048#endif
1033 if (firstframe) 1049 if (firstframe)
1034 printk(" (unreliable)"); 1050 printk(" (unreliable)");
1035 printk("\n"); 1051 printk("\n");