aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/trace_sysprof.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/trace/trace_sysprof.c b/kernel/trace/trace_sysprof.c
index b78f12f77fca..7f6fcccffb88 100644
--- a/kernel/trace/trace_sysprof.c
+++ b/kernel/trace/trace_sysprof.c
@@ -23,6 +23,7 @@ static int __read_mostly tracer_enabled;
23 * 10 msecs for now: 23 * 10 msecs for now:
24 */ 24 */
25static const unsigned long sample_period = 1000000; 25static const unsigned long sample_period = 1000000;
26static const unsigned int sample_max_depth = 512;
26 27
27/* 28/*
28 * Per CPU hrtimers that do the profiling: 29 * Per CPU hrtimers that do the profiling:
@@ -45,8 +46,6 @@ static int copy_stack_frame(const void __user *fp, struct stack_frame *frame)
45 return 1; 46 return 1;
46} 47}
47 48
48#define SYSPROF_MAX_ADDRESSES 512
49
50static void timer_notify(struct pt_regs *regs, int cpu) 49static void timer_notify(struct pt_regs *regs, int cpu)
51{ 50{
52 const void __user *frame_pointer; 51 const void __user *frame_pointer;
@@ -80,7 +79,7 @@ static void timer_notify(struct pt_regs *regs, int cpu)
80 79
81 frame_pointer = (void __user *)regs->bp; 80 frame_pointer = (void __user *)regs->bp;
82 81
83 for (i = 0; i < SYSPROF_MAX_ADDRESSES; i++) { 82 for (i = 0; i < sample_max_depth; i++) {
84 if (!copy_stack_frame(frame_pointer, &frame)) 83 if (!copy_stack_frame(frame_pointer, &frame))
85 break; 84 break;
86 if ((unsigned long)frame_pointer < regs->sp) 85 if ((unsigned long)frame_pointer < regs->sp)
@@ -93,7 +92,7 @@ static void timer_notify(struct pt_regs *regs, int cpu)
93 92
94 trace_special(tr, data, 2, current->pid, i); 93 trace_special(tr, data, 2, current->pid, i);
95 94
96 if (i == SYSPROF_MAX_ADDRESSES) 95 if (i == sample_max_depth)
97 trace_special(tr, data, -1, -1, -1); 96 trace_special(tr, data, -1, -1, -1);
98} 97}
99 98
@@ -126,7 +125,6 @@ static void start_stack_timers(void)
126 for_each_online_cpu(cpu) { 125 for_each_online_cpu(cpu) {
127 set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 126 set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
128 start_stack_timer(cpu); 127 start_stack_timer(cpu);
129 printk(KERN_INFO "started sysprof timer on cpu%d\n", cpu);
130 } 128 }
131 set_cpus_allowed_ptr(current, &saved_mask); 129 set_cpus_allowed_ptr(current, &saved_mask);
132} 130}
@@ -136,7 +134,6 @@ static void stop_stack_timer(int cpu)
136 struct hrtimer *hrtimer = &per_cpu(stack_trace_hrtimer, cpu); 134 struct hrtimer *hrtimer = &per_cpu(stack_trace_hrtimer, cpu);
137 135
138 hrtimer_cancel(hrtimer); 136 hrtimer_cancel(hrtimer);
139 printk(KERN_INFO "cancelled sysprof timer on cpu%d\n", cpu);
140} 137}
141 138
142static void stop_stack_timers(void) 139static void stop_stack_timers(void)