summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 21:20:46 +0200
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 20:43:05 +0200
commit8c523a9d82dbc4f3f7d972df8c0f1eacd83d0d55 (patch)
tree2317fe9959c6720b29fc466c1ecb8a72ba638d92
parentcdd31cd2d7a0dcbec2cce3974f7129dd4fc8c879 (diff)
ftrace: clean-up-pipe-iteration
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/trace/trace.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index ce8ceb8aea6a..42f1926acf73 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -770,12 +770,12 @@ find_next_entry(struct trace_iterator *iter, int *ent_cpu)
return next;
}
-static notrace void
-trace_iterator_increment(struct trace_iterator *iter)
+static notrace void trace_iterator_increment(struct trace_iterator *iter)
{
iter->idx++;
iter->next_idx[iter->cpu]++;
iter->next_page_idx[iter->cpu]++;
+
if (iter->next_page_idx[iter->cpu] >= ENTRIES_PER_PAGE) {
struct trace_array_cpu *data = iter->tr->data[iter->cpu];
@@ -785,8 +785,7 @@ trace_iterator_increment(struct trace_iterator *iter)
}
}
-static notrace void
-trace_consume(struct trace_iterator *iter)
+static notrace void trace_consume(struct trace_iterator *iter)
{
struct trace_array_cpu *data = iter->tr->data[iter->cpu];
@@ -802,8 +801,7 @@ trace_consume(struct trace_iterator *iter)
data->trace_idx = 0;
}
-static notrace void *
-find_next_entry_inc(struct trace_iterator *iter)
+static notrace void *find_next_entry_inc(struct trace_iterator *iter)
{
struct trace_entry *next;
int next_cpu = -1;
@@ -1871,14 +1869,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
cpu_set(cpu, mask);
}
- while ((entry = find_next_entry(iter, &cpu))) {
-
- if (!entry)
- break;
-
- iter->ent = entry;
- iter->cpu = cpu;
-
+ while ((entry = find_next_entry_inc(iter)) != NULL) {
ret = print_trace_fmt(iter);
if (!ret)
break;
@@ -1887,7 +1878,6 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
if (iter->seq.len >= cnt)
break;
-
}
for_each_cpu_mask(cpu, mask) {