diff options
Diffstat (limited to 'kernel/trace/trace_output.c')
| -rw-r--r-- | kernel/trace/trace_output.c | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index e0c2545622e8..f572f44c6e1e 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' : '.', |
| @@ -481,9 +486,30 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu) | |||
| 481 | hardirq ? 'h' : softirq ? 's' : '.')) | 486 | hardirq ? 'h' : softirq ? 's' : '.')) |
| 482 | return 0; | 487 | return 0; |
| 483 | 488 | ||
| 489 | if (entry->lock_depth < 0) | ||
| 490 | ret = trace_seq_putc(s, '.'); | ||
| 491 | else | ||
| 492 | ret = trace_seq_printf(s, "%d", entry->lock_depth); | ||
| 493 | if (!ret) | ||
| 494 | return 0; | ||
| 495 | |||
| 484 | if (entry->preempt_count) | 496 | if (entry->preempt_count) |
| 485 | return trace_seq_printf(s, "%x", entry->preempt_count); | 497 | return trace_seq_printf(s, "%x", entry->preempt_count); |
| 486 | return trace_seq_puts(s, "."); | 498 | return trace_seq_putc(s, '.'); |
| 499 | } | ||
| 500 | |||
| 501 | static int | ||
| 502 | lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu) | ||
| 503 | { | ||
| 504 | char comm[TASK_COMM_LEN]; | ||
| 505 | |||
| 506 | trace_find_cmdline(entry->pid, comm); | ||
| 507 | |||
| 508 | if (!trace_seq_printf(s, "%8.8s-%-5d %3d", | ||
| 509 | comm, entry->pid, cpu)) | ||
| 510 | return 0; | ||
| 511 | |||
| 512 | return trace_print_lat_fmt(s, entry); | ||
| 487 | } | 513 | } |
| 488 | 514 | ||
| 489 | static unsigned long preempt_mark_thresh = 100; | 515 | static unsigned long preempt_mark_thresh = 100; |
