aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_irqsoff.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 15:20:45 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 14:40:46 -0400
commitc7aafc549766b87819285d3480648fc652a47bc4 (patch)
tree4c36170a644633f930feca57b27f8c5d23644e70 /kernel/trace/trace_irqsoff.c
parent60a11774b38fef1ab90b18c5353bd1c7c4d311c8 (diff)
ftrace: cleanups
factor out code and clean it up. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/trace/trace_irqsoff.c')
-rw-r--r--kernel/trace/trace_irqsoff.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
index 14183b8f79c5..2dfebb67fdfb 100644
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -144,7 +144,7 @@ check_critical_timing(struct trace_array *tr,
144 if (!report_latency(delta)) 144 if (!report_latency(delta))
145 goto out; 145 goto out;
146 146
147 spin_lock(&max_trace_lock); 147 spin_lock_irqsave(&max_trace_lock, flags);
148 148
149 /* check if we are still the max latency */ 149 /* check if we are still the max latency */
150 if (!report_latency(delta)) 150 if (!report_latency(delta))
@@ -165,32 +165,24 @@ check_critical_timing(struct trace_array *tr,
165 165
166 update_max_tr_single(tr, current, cpu); 166 update_max_tr_single(tr, current, cpu);
167 167
168 if (tracing_thresh) 168 if (tracing_thresh) {
169 printk(KERN_INFO "(%16s-%-5d|#%d): %lu us critical section " 169 printk(KERN_INFO "(%16s-%-5d|#%d):"
170 "violates %lu us threshold.\n" 170 " %lu us critical section violates %lu us threshold.\n",
171 " => started at timestamp %lu: ",
172 current->comm, current->pid, 171 current->comm, current->pid,
173 raw_smp_processor_id(), 172 raw_smp_processor_id(),
174 latency, nsecs_to_usecs(tracing_thresh), t0); 173 latency, nsecs_to_usecs(tracing_thresh));
175 else 174 } else {
176 printk(KERN_INFO "(%16s-%-5d|#%d):" 175 printk(KERN_INFO "(%16s-%-5d|#%d):"
177 " new %lu us maximum-latency " 176 " new %lu us maximum-latency critical section.\n",
178 "critical section.\n => started at timestamp %lu: ",
179 current->comm, current->pid, 177 current->comm, current->pid,
180 raw_smp_processor_id(), 178 raw_smp_processor_id(),
181 latency, t0); 179 latency);
182 180 }
183 print_symbol(KERN_CONT "<%s>\n", data->critical_start);
184 printk(KERN_CONT " => ended at timestamp %lu: ", t1);
185 print_symbol(KERN_CONT "<%s>\n", data->critical_end);
186 dump_stack();
187 t1 = nsecs_to_usecs(now(cpu));
188 printk(KERN_CONT " => dump-end timestamp %lu\n\n", t1);
189 181
190 max_sequence++; 182 max_sequence++;
191 183
192out_unlock: 184out_unlock:
193 spin_unlock(&max_trace_lock); 185 spin_unlock_irqrestore(&max_trace_lock, flags);
194 186
195out: 187out:
196 data->critical_sequence = max_sequence; 188 data->critical_sequence = max_sequence;
@@ -216,7 +208,7 @@ start_critical_timing(unsigned long ip, unsigned long parent_ip)
216 cpu = raw_smp_processor_id(); 208 cpu = raw_smp_processor_id();
217 data = tr->data[cpu]; 209 data = tr->data[cpu];
218 210
219 if (unlikely(!data) || unlikely(!data->trace) || 211 if (unlikely(!data) || unlikely(!head_page(data)) ||
220 atomic_read(&data->disabled)) 212 atomic_read(&data->disabled))
221 return; 213 return;
222 214
@@ -256,7 +248,7 @@ stop_critical_timing(unsigned long ip, unsigned long parent_ip)
256 cpu = raw_smp_processor_id(); 248 cpu = raw_smp_processor_id();
257 data = tr->data[cpu]; 249 data = tr->data[cpu];
258 250
259 if (unlikely(!data) || unlikely(!data->trace) || 251 if (unlikely(!data) || unlikely(!head_page(data)) ||
260 !data->critical_start || atomic_read(&data->disabled)) 252 !data->critical_start || atomic_read(&data->disabled))
261 return; 253 return;
262 254