aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/oprofile/cpu_buffer.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index 01d38e78cde1..3958107723fb 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -127,9 +127,10 @@ void end_cpu_work(void)
127/* Resets the cpu buffer to a sane state. */ 127/* Resets the cpu buffer to a sane state. */
128void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf) 128void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf)
129{ 129{
130 /* reset these to invalid values; the next sample 130 /*
131 * collected will populate the buffer with proper 131 * reset these to invalid values; the next sample collected
132 * values to initialize the buffer 132 * will populate the buffer with proper values to initialize
133 * the buffer
133 */ 134 */
134 cpu_buf->last_is_kernel = -1; 135 cpu_buf->last_is_kernel = -1;
135 cpu_buf->last_task = NULL; 136 cpu_buf->last_task = NULL;
@@ -151,8 +152,10 @@ static void increment_head(struct oprofile_cpu_buffer *b)
151{ 152{
152 unsigned long new_head = b->head_pos + 1; 153 unsigned long new_head = b->head_pos + 1;
153 154
154 /* Ensure anything written to the slot before we 155 /*
155 * increment is visible */ 156 * Ensure anything written to the slot before we increment is
157 * visible
158 */
156 wmb(); 159 wmb();
157 160
158 if (new_head < b->buffer_size) 161 if (new_head < b->buffer_size)
@@ -253,8 +256,10 @@ void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
253 if (!oprofile_begin_trace(cpu_buf)) 256 if (!oprofile_begin_trace(cpu_buf))
254 return; 257 return;
255 258
256 /* if log_sample() fail we can't backtrace since we lost the source 259 /*
257 * of this event */ 260 * if log_sample() fail we can't backtrace since we lost the
261 * source of this event
262 */
258 if (log_sample(cpu_buf, pc, is_kernel, event)) 263 if (log_sample(cpu_buf, pc, is_kernel, event))
259 oprofile_ops.backtrace(regs, backtrace_depth); 264 oprofile_ops.backtrace(regs, backtrace_depth);
260 oprofile_end_trace(cpu_buf); 265 oprofile_end_trace(cpu_buf);
@@ -338,8 +343,10 @@ void oprofile_add_trace(unsigned long pc)
338 return; 343 return;
339 } 344 }
340 345
341 /* broken frame can give an eip with the same value as an escape code, 346 /*
342 * abort the trace if we get it */ 347 * broken frame can give an eip with the same value as an
348 * escape code, abort the trace if we get it
349 */
343 if (pc == ESCAPE_CODE) { 350 if (pc == ESCAPE_CODE) {
344 cpu_buf->tracing = 0; 351 cpu_buf->tracing = 0;
345 cpu_buf->backtrace_aborted++; 352 cpu_buf->backtrace_aborted++;