diff options
Diffstat (limited to 'kernel/trace/trace_output.c')
-rw-r--r-- | kernel/trace/trace_output.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 3fc20422c166..5d33a7352919 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -1288,6 +1288,35 @@ static struct trace_event trace_print_event = { | |||
1288 | .funcs = &trace_print_funcs, | 1288 | .funcs = &trace_print_funcs, |
1289 | }; | 1289 | }; |
1290 | 1290 | ||
1291 | static enum print_line_t trace_raw_data(struct trace_iterator *iter, int flags, | ||
1292 | struct trace_event *event) | ||
1293 | { | ||
1294 | struct raw_data_entry *field; | ||
1295 | int i; | ||
1296 | |||
1297 | trace_assign_type(field, iter->ent); | ||
1298 | |||
1299 | trace_seq_printf(&iter->seq, "# %x buf:", field->id); | ||
1300 | |||
1301 | for (i = 0; i < iter->ent_size - offsetof(struct raw_data_entry, buf); i++) | ||
1302 | trace_seq_printf(&iter->seq, " %02x", | ||
1303 | (unsigned char)field->buf[i]); | ||
1304 | |||
1305 | trace_seq_putc(&iter->seq, '\n'); | ||
1306 | |||
1307 | return trace_handle_return(&iter->seq); | ||
1308 | } | ||
1309 | |||
1310 | static struct trace_event_functions trace_raw_data_funcs = { | ||
1311 | .trace = trace_raw_data, | ||
1312 | .raw = trace_raw_data, | ||
1313 | }; | ||
1314 | |||
1315 | static struct trace_event trace_raw_data_event = { | ||
1316 | .type = TRACE_RAW_DATA, | ||
1317 | .funcs = &trace_raw_data_funcs, | ||
1318 | }; | ||
1319 | |||
1291 | 1320 | ||
1292 | static struct trace_event *events[] __initdata = { | 1321 | static struct trace_event *events[] __initdata = { |
1293 | &trace_fn_event, | 1322 | &trace_fn_event, |
@@ -1299,6 +1328,7 @@ static struct trace_event *events[] __initdata = { | |||
1299 | &trace_bprint_event, | 1328 | &trace_bprint_event, |
1300 | &trace_print_event, | 1329 | &trace_print_event, |
1301 | &trace_hwlat_event, | 1330 | &trace_hwlat_event, |
1331 | &trace_raw_data_event, | ||
1302 | NULL | 1332 | NULL |
1303 | }; | 1333 | }; |
1304 | 1334 | ||