Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100611
b: refs/heads/master
c: 2039238
h: refs/heads/master
i:
  100609: c0e59af
  100607: 4abbdf9
v: v3
  • Loading branch information
Pekka Paalanen authored and Thomas Gleixner committed May 24, 2008
1 parent 5a0cce9 commit 308ffa1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d0a7e8ca5b996d36219e6fc002907291c8ee677b
refs/heads/master: 2039238b79b51a50f8477f53f33750e1c3fc146a
25 changes: 25 additions & 0 deletions trunk/kernel/trace/trace_mmiotrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ struct header_iter {
};

static struct trace_array *mmio_trace_array;
static bool overrun_detected;

static void mmio_reset_data(struct trace_array *tr)
{
int cpu;

overrun_detected = false;
tr->time_start = ftrace_now(tr->cpu);

for_each_online_cpu(cpu)
Expand Down Expand Up @@ -124,12 +126,34 @@ static void mmio_close(struct trace_iterator *iter)
iter->private = NULL;
}

static unsigned long count_overruns(struct trace_iterator *iter)
{
int cpu;
unsigned long cnt = 0;
for_each_online_cpu(cpu) {
cnt += iter->overrun[cpu];
iter->overrun[cpu] = 0;
}
return cnt;
}

static ssize_t mmio_read(struct trace_iterator *iter, struct file *filp,
char __user *ubuf, size_t cnt, loff_t *ppos)
{
ssize_t ret;
struct header_iter *hiter = iter->private;
struct trace_seq *s = &iter->seq;
unsigned long n;

n = count_overruns(iter);
if (n) {
/* XXX: This is later than where events were lost. */
trace_seq_printf(s, "MARK 0.000000 Lost %lu events.\n", n);
if (!overrun_detected)
pr_warning("mmiotrace has lost events.\n");
overrun_detected = true;
goto print_out;
}

if (!hiter)
return 0;
Expand All @@ -142,6 +166,7 @@ static ssize_t mmio_read(struct trace_iterator *iter, struct file *filp,
iter->private = NULL;
}

print_out:
ret = trace_seq_to_user(s, ubuf, cnt);
return (ret == -EBUSY) ? 0 : ret;
}
Expand Down

0 comments on commit 308ffa1

Please sign in to comment.