diff options
Diffstat (limited to 'kernel/trace/trace_output.c')
-rw-r--r-- | kernel/trace/trace_output.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 0bb9cf2d53e6..3fc20422c166 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -1098,6 +1098,71 @@ static struct trace_event trace_user_stack_event = { | |||
1098 | .funcs = &trace_user_stack_funcs, | 1098 | .funcs = &trace_user_stack_funcs, |
1099 | }; | 1099 | }; |
1100 | 1100 | ||
1101 | /* TRACE_HWLAT */ | ||
1102 | static enum print_line_t | ||
1103 | trace_hwlat_print(struct trace_iterator *iter, int flags, | ||
1104 | struct trace_event *event) | ||
1105 | { | ||
1106 | struct trace_entry *entry = iter->ent; | ||
1107 | struct trace_seq *s = &iter->seq; | ||
1108 | struct hwlat_entry *field; | ||
1109 | |||
1110 | trace_assign_type(field, entry); | ||
1111 | |||
1112 | trace_seq_printf(s, "#%-5u inner/outer(us): %4llu/%-5llu ts:%ld.%09ld", | ||
1113 | field->seqnum, | ||
1114 | field->duration, | ||
1115 | field->outer_duration, | ||
1116 | field->timestamp.tv_sec, | ||
1117 | field->timestamp.tv_nsec); | ||
1118 | |||
1119 | if (field->nmi_count) { | ||
1120 | /* | ||
1121 | * The generic sched_clock() is not NMI safe, thus | ||
1122 | * we only record the count and not the time. | ||
1123 | */ | ||
1124 | if (!IS_ENABLED(CONFIG_GENERIC_SCHED_CLOCK)) | ||
1125 | trace_seq_printf(s, " nmi-total:%llu", | ||
1126 | field->nmi_total_ts); | ||
1127 | trace_seq_printf(s, " nmi-count:%u", | ||
1128 | field->nmi_count); | ||
1129 | } | ||
1130 | |||
1131 | trace_seq_putc(s, '\n'); | ||
1132 | |||
1133 | return trace_handle_return(s); | ||
1134 | } | ||
1135 | |||
1136 | |||
1137 | static enum print_line_t | ||
1138 | trace_hwlat_raw(struct trace_iterator *iter, int flags, | ||
1139 | struct trace_event *event) | ||
1140 | { | ||
1141 | struct hwlat_entry *field; | ||
1142 | struct trace_seq *s = &iter->seq; | ||
1143 | |||
1144 | trace_assign_type(field, iter->ent); | ||
1145 | |||
1146 | trace_seq_printf(s, "%llu %lld %ld %09ld %u\n", | ||
1147 | field->duration, | ||
1148 | field->outer_duration, | ||
1149 | field->timestamp.tv_sec, | ||
1150 | field->timestamp.tv_nsec, | ||
1151 | field->seqnum); | ||
1152 | |||
1153 | return trace_handle_return(s); | ||
1154 | } | ||
1155 | |||
1156 | static struct trace_event_functions trace_hwlat_funcs = { | ||
1157 | .trace = trace_hwlat_print, | ||
1158 | .raw = trace_hwlat_raw, | ||
1159 | }; | ||
1160 | |||
1161 | static struct trace_event trace_hwlat_event = { | ||
1162 | .type = TRACE_HWLAT, | ||
1163 | .funcs = &trace_hwlat_funcs, | ||
1164 | }; | ||
1165 | |||
1101 | /* TRACE_BPUTS */ | 1166 | /* TRACE_BPUTS */ |
1102 | static enum print_line_t | 1167 | static enum print_line_t |
1103 | trace_bputs_print(struct trace_iterator *iter, int flags, | 1168 | trace_bputs_print(struct trace_iterator *iter, int flags, |
@@ -1233,6 +1298,7 @@ static struct trace_event *events[] __initdata = { | |||
1233 | &trace_bputs_event, | 1298 | &trace_bputs_event, |
1234 | &trace_bprint_event, | 1299 | &trace_bprint_event, |
1235 | &trace_print_event, | 1300 | &trace_print_event, |
1301 | &trace_hwlat_event, | ||
1236 | NULL | 1302 | NULL |
1237 | }; | 1303 | }; |
1238 | 1304 | ||