aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 15:20:46 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 14:43:05 -0400
commit8c523a9d82dbc4f3f7d972df8c0f1eacd83d0d55 (patch)
tree2317fe9959c6720b29fc466c1ecb8a72ba638d92 /kernel
parentcdd31cd2d7a0dcbec2cce3974f7129dd4fc8c879 (diff)
ftrace: clean-up-pipe-iteration
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-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)
770 return next; 770 return next;
771} 771}
772 772
773static notrace void 773static notrace void trace_iterator_increment(struct trace_iterator *iter)
774trace_iterator_increment(struct trace_iterator *iter)
775{ 774{
776 iter->idx++; 775 iter->idx++;
777 iter->next_idx[iter->cpu]++; 776 iter->next_idx[iter->cpu]++;
778 iter->next_page_idx[iter->cpu]++; 777 iter->next_page_idx[iter->cpu]++;
778
779 if (iter->next_page_idx[iter->cpu] >= ENTRIES_PER_PAGE) { 779 if (iter->next_page_idx[iter->cpu] >= ENTRIES_PER_PAGE) {
780 struct trace_array_cpu *data = iter->tr->data[iter->cpu]; 780 struct trace_array_cpu *data = iter->tr->data[iter->cpu];
781 781
@@ -785,8 +785,7 @@ trace_iterator_increment(struct trace_iterator *iter)
785 } 785 }
786} 786}
787 787
788static notrace void 788static notrace void trace_consume(struct trace_iterator *iter)
789trace_consume(struct trace_iterator *iter)
790{ 789{
791 struct trace_array_cpu *data = iter->tr->data[iter->cpu]; 790 struct trace_array_cpu *data = iter->tr->data[iter->cpu];
792 791
@@ -802,8 +801,7 @@ trace_consume(struct trace_iterator *iter)
802 data->trace_idx = 0; 801 data->trace_idx = 0;
803} 802}
804 803
805static notrace void * 804static notrace void *find_next_entry_inc(struct trace_iterator *iter)
806find_next_entry_inc(struct trace_iterator *iter)
807{ 805{
808 struct trace_entry *next; 806 struct trace_entry *next;
809 int next_cpu = -1; 807 int next_cpu = -1;
@@ -1871,14 +1869,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
1871 cpu_set(cpu, mask); 1869 cpu_set(cpu, mask);
1872 } 1870 }
1873 1871
1874 while ((entry = find_next_entry(iter, &cpu))) { 1872 while ((entry = find_next_entry_inc(iter)) != NULL) {
1875
1876 if (!entry)
1877 break;
1878
1879 iter->ent = entry;
1880 iter->cpu = cpu;
1881
1882 ret = print_trace_fmt(iter); 1873 ret = print_trace_fmt(iter);
1883 if (!ret) 1874 if (!ret)
1884 break; 1875 break;
@@ -1887,7 +1878,6 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
1887 1878
1888 if (iter->seq.len >= cnt) 1879 if (iter->seq.len >= cnt)
1889 break; 1880 break;
1890
1891 } 1881 }
1892 1882
1893 for_each_cpu_mask(cpu, mask) { 1883 for_each_cpu_mask(cpu, mask) {