aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_output.c
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2017-06-26 01:38:43 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-06-27 13:30:28 -0400
commit441dae8f2f2975c68101a84bc3f528ec95ecf7c3 (patch)
tree0f16d4550fafdff2718a33b7cc99ba8ab3391794 /kernel/trace/trace_output.c
parentd914ba37d7145acb9fd3bb23075c2d56e5a44eb6 (diff)
tracing: Add support for display of tgid in trace output
Earlier patches introduced ability to record the tgid using the 'record-tgid' option. Here we read the tgid and output it if the option is enabled. Link: http://lkml.kernel.org/r/20170626053844.5746-3-joelaf@google.com Cc: kernel-team@android.com Cc: Ingo Molnar <mingo@redhat.com> Tested-by: Michael Sartain <mikesart@gmail.com> Signed-off-by: Joel Fernandes <joelaf@google.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_output.c')
-rw-r--r--kernel/trace/trace_output.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 01ff99969ca7..bac629af2285 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -597,6 +597,15 @@ int trace_print_context(struct trace_iterator *iter)
597 trace_seq_printf(s, "%16s-%-5d [%03d] ", 597 trace_seq_printf(s, "%16s-%-5d [%03d] ",
598 comm, entry->pid, iter->cpu); 598 comm, entry->pid, iter->cpu);
599 599
600 if (tr->trace_flags & TRACE_ITER_RECORD_TGID) {
601 unsigned int tgid = trace_find_tgid(entry->pid);
602
603 if (!tgid)
604 trace_seq_printf(s, "(-----) ");
605 else
606 trace_seq_printf(s, "(%5d) ", tgid);
607 }
608
600 if (tr->trace_flags & TRACE_ITER_IRQ_INFO) 609 if (tr->trace_flags & TRACE_ITER_IRQ_INFO)
601 trace_print_lat_fmt(s, entry); 610 trace_print_lat_fmt(s, entry);
602 611