aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-12-23 23:24:11 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-29 06:46:10 -0500
commitc47956d9ae3341d2d1998bff26620fa3338c01e4 (patch)
treef6b3569f070ec8fe1a999985b2e8909cd9792785
parent0f01f07fad4ee11d98fe6faa442afbeb0328a378 (diff)
ftrace: remove obsolete print continue functionality
Impact: cleanup, remove obsolete code Now that the ring buffer used by ftrace allows for variable length entries, we do not need the 'cont' feature of the buffer. This code makes other parts of ftrace more complex and by removing this it simplifies the ftrace code. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/trace/trace.c61
-rw-r--r--kernel/trace/trace.h7
-rw-r--r--kernel/trace/trace_functions_graph.c3
-rw-r--r--kernel/trace/trace_mmiotrace.c3
4 files changed, 0 insertions, 74 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f4bb3800318b..fca0233f1d73 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1765,43 +1765,6 @@ static int task_state_char(unsigned long state)
1765 return bit < sizeof(state_to_char) - 1 ? state_to_char[bit] : '?'; 1765 return bit < sizeof(state_to_char) - 1 ? state_to_char[bit] : '?';
1766} 1766}
1767 1767
1768/*
1769 * The message is supposed to contain an ending newline.
1770 * If the printing stops prematurely, try to add a newline of our own.
1771 */
1772void trace_seq_print_cont(struct trace_seq *s, struct trace_iterator *iter)
1773{
1774 struct trace_entry *ent;
1775 struct trace_field_cont *cont;
1776 bool ok = true;
1777
1778 ent = peek_next_entry(iter, iter->cpu, NULL);
1779 if (!ent || ent->type != TRACE_CONT) {
1780 trace_seq_putc(s, '\n');
1781 return;
1782 }
1783
1784 do {
1785 cont = (struct trace_field_cont *)ent;
1786 if (ok)
1787 ok = (trace_seq_printf(s, "%s", cont->buf) > 0);
1788
1789 ftrace_disable_cpu();
1790
1791 if (iter->buffer_iter[iter->cpu])
1792 ring_buffer_read(iter->buffer_iter[iter->cpu], NULL);
1793 else
1794 ring_buffer_consume(iter->tr->buffer, iter->cpu, NULL);
1795
1796 ftrace_enable_cpu();
1797
1798 ent = peek_next_entry(iter, iter->cpu, NULL);
1799 } while (ent && ent->type == TRACE_CONT);
1800
1801 if (!ok)
1802 trace_seq_putc(s, '\n');
1803}
1804
1805static void test_cpu_buff_start(struct trace_iterator *iter) 1768static void test_cpu_buff_start(struct trace_iterator *iter)
1806{ 1769{
1807 struct trace_seq *s = &iter->seq; 1770 struct trace_seq *s = &iter->seq;
@@ -1834,9 +1797,6 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu)
1834 int S, T; 1797 int S, T;
1835 int i; 1798 int i;
1836 1799
1837 if (entry->type == TRACE_CONT)
1838 return TRACE_TYPE_HANDLED;
1839
1840 test_cpu_buff_start(iter); 1800 test_cpu_buff_start(iter);
1841 1801
1842 next_entry = find_next_entry(iter, NULL, &next_ts); 1802 next_entry = find_next_entry(iter, NULL, &next_ts);
@@ -1922,8 +1882,6 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu)
1922 1882
1923 seq_print_ip_sym(s, field->ip, sym_flags); 1883 seq_print_ip_sym(s, field->ip, sym_flags);
1924 trace_seq_printf(s, ": %s", field->buf); 1884 trace_seq_printf(s, ": %s", field->buf);
1925 if (entry->flags & TRACE_FLAG_CONT)
1926 trace_seq_print_cont(s, iter);
1927 break; 1885 break;
1928 } 1886 }
1929 case TRACE_BRANCH: { 1887 case TRACE_BRANCH: {
@@ -1968,9 +1926,6 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter)
1968 1926
1969 entry = iter->ent; 1927 entry = iter->ent;
1970 1928
1971 if (entry->type == TRACE_CONT)
1972 return TRACE_TYPE_HANDLED;
1973
1974 test_cpu_buff_start(iter); 1929 test_cpu_buff_start(iter);
1975 1930
1976 comm = trace_find_cmdline(iter->ent->pid); 1931 comm = trace_find_cmdline(iter->ent->pid);
@@ -2076,8 +2031,6 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter)
2076 2031
2077 seq_print_ip_sym(s, field->ip, sym_flags); 2032 seq_print_ip_sym(s, field->ip, sym_flags);
2078 trace_seq_printf(s, ": %s", field->buf); 2033 trace_seq_printf(s, ": %s", field->buf);
2079 if (entry->flags & TRACE_FLAG_CONT)
2080 trace_seq_print_cont(s, iter);
2081 break; 2034 break;
2082 } 2035 }
2083 case TRACE_GRAPH_RET: { 2036 case TRACE_GRAPH_RET: {
@@ -2124,9 +2077,6 @@ static enum print_line_t print_raw_fmt(struct trace_iterator *iter)
2124 2077
2125 entry = iter->ent; 2078 entry = iter->ent;
2126 2079
2127 if (entry->type == TRACE_CONT)
2128 return TRACE_TYPE_HANDLED;
2129
2130 ret = trace_seq_printf(s, "%d %d %llu ", 2080 ret = trace_seq_printf(s, "%d %d %llu ",
2131 entry->pid, iter->cpu, iter->ts); 2081 entry->pid, iter->cpu, iter->ts);
2132 if (!ret) 2082 if (!ret)
@@ -2187,8 +2137,6 @@ static enum print_line_t print_raw_fmt(struct trace_iterator *iter)
2187 trace_assign_type(field, entry); 2137 trace_assign_type(field, entry);
2188 2138
2189 trace_seq_printf(s, "# %lx %s", field->ip, field->buf); 2139 trace_seq_printf(s, "# %lx %s", field->ip, field->buf);
2190 if (entry->flags & TRACE_FLAG_CONT)
2191 trace_seq_print_cont(s, iter);
2192 break; 2140 break;
2193 } 2141 }
2194 } 2142 }
@@ -2217,9 +2165,6 @@ static enum print_line_t print_hex_fmt(struct trace_iterator *iter)
2217 2165
2218 entry = iter->ent; 2166 entry = iter->ent;
2219 2167
2220 if (entry->type == TRACE_CONT)
2221 return TRACE_TYPE_HANDLED;
2222
2223 SEQ_PUT_HEX_FIELD_RET(s, entry->pid); 2168 SEQ_PUT_HEX_FIELD_RET(s, entry->pid);
2224 SEQ_PUT_HEX_FIELD_RET(s, iter->cpu); 2169 SEQ_PUT_HEX_FIELD_RET(s, iter->cpu);
2225 SEQ_PUT_HEX_FIELD_RET(s, iter->ts); 2170 SEQ_PUT_HEX_FIELD_RET(s, iter->ts);
@@ -2283,9 +2228,6 @@ static enum print_line_t print_printk_msg_only(struct trace_iterator *iter)
2283 if (!ret) 2228 if (!ret)
2284 return TRACE_TYPE_PARTIAL_LINE; 2229 return TRACE_TYPE_PARTIAL_LINE;
2285 2230
2286 if (entry->flags & TRACE_FLAG_CONT)
2287 trace_seq_print_cont(s, iter);
2288
2289 return TRACE_TYPE_HANDLED; 2231 return TRACE_TYPE_HANDLED;
2290} 2232}
2291 2233
@@ -2296,9 +2238,6 @@ static enum print_line_t print_bin_fmt(struct trace_iterator *iter)
2296 2238
2297 entry = iter->ent; 2239 entry = iter->ent;
2298 2240
2299 if (entry->type == TRACE_CONT)
2300 return TRACE_TYPE_HANDLED;
2301
2302 SEQ_PUT_FIELD_RET(s, entry->pid); 2241 SEQ_PUT_FIELD_RET(s, entry->pid);
2303 SEQ_PUT_FIELD_RET(s, entry->cpu); 2242 SEQ_PUT_FIELD_RET(s, entry->cpu);
2304 SEQ_PUT_FIELD_RET(s, iter->ts); 2243 SEQ_PUT_FIELD_RET(s, iter->ts);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index cc7a4f864036..3a357382cce6 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -16,7 +16,6 @@ enum trace_type {
16 TRACE_FN, 16 TRACE_FN,
17 TRACE_CTX, 17 TRACE_CTX,
18 TRACE_WAKE, 18 TRACE_WAKE,
19 TRACE_CONT,
20 TRACE_STACK, 19 TRACE_STACK,
21 TRACE_PRINT, 20 TRACE_PRINT,
22 TRACE_SPECIAL, 21 TRACE_SPECIAL,
@@ -178,7 +177,6 @@ struct trace_power {
178 * NEED_RESCED - reschedule is requested 177 * NEED_RESCED - reschedule is requested
179 * HARDIRQ - inside an interrupt handler 178 * HARDIRQ - inside an interrupt handler
180 * SOFTIRQ - inside a softirq handler 179 * SOFTIRQ - inside a softirq handler
181 * CONT - multiple entries hold the trace item
182 */ 180 */
183enum trace_flag_type { 181enum trace_flag_type {
184 TRACE_FLAG_IRQS_OFF = 0x01, 182 TRACE_FLAG_IRQS_OFF = 0x01,
@@ -186,7 +184,6 @@ enum trace_flag_type {
186 TRACE_FLAG_NEED_RESCHED = 0x04, 184 TRACE_FLAG_NEED_RESCHED = 0x04,
187 TRACE_FLAG_HARDIRQ = 0x08, 185 TRACE_FLAG_HARDIRQ = 0x08,
188 TRACE_FLAG_SOFTIRQ = 0x10, 186 TRACE_FLAG_SOFTIRQ = 0x10,
189 TRACE_FLAG_CONT = 0x20,
190}; 187};
191 188
192#define TRACE_BUF_SIZE 1024 189#define TRACE_BUF_SIZE 1024
@@ -262,7 +259,6 @@ extern void __ftrace_bad_type(void);
262 do { \ 259 do { \
263 IF_ASSIGN(var, ent, struct ftrace_entry, TRACE_FN); \ 260 IF_ASSIGN(var, ent, struct ftrace_entry, TRACE_FN); \
264 IF_ASSIGN(var, ent, struct ctx_switch_entry, 0); \ 261 IF_ASSIGN(var, ent, struct ctx_switch_entry, 0); \
265 IF_ASSIGN(var, ent, struct trace_field_cont, TRACE_CONT); \
266 IF_ASSIGN(var, ent, struct stack_entry, TRACE_STACK); \ 262 IF_ASSIGN(var, ent, struct stack_entry, TRACE_STACK); \
267 IF_ASSIGN(var, ent, struct userstack_entry, TRACE_USER_STACK);\ 263 IF_ASSIGN(var, ent, struct userstack_entry, TRACE_USER_STACK);\
268 IF_ASSIGN(var, ent, struct print_entry, TRACE_PRINT); \ 264 IF_ASSIGN(var, ent, struct print_entry, TRACE_PRINT); \
@@ -489,9 +485,6 @@ extern int trace_selftest_startup_branch(struct tracer *trace,
489 485
490extern void *head_page(struct trace_array_cpu *data); 486extern void *head_page(struct trace_array_cpu *data);
491extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...); 487extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...);
492extern void trace_seq_print_cont(struct trace_seq *s,
493 struct trace_iterator *iter);
494
495extern int 488extern int
496seq_print_ip_sym(struct trace_seq *s, unsigned long ip, 489seq_print_ip_sym(struct trace_seq *s, unsigned long ip,
497 unsigned long sym_flags); 490 unsigned long sym_flags);
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index bc7d90850be5..f261966e5b6c 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -589,9 +589,6 @@ print_graph_comment(struct print_entry *trace, struct trace_seq *s,
589 if (!ret) 589 if (!ret)
590 return TRACE_TYPE_PARTIAL_LINE; 590 return TRACE_TYPE_PARTIAL_LINE;
591 591
592 if (ent->flags & TRACE_FLAG_CONT)
593 trace_seq_print_cont(s, iter);
594
595 /* Strip ending newline */ 592 /* Strip ending newline */
596 if (s->buffer[s->len - 1] == '\n') { 593 if (s->buffer[s->len - 1] == '\n') {
597 s->buffer[s->len - 1] = '\0'; 594 s->buffer[s->len - 1] = '\0';
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c
index fffcb069f1dc..83f20ae6bd68 100644
--- a/kernel/trace/trace_mmiotrace.c
+++ b/kernel/trace/trace_mmiotrace.c
@@ -262,9 +262,6 @@ static enum print_line_t mmio_print_mark(struct trace_iterator *iter)
262 if (!ret) 262 if (!ret)
263 return TRACE_TYPE_PARTIAL_LINE; 263 return TRACE_TYPE_PARTIAL_LINE;
264 264
265 if (entry->flags & TRACE_FLAG_CONT)
266 trace_seq_print_cont(s, iter);
267
268 return TRACE_TYPE_HANDLED; 265 return TRACE_TYPE_HANDLED;
269} 266}
270 267