diff options
Diffstat (limited to 'kernel/trace/trace_output.c')
| -rw-r--r-- | kernel/trace/trace_output.c | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index e0c2545622e8..ed17565826b0 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
| @@ -407,7 +407,7 @@ seq_print_userip_objs(const struct userstack_entry *entry, struct trace_seq *s, | |||
| 407 | * since individual threads might have already quit! | 407 | * since individual threads might have already quit! |
| 408 | */ | 408 | */ |
| 409 | rcu_read_lock(); | 409 | rcu_read_lock(); |
| 410 | task = find_task_by_vpid(entry->ent.tgid); | 410 | task = find_task_by_vpid(entry->tgid); |
| 411 | if (task) | 411 | if (task) |
| 412 | mm = get_task_mm(task); | 412 | mm = get_task_mm(task); |
| 413 | rcu_read_unlock(); | 413 | rcu_read_unlock(); |
| @@ -460,18 +460,23 @@ seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags) | |||
| 460 | return ret; | 460 | return ret; |
| 461 | } | 461 | } |
| 462 | 462 | ||
| 463 | static int | 463 | /** |
| 464 | lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu) | 464 | * trace_print_lat_fmt - print the irq, preempt and lockdep fields |
| 465 | * @s: trace seq struct to write to | ||
| 466 | * @entry: The trace entry field from the ring buffer | ||
| 467 | * | ||
| 468 | * Prints the generic fields of irqs off, in hard or softirq, preempt | ||
| 469 | * count and lock depth. | ||
| 470 | */ | ||
| 471 | int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) | ||
| 465 | { | 472 | { |
| 466 | int hardirq, softirq; | 473 | int hardirq, softirq; |
| 467 | char comm[TASK_COMM_LEN]; | 474 | int ret; |
| 468 | 475 | ||
| 469 | trace_find_cmdline(entry->pid, comm); | ||
| 470 | hardirq = entry->flags & TRACE_FLAG_HARDIRQ; | 476 | hardirq = entry->flags & TRACE_FLAG_HARDIRQ; |
| 471 | softirq = entry->flags & TRACE_FLAG_SOFTIRQ; | 477 | softirq = entry->flags & TRACE_FLAG_SOFTIRQ; |
| 472 | 478 | ||
| 473 | if (!trace_seq_printf(s, "%8.8s-%-5d %3d%c%c%c", | 479 | if (!trace_seq_printf(s, "%c%c%c", |
| 474 | comm, entry->pid, cpu, | ||
| 475 | (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : | 480 | (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : |
| 476 | (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? | 481 | (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? |
| 477 | 'X' : '.', | 482 | 'X' : '.', |
| @@ -482,8 +487,31 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu) | |||
| 482 | return 0; | 487 | return 0; |
| 483 | 488 | ||
| 484 | if (entry->preempt_count) | 489 | if (entry->preempt_count) |
| 485 | return trace_seq_printf(s, "%x", entry->preempt_count); | 490 | ret = trace_seq_printf(s, "%x", entry->preempt_count); |
| 486 | return trace_seq_puts(s, "."); | 491 | else |
| 492 | ret = trace_seq_putc(s, '.'); | ||
| 493 | |||
| 494 | if (!ret) | ||
| 495 | return 0; | ||
| 496 | |||
| 497 | if (entry->lock_depth < 0) | ||
| 498 | return trace_seq_putc(s, '.'); | ||
| 499 | |||
| 500 | return trace_seq_printf(s, "%d", entry->lock_depth); | ||
| 501 | } | ||
| 502 | |||
| 503 | static int | ||
| 504 | lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu) | ||
| 505 | { | ||
| 506 | char comm[TASK_COMM_LEN]; | ||
| 507 | |||
| 508 | trace_find_cmdline(entry->pid, comm); | ||
| 509 | |||
| 510 | if (!trace_seq_printf(s, "%8.8s-%-5d %3d", | ||
| 511 | comm, entry->pid, cpu)) | ||
| 512 | return 0; | ||
| 513 | |||
| 514 | return trace_print_lat_fmt(s, entry); | ||
| 487 | } | 515 | } |
| 488 | 516 | ||
| 489 | static unsigned long preempt_mark_thresh = 100; | 517 | static unsigned long preempt_mark_thresh = 100; |
| @@ -857,7 +885,7 @@ static int trace_ctxwake_raw(struct trace_iterator *iter, char S) | |||
| 857 | trace_assign_type(field, iter->ent); | 885 | trace_assign_type(field, iter->ent); |
| 858 | 886 | ||
| 859 | if (!S) | 887 | if (!S) |
| 860 | task_state_char(field->prev_state); | 888 | S = task_state_char(field->prev_state); |
| 861 | T = task_state_char(field->next_state); | 889 | T = task_state_char(field->next_state); |
| 862 | if (!trace_seq_printf(&iter->seq, "%d %d %c %d %d %d %c\n", | 890 | if (!trace_seq_printf(&iter->seq, "%d %d %c %d %d %d %c\n", |
| 863 | field->prev_pid, | 891 | field->prev_pid, |
| @@ -892,7 +920,7 @@ static int trace_ctxwake_hex(struct trace_iterator *iter, char S) | |||
| 892 | trace_assign_type(field, iter->ent); | 920 | trace_assign_type(field, iter->ent); |
| 893 | 921 | ||
| 894 | if (!S) | 922 | if (!S) |
| 895 | task_state_char(field->prev_state); | 923 | S = task_state_char(field->prev_state); |
| 896 | T = task_state_char(field->next_state); | 924 | T = task_state_char(field->next_state); |
| 897 | 925 | ||
| 898 | SEQ_PUT_HEX_FIELD_RET(s, field->prev_pid); | 926 | SEQ_PUT_HEX_FIELD_RET(s, field->prev_pid); |
