aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2009-01-15 05:05:40 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-16 06:15:20 -0500
commit6c1a99afbda99cd8d8c69d756387041567a13d87 (patch)
tree8f8c9d5cb072bb6d9f83f82c81cf81c123579863 /kernel
parent55922173f1f63903b6de03711ab8ff980cbe58d2 (diff)
ftrace: fix trace_output
Impact: fix bug for handling partial line trace_seq_printf(), seq_print_userip_objs(), ... return 0 -- partial line was written other(>0) -- success duplicate output is also removed in trace_print_raw(). Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_output.c65
-rw-r--r--kernel/trace/trace_output.h4
2 files changed, 33 insertions, 36 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index df0c25cbed30..4e3ad36b117c 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -440,9 +440,9 @@ trace_fn_raw(struct trace_seq *s, struct trace_entry *entry, int flags)
440 440
441 trace_assign_type(field, entry); 441 trace_assign_type(field, entry);
442 442
443 if (trace_seq_printf(s, "%x %x\n", 443 if (!trace_seq_printf(s, "%x %x\n",
444 field->ip, 444 field->ip,
445 field->parent_ip)) 445 field->parent_ip))
446 return TRACE_TYPE_PARTIAL_LINE; 446 return TRACE_TYPE_PARTIAL_LINE;
447 447
448 return 0; 448 return 0;
@@ -497,14 +497,14 @@ trace_ctxwake_print(struct trace_seq *s, struct trace_entry *entry, int flags,
497 T = task_state_char(field->next_state); 497 T = task_state_char(field->next_state);
498 S = task_state_char(field->prev_state); 498 S = task_state_char(field->prev_state);
499 comm = trace_find_cmdline(field->next_pid); 499 comm = trace_find_cmdline(field->next_pid);
500 if (trace_seq_printf(s, " %5d:%3d:%c %s [%03d] %5d:%3d:%c %s\n", 500 if (!trace_seq_printf(s, " %5d:%3d:%c %s [%03d] %5d:%3d:%c %s\n",
501 field->prev_pid, 501 field->prev_pid,
502 field->prev_prio, 502 field->prev_prio,
503 S, delim, 503 S, delim,
504 field->next_cpu, 504 field->next_cpu,
505 field->next_pid, 505 field->next_pid,
506 field->next_prio, 506 field->next_prio,
507 T, comm)) 507 T, comm))
508 return TRACE_TYPE_PARTIAL_LINE; 508 return TRACE_TYPE_PARTIAL_LINE;
509 509
510 return 0; 510 return 0;
@@ -534,14 +534,14 @@ trace_ctxwake_raw(struct trace_seq *s, struct trace_entry *entry, int flags,
534 if (!S) 534 if (!S)
535 task_state_char(field->prev_state); 535 task_state_char(field->prev_state);
536 T = task_state_char(field->next_state); 536 T = task_state_char(field->next_state);
537 if (trace_seq_printf(s, "%d %d %c %d %d %d %c\n", 537 if (!trace_seq_printf(s, "%d %d %c %d %d %d %c\n",
538 field->prev_pid, 538 field->prev_pid,
539 field->prev_prio, 539 field->prev_prio,
540 S, 540 S,
541 field->next_cpu, 541 field->next_cpu,
542 field->next_pid, 542 field->next_pid,
543 field->next_prio, 543 field->next_prio,
544 T)) 544 T))
545 return TRACE_TYPE_PARTIAL_LINE; 545 return TRACE_TYPE_PARTIAL_LINE;
546 546
547 return 0; 547 return 0;
@@ -639,10 +639,10 @@ trace_special_print(struct trace_seq *s, struct trace_entry *entry, int flags)
639 639
640 trace_assign_type(field, entry); 640 trace_assign_type(field, entry);
641 641
642 if (trace_seq_printf(s, "# %ld %ld %ld\n", 642 if (!trace_seq_printf(s, "# %ld %ld %ld\n",
643 field->arg1, 643 field->arg1,
644 field->arg2, 644 field->arg2,
645 field->arg3)) 645 field->arg3))
646 return TRACE_TYPE_PARTIAL_LINE; 646 return TRACE_TYPE_PARTIAL_LINE;
647 647
648 return 0; 648 return 0;
@@ -697,13 +697,13 @@ trace_stack_print(struct trace_seq *s, struct trace_entry *entry, int flags)
697 697
698 for (i = 0; i < FTRACE_STACK_ENTRIES; i++) { 698 for (i = 0; i < FTRACE_STACK_ENTRIES; i++) {
699 if (i) { 699 if (i) {
700 if (trace_seq_puts(s, " <= ")) 700 if (!trace_seq_puts(s, " <= "))
701 goto partial; 701 goto partial;
702 702
703 if (seq_print_ip_sym(s, field->caller[i], flags)) 703 if (!seq_print_ip_sym(s, field->caller[i], flags))
704 goto partial; 704 goto partial;
705 } 705 }
706 if (trace_seq_puts(s, "\n")) 706 if (!trace_seq_puts(s, "\n"))
707 goto partial; 707 goto partial;
708 } 708 }
709 709
@@ -731,10 +731,10 @@ trace_user_stack_print(struct trace_seq *s, struct trace_entry *entry,
731 731
732 trace_assign_type(field, entry); 732 trace_assign_type(field, entry);
733 733
734 if (seq_print_userip_objs(field, s, flags)) 734 if (!seq_print_userip_objs(field, s, flags))
735 goto partial; 735 goto partial;
736 736
737 if (trace_seq_putc(s, '\n')) 737 if (!trace_seq_putc(s, '\n'))
738 goto partial; 738 goto partial;
739 739
740 return 0; 740 return 0;
@@ -760,10 +760,10 @@ trace_print_print(struct trace_seq *s, struct trace_entry *entry, int flags)
760 760
761 trace_assign_type(field, entry); 761 trace_assign_type(field, entry);
762 762
763 if (seq_print_ip_sym(s, field->ip, flags)) 763 if (!seq_print_ip_sym(s, field->ip, flags))
764 goto partial; 764 goto partial;
765 765
766 if (trace_seq_printf(s, ": %s", field->buf)) 766 if (!trace_seq_printf(s, ": %s", field->buf))
767 goto partial; 767 goto partial;
768 768
769 return 0; 769 return 0;
@@ -779,10 +779,7 @@ trace_print_raw(struct trace_seq *s, struct trace_entry *entry, int flags)
779 779
780 trace_assign_type(field, entry); 780 trace_assign_type(field, entry);
781 781
782 if (seq_print_ip_sym(s, field->ip, flags)) 782 if (!trace_seq_printf(s, "# %lx %s", field->ip, field->buf))
783 goto partial;
784
785 if (trace_seq_printf(s, "# %lx %s", field->ip, field->buf))
786 goto partial; 783 goto partial;
787 784
788 return 0; 785 return 0;
diff --git a/kernel/trace/trace_output.h b/kernel/trace/trace_output.h
index ecab4ea4a4fd..b2c14615e0cd 100644
--- a/kernel/trace/trace_output.h
+++ b/kernel/trace/trace_output.h
@@ -45,14 +45,14 @@ trace_nop_print(struct trace_seq *s, struct trace_entry *entry, int flags);
45#define SEQ_PUT_FIELD_RET(s, x) \ 45#define SEQ_PUT_FIELD_RET(s, x) \
46do { \ 46do { \
47 if (!trace_seq_putmem(s, &(x), sizeof(x))) \ 47 if (!trace_seq_putmem(s, &(x), sizeof(x))) \
48 return 0; \ 48 return TRACE_TYPE_PARTIAL_LINE; \
49} while (0) 49} while (0)
50 50
51#define SEQ_PUT_HEX_FIELD_RET(s, x) \ 51#define SEQ_PUT_HEX_FIELD_RET(s, x) \
52do { \ 52do { \
53 BUILD_BUG_ON(sizeof(x) > MAX_MEMHEX_BYTES); \ 53 BUILD_BUG_ON(sizeof(x) > MAX_MEMHEX_BYTES); \
54 if (!trace_seq_putmem_hex(s, &(x), sizeof(x))) \ 54 if (!trace_seq_putmem_hex(s, &(x), sizeof(x))) \
55 return 0; \ 55 return TRACE_TYPE_PARTIAL_LINE; \
56} while (0) 56} while (0)
57 57
58#endif 58#endif