Merge branch 'for-linus' of git://github.com/richardweinberger/linux
[pandora-kernel.git] / kernel / trace / trace.c
index cea1605..f2bd275 100644 (file)
@@ -341,7 +341,7 @@ unsigned long trace_flags = TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK |
        TRACE_ITER_GRAPH_TIME | TRACE_ITER_RECORD_CMD | TRACE_ITER_OVERWRITE;
 
 static int trace_stop_count;
-static DEFINE_SPINLOCK(tracing_start_lock);
+static DEFINE_RAW_SPINLOCK(tracing_start_lock);
 
 static void wakeup_work_handler(struct work_struct *work)
 {
@@ -961,7 +961,7 @@ void tracing_start(void)
        if (tracing_disabled)
                return;
 
-       spin_lock_irqsave(&tracing_start_lock, flags);
+       raw_spin_lock_irqsave(&tracing_start_lock, flags);
        if (--trace_stop_count) {
                if (trace_stop_count < 0) {
                        /* Someone screwed up their debugging */
@@ -986,7 +986,7 @@ void tracing_start(void)
 
        ftrace_start();
  out:
-       spin_unlock_irqrestore(&tracing_start_lock, flags);
+       raw_spin_unlock_irqrestore(&tracing_start_lock, flags);
 }
 
 /**
@@ -1001,7 +1001,7 @@ void tracing_stop(void)
        unsigned long flags;
 
        ftrace_stop();
-       spin_lock_irqsave(&tracing_start_lock, flags);
+       raw_spin_lock_irqsave(&tracing_start_lock, flags);
        if (trace_stop_count++)
                goto out;
 
@@ -1019,7 +1019,7 @@ void tracing_stop(void)
        arch_spin_unlock(&ftrace_max_lock);
 
  out:
-       spin_unlock_irqrestore(&tracing_start_lock, flags);
+       raw_spin_unlock_irqrestore(&tracing_start_lock, flags);
 }
 
 void trace_stop_cmdline_recording(void);
@@ -3903,8 +3903,6 @@ tracing_buffers_read(struct file *filp, char __user *ubuf,
        if (info->read < PAGE_SIZE)
                goto read;
 
-       info->read = 0;
-
        trace_access_lock(info->cpu);
        ret = ring_buffer_read_page(info->tr->buffer,
                                    &info->spare,
@@ -3914,6 +3912,8 @@ tracing_buffers_read(struct file *filp, char __user *ubuf,
        if (ret < 0)
                return 0;
 
+       info->read = 0;
+
 read:
        size = PAGE_SIZE - info->read;
        if (size > count)