]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/trace/trace_mmiotrace.c
Merge branch 'topic/ca0106-resume' into topic/ca0106
[linux-2.6-omap-h63xx.git] / kernel / trace / trace_mmiotrace.c
index 0e819f47bb7a486453037473a35cda925e5d937b..e62cbf78eab6d6a6270a2a5c97f4ffc7ac443525 100644 (file)
@@ -18,12 +18,14 @@ struct header_iter {
 
 static struct trace_array *mmio_trace_array;
 static bool overrun_detected;
+static unsigned long prev_overruns;
 
 static void mmio_reset_data(struct trace_array *tr)
 {
        int cpu;
 
        overrun_detected = false;
+       prev_overruns = 0;
        tr->time_start = ftrace_now(tr->cpu);
 
        for_each_online_cpu(cpu)
@@ -128,16 +130,12 @@ static void mmio_close(struct trace_iterator *iter)
 
 static unsigned long count_overruns(struct trace_iterator *iter)
 {
-       int cpu;
        unsigned long cnt = 0;
-/* FIXME: */
-#if 0
-       for_each_online_cpu(cpu) {
-               cnt += iter->overrun[cpu];
-               iter->overrun[cpu] = 0;
-       }
-#endif
-       (void)cpu;
+       unsigned long over = ring_buffer_overruns(iter->tr->buffer);
+
+       if (over > prev_overruns)
+               cnt = over - prev_overruns;
+       prev_overruns = over;
        return cnt;
 }
 
@@ -324,7 +322,7 @@ static void __trace_mmiotrace_rw(struct trace_array *tr,
        if (!event)
                return;
        entry   = ring_buffer_event_data(event);
-       tracing_generic_entry_update(&entry->ent, 0);
+       tracing_generic_entry_update(&entry->ent, 0, preempt_count());
        entry->ent.type                 = TRACE_MMIO_RW;
        entry->rw                       = *rw;
        ring_buffer_unlock_commit(tr->buffer, event, irq_flags);
@@ -352,7 +350,7 @@ static void __trace_mmiotrace_map(struct trace_array *tr,
        if (!event)
                return;
        entry   = ring_buffer_event_data(event);
-       tracing_generic_entry_update(&entry->ent, 0);
+       tracing_generic_entry_update(&entry->ent, 0, preempt_count());
        entry->ent.type                 = TRACE_MMIO_MAP;
        entry->map                      = *map;
        ring_buffer_unlock_commit(tr->buffer, event, irq_flags);