diff options
Diffstat (limited to 'kernel/trace/trace_output.c')
-rw-r--r-- | kernel/trace/trace_output.c | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 02272baa2206..e37de492a9e1 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -353,6 +353,33 @@ ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, | |||
353 | } | 353 | } |
354 | EXPORT_SYMBOL(ftrace_print_symbols_seq); | 354 | EXPORT_SYMBOL(ftrace_print_symbols_seq); |
355 | 355 | ||
356 | #if BITS_PER_LONG == 32 | ||
357 | const char * | ||
358 | ftrace_print_symbols_seq_u64(struct trace_seq *p, unsigned long long val, | ||
359 | const struct trace_print_flags_u64 *symbol_array) | ||
360 | { | ||
361 | int i; | ||
362 | const char *ret = p->buffer + p->len; | ||
363 | |||
364 | for (i = 0; symbol_array[i].name; i++) { | ||
365 | |||
366 | if (val != symbol_array[i].mask) | ||
367 | continue; | ||
368 | |||
369 | trace_seq_puts(p, symbol_array[i].name); | ||
370 | break; | ||
371 | } | ||
372 | |||
373 | if (!p->len) | ||
374 | trace_seq_printf(p, "0x%llx", val); | ||
375 | |||
376 | trace_seq_putc(p, 0); | ||
377 | |||
378 | return ret; | ||
379 | } | ||
380 | EXPORT_SYMBOL(ftrace_print_symbols_seq_u64); | ||
381 | #endif | ||
382 | |||
356 | const char * | 383 | const char * |
357 | ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len) | 384 | ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len) |
358 | { | 385 | { |
@@ -529,24 +556,34 @@ seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags) | |||
529 | * @entry: The trace entry field from the ring buffer | 556 | * @entry: The trace entry field from the ring buffer |
530 | * | 557 | * |
531 | * Prints the generic fields of irqs off, in hard or softirq, preempt | 558 | * Prints the generic fields of irqs off, in hard or softirq, preempt |
532 | * count and lock depth. | 559 | * count. |
533 | */ | 560 | */ |
534 | int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) | 561 | int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) |
535 | { | 562 | { |
536 | int hardirq, softirq; | 563 | char hardsoft_irq; |
564 | char need_resched; | ||
565 | char irqs_off; | ||
566 | int hardirq; | ||
567 | int softirq; | ||
537 | int ret; | 568 | int ret; |
538 | 569 | ||
539 | hardirq = entry->flags & TRACE_FLAG_HARDIRQ; | 570 | hardirq = entry->flags & TRACE_FLAG_HARDIRQ; |
540 | softirq = entry->flags & TRACE_FLAG_SOFTIRQ; | 571 | softirq = entry->flags & TRACE_FLAG_SOFTIRQ; |
541 | 572 | ||
573 | irqs_off = | ||
574 | (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : | ||
575 | (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? 'X' : | ||
576 | '.'; | ||
577 | need_resched = | ||
578 | (entry->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.'; | ||
579 | hardsoft_irq = | ||
580 | (hardirq && softirq) ? 'H' : | ||
581 | hardirq ? 'h' : | ||
582 | softirq ? 's' : | ||
583 | '.'; | ||
584 | |||
542 | if (!trace_seq_printf(s, "%c%c%c", | 585 | if (!trace_seq_printf(s, "%c%c%c", |
543 | (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : | 586 | irqs_off, need_resched, hardsoft_irq)) |
544 | (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? | ||
545 | 'X' : '.', | ||
546 | (entry->flags & TRACE_FLAG_NEED_RESCHED) ? | ||
547 | 'N' : '.', | ||
548 | (hardirq && softirq) ? 'H' : | ||
549 | hardirq ? 'h' : softirq ? 's' : '.')) | ||
550 | return 0; | 587 | return 0; |
551 | 588 | ||
552 | if (entry->preempt_count) | 589 | if (entry->preempt_count) |
@@ -554,13 +591,7 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) | |||
554 | else | 591 | else |
555 | ret = trace_seq_putc(s, '.'); | 592 | ret = trace_seq_putc(s, '.'); |
556 | 593 | ||
557 | if (!ret) | 594 | return ret; |
558 | return 0; | ||
559 | |||
560 | if (entry->lock_depth < 0) | ||
561 | return trace_seq_putc(s, '.'); | ||
562 | |||
563 | return trace_seq_printf(s, "%d", entry->lock_depth); | ||
564 | } | 595 | } |
565 | 596 | ||
566 | static int | 597 | static int |
@@ -826,6 +857,9 @@ EXPORT_SYMBOL_GPL(unregister_ftrace_event); | |||
826 | enum print_line_t trace_nop_print(struct trace_iterator *iter, int flags, | 857 | enum print_line_t trace_nop_print(struct trace_iterator *iter, int flags, |
827 | struct trace_event *event) | 858 | struct trace_event *event) |
828 | { | 859 | { |
860 | if (!trace_seq_printf(&iter->seq, "type: %d\n", iter->ent->type)) | ||
861 | return TRACE_TYPE_PARTIAL_LINE; | ||
862 | |||
829 | return TRACE_TYPE_HANDLED; | 863 | return TRACE_TYPE_HANDLED; |
830 | } | 864 | } |
831 | 865 | ||