aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_output.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-05 10:50:29 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-05 10:50:29 -0400
commit918143e8b7d6153d7a83a3f854323407939f4a7e (patch)
tree34c0b1434516d146fc3811a6d071b052dd59342b /kernel/trace/trace_output.c
parent64edbc562034f2ec3fce382cb208fab40586d005 (diff)
parent563af16c30ede41eda2d614195d88e07f7c7103d (diff)
Merge branch 'tip/tracing/ftrace-4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
Diffstat (limited to 'kernel/trace/trace_output.c')
-rw-r--r--kernel/trace/trace_output.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 0fe3b223f7ed..425725c1622d 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -223,10 +223,9 @@ ftrace_print_flags_seq(struct trace_seq *p, const char *delim,
223{ 223{
224 unsigned long mask; 224 unsigned long mask;
225 const char *str; 225 const char *str;
226 const char *ret = p->buffer + p->len;
226 int i; 227 int i;
227 228
228 trace_seq_init(p);
229
230 for (i = 0; flag_array[i].name && flags; i++) { 229 for (i = 0; flag_array[i].name && flags; i++) {
231 230
232 mask = flag_array[i].mask; 231 mask = flag_array[i].mask;
@@ -249,7 +248,7 @@ ftrace_print_flags_seq(struct trace_seq *p, const char *delim,
249 248
250 trace_seq_putc(p, 0); 249 trace_seq_putc(p, 0);
251 250
252 return p->buffer; 251 return ret;
253} 252}
254EXPORT_SYMBOL(ftrace_print_flags_seq); 253EXPORT_SYMBOL(ftrace_print_flags_seq);
255 254
@@ -258,8 +257,7 @@ ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val,
258 const struct trace_print_flags *symbol_array) 257 const struct trace_print_flags *symbol_array)
259{ 258{
260 int i; 259 int i;
261 260 const char *ret = p->buffer + p->len;
262 trace_seq_init(p);
263 261
264 for (i = 0; symbol_array[i].name; i++) { 262 for (i = 0; symbol_array[i].name; i++) {
265 263
@@ -275,7 +273,7 @@ ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val,
275 273
276 trace_seq_putc(p, 0); 274 trace_seq_putc(p, 0);
277 275
278 return p->buffer; 276 return ret;
279} 277}
280EXPORT_SYMBOL(ftrace_print_symbols_seq); 278EXPORT_SYMBOL(ftrace_print_symbols_seq);
281 279
@@ -389,17 +387,20 @@ seq_print_userip_objs(const struct userstack_entry *entry, struct trace_seq *s,
389 387
390 if (ip == ULONG_MAX || !ret) 388 if (ip == ULONG_MAX || !ret)
391 break; 389 break;
392 if (i && ret) 390 if (ret)
393 ret = trace_seq_puts(s, " <- "); 391 ret = trace_seq_puts(s, " => ");
394 if (!ip) { 392 if (!ip) {
395 if (ret) 393 if (ret)
396 ret = trace_seq_puts(s, "??"); 394 ret = trace_seq_puts(s, "??");
395 if (ret)
396 ret = trace_seq_puts(s, "\n");
397 continue; 397 continue;
398 } 398 }
399 if (!ret) 399 if (!ret)
400 break; 400 break;
401 if (ret) 401 if (ret)
402 ret = seq_print_user_ip(s, mm, ip, sym_flags); 402 ret = seq_print_user_ip(s, mm, ip, sym_flags);
403 ret = trace_seq_puts(s, "\n");
403 } 404 }
404 405
405 if (mm) 406 if (mm)
@@ -975,16 +976,16 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter,
975 976
976 trace_assign_type(field, iter->ent); 977 trace_assign_type(field, iter->ent);
977 978
979 if (!trace_seq_puts(s, "<stack trace>\n"))
980 goto partial;
978 for (i = 0; i < FTRACE_STACK_ENTRIES; i++) { 981 for (i = 0; i < FTRACE_STACK_ENTRIES; i++) {
979 if (!field->caller[i]) 982 if (!field->caller[i] || (field->caller[i] == ULONG_MAX))
980 break; 983 break;
981 if (i) { 984 if (!trace_seq_puts(s, " => "))
982 if (!trace_seq_puts(s, " <= ")) 985 goto partial;
983 goto partial;
984 986
985 if (!seq_print_ip_sym(s, field->caller[i], flags)) 987 if (!seq_print_ip_sym(s, field->caller[i], flags))
986 goto partial; 988 goto partial;
987 }
988 if (!trace_seq_puts(s, "\n")) 989 if (!trace_seq_puts(s, "\n"))
989 goto partial; 990 goto partial;
990 } 991 }
@@ -1012,10 +1013,10 @@ static enum print_line_t trace_user_stack_print(struct trace_iterator *iter,
1012 1013
1013 trace_assign_type(field, iter->ent); 1014 trace_assign_type(field, iter->ent);
1014 1015
1015 if (!seq_print_userip_objs(field, s, flags)) 1016 if (!trace_seq_puts(s, "<user stack trace>\n"))
1016 goto partial; 1017 goto partial;
1017 1018
1018 if (!trace_seq_putc(s, '\n')) 1019 if (!seq_print_userip_objs(field, s, flags))
1019 goto partial; 1020 goto partial;
1020 1021
1021 return TRACE_TYPE_HANDLED; 1022 return TRACE_TYPE_HANDLED;