diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-19 05:27:32 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-19 05:28:41 -0400 |
commit | 929bf0d0156562ce631728b6fa53d68004d456d2 (patch) | |
tree | 739063990a8077b29ef97e69d73bce94573daae4 /kernel/trace/trace_output.c | |
parent | def0a9b2573e00ab0b486cb5382625203ab4c4a6 (diff) | |
parent | 202c4675c55ddf6b443c7e057d2dff6b42ef71aa (diff) |
Merge branch 'linus' into perfcounters/core
Merge reason: Bring in tracing changes we depend on.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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; |