diff options
Diffstat (limited to 'kernel/trace/trace_output.c')
-rw-r--r-- | kernel/trace/trace_output.c | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 491832af9ba1..ea9d3b410c7a 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -832,13 +832,13 @@ static struct trace_event trace_user_stack_event = { | |||
832 | .binary = trace_special_bin, | 832 | .binary = trace_special_bin, |
833 | }; | 833 | }; |
834 | 834 | ||
835 | /* TRACE_PRINT */ | 835 | /* TRACE_BPRINT */ |
836 | static enum print_line_t | 836 | static enum print_line_t |
837 | trace_print_print(struct trace_iterator *iter, int flags) | 837 | trace_bprint_print(struct trace_iterator *iter, int flags) |
838 | { | 838 | { |
839 | struct trace_entry *entry = iter->ent; | 839 | struct trace_entry *entry = iter->ent; |
840 | struct trace_seq *s = &iter->seq; | 840 | struct trace_seq *s = &iter->seq; |
841 | struct print_entry *field; | 841 | struct bprint_entry *field; |
842 | 842 | ||
843 | trace_assign_type(field, entry); | 843 | trace_assign_type(field, entry); |
844 | 844 | ||
@@ -858,9 +858,10 @@ trace_print_print(struct trace_iterator *iter, int flags) | |||
858 | } | 858 | } |
859 | 859 | ||
860 | 860 | ||
861 | static enum print_line_t trace_print_raw(struct trace_iterator *iter, int flags) | 861 | static enum print_line_t |
862 | trace_bprint_raw(struct trace_iterator *iter, int flags) | ||
862 | { | 863 | { |
863 | struct print_entry *field; | 864 | struct bprint_entry *field; |
864 | struct trace_seq *s = &iter->seq; | 865 | struct trace_seq *s = &iter->seq; |
865 | 866 | ||
866 | trace_assign_type(field, iter->ent); | 867 | trace_assign_type(field, iter->ent); |
@@ -878,12 +879,55 @@ static enum print_line_t trace_print_raw(struct trace_iterator *iter, int flags) | |||
878 | } | 879 | } |
879 | 880 | ||
880 | 881 | ||
882 | static struct trace_event trace_bprint_event = { | ||
883 | .type = TRACE_BPRINT, | ||
884 | .trace = trace_bprint_print, | ||
885 | .raw = trace_bprint_raw, | ||
886 | }; | ||
887 | |||
888 | /* TRACE_PRINT */ | ||
889 | static enum print_line_t trace_print_print(struct trace_iterator *iter, | ||
890 | int flags) | ||
891 | { | ||
892 | struct print_entry *field; | ||
893 | struct trace_seq *s = &iter->seq; | ||
894 | |||
895 | trace_assign_type(field, iter->ent); | ||
896 | |||
897 | if (!seq_print_ip_sym(s, field->ip, flags)) | ||
898 | goto partial; | ||
899 | |||
900 | if (!trace_seq_printf(s, ": %s", field->buf)) | ||
901 | goto partial; | ||
902 | |||
903 | return TRACE_TYPE_HANDLED; | ||
904 | |||
905 | partial: | ||
906 | return TRACE_TYPE_PARTIAL_LINE; | ||
907 | } | ||
908 | |||
909 | static enum print_line_t trace_print_raw(struct trace_iterator *iter, int flags) | ||
910 | { | ||
911 | struct print_entry *field; | ||
912 | |||
913 | trace_assign_type(field, iter->ent); | ||
914 | |||
915 | if (!trace_seq_printf(&iter->seq, "# %lx %s", field->ip, field->buf)) | ||
916 | goto partial; | ||
917 | |||
918 | return TRACE_TYPE_HANDLED; | ||
919 | |||
920 | partial: | ||
921 | return TRACE_TYPE_PARTIAL_LINE; | ||
922 | } | ||
923 | |||
881 | static struct trace_event trace_print_event = { | 924 | static struct trace_event trace_print_event = { |
882 | .type = TRACE_PRINT, | 925 | .type = TRACE_PRINT, |
883 | .trace = trace_print_print, | 926 | .trace = trace_print_print, |
884 | .raw = trace_print_raw, | 927 | .raw = trace_print_raw, |
885 | }; | 928 | }; |
886 | 929 | ||
930 | |||
887 | static struct trace_event *events[] __initdata = { | 931 | static struct trace_event *events[] __initdata = { |
888 | &trace_fn_event, | 932 | &trace_fn_event, |
889 | &trace_ctx_event, | 933 | &trace_ctx_event, |
@@ -891,6 +935,7 @@ static struct trace_event *events[] __initdata = { | |||
891 | &trace_special_event, | 935 | &trace_special_event, |
892 | &trace_stack_event, | 936 | &trace_stack_event, |
893 | &trace_user_stack_event, | 937 | &trace_user_stack_event, |
938 | &trace_bprint_event, | ||
894 | &trace_print_event, | 939 | &trace_print_event, |
895 | NULL | 940 | NULL |
896 | }; | 941 | }; |