Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140619
b: refs/heads/master
c: 173ed24
h: refs/heads/master
i:
  140617: 3d047d2
  140615: f8f1a0d
v: v3
  • Loading branch information
Pekka Paalanen authored and Ingo Molnar committed Jan 11, 2009
1 parent 84a2d6a commit 0e8615e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe6f90e57fd31af8daca534ea01db2e5666c15da
refs/heads/master: 173ed24ee2d64f5de28654eb456ec1ee18a142e5
14 changes: 10 additions & 4 deletions trunk/kernel/trace/trace_mmiotrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/kernel.h>
#include <linux/mmiotrace.h>
#include <linux/pci.h>
#include <asm/atomic.h>

#include "trace.h"
#include "trace_output.h"
Expand All @@ -20,6 +21,7 @@ struct header_iter {
static struct trace_array *mmio_trace_array;
static bool overrun_detected;
static unsigned long prev_overruns;
static atomic_t dropped_count;

static void mmio_reset_data(struct trace_array *tr)
{
Expand Down Expand Up @@ -122,11 +124,11 @@ static void mmio_close(struct trace_iterator *iter)

static unsigned long count_overruns(struct trace_iterator *iter)
{
unsigned long cnt = 0;
unsigned long cnt = atomic_xchg(&dropped_count, 0);
unsigned long over = ring_buffer_overruns(iter->tr->buffer);

if (over > prev_overruns)
cnt = over - prev_overruns;
cnt += over - prev_overruns;
prev_overruns = over;
return cnt;
}
Expand Down Expand Up @@ -308,8 +310,10 @@ static void __trace_mmiotrace_rw(struct trace_array *tr,

event = ring_buffer_lock_reserve(tr->buffer, sizeof(*entry),
&irq_flags);
if (!event)
if (!event) {
atomic_inc(&dropped_count);
return;
}
entry = ring_buffer_event_data(event);
tracing_generic_entry_update(&entry->ent, 0, preempt_count());
entry->ent.type = TRACE_MMIO_RW;
Expand All @@ -336,8 +340,10 @@ static void __trace_mmiotrace_map(struct trace_array *tr,

event = ring_buffer_lock_reserve(tr->buffer, sizeof(*entry),
&irq_flags);
if (!event)
if (!event) {
atomic_inc(&dropped_count);
return;
}
entry = ring_buffer_event_data(event);
tracing_generic_entry_update(&entry->ent, 0, preempt_count());
entry->ent.type = TRACE_MMIO_MAP;
Expand Down

0 comments on commit 0e8615e

Please sign in to comment.