summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2017-07-11 15:43:24 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-07-11 16:48:19 -0400
commitb11fb73743fc406204e0749ead18560aeda8b136 (patch)
tree505b93999d9e7f4b1291cb6da900d7645fbd8045 /kernel/trace/trace.c
parent8cb0bc9e3f863f3e77522d02443a75c0e45a6ed0 (diff)
tracing: Fixup trace file header alignment
The addition of TGID to the tracing header added a check to see if TGID shoudl be displayed or not, and updated the header accordingly. Unfortunately, it broke the default header. Also add constant strings to use for spacing. This does remove the visibility of the header a bit, but cuts it down from the extended lines much greater than 80 characters. Before this change: # tracer: function # # _-----=> irqs-off # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / delay # TASK-PID CPU#|||| TIMESTAMP FUNCTION # | | | |||| | | swapper/0-1 [000] .... 0.277830: migration_init <-do_one_initcall swapper/0-1 [002] d... 13.861967: Unknown type 1201 swapper/0-1 [002] d..1 13.861970: Unknown type 1202 After this change: # tracer: function # # _-----=> irqs-off # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / delay # TASK-PID CPU# |||| TIMESTAMP FUNCTION # | | | |||| | | swapper/0-1 [000] .... 0.278245: migration_init <-do_one_initcall swapper/0-1 [003] d... 13.861189: Unknown type 1201 swapper/0-1 [003] d..1 13.861192: Unknown type 1202 Cc: Joel Fernandes <joelaf@google.com> Fixes: 441dae8f2f29 ("tracing: Add support for display of tgid in trace output") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 92af8fd1429b..dabd810a10cd 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3358,14 +3358,23 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file
3358 unsigned int flags) 3358 unsigned int flags)
3359{ 3359{
3360 bool tgid = flags & TRACE_ITER_RECORD_TGID; 3360 bool tgid = flags & TRACE_ITER_RECORD_TGID;
3361 3361 const char tgid_space[] = " ";
3362 seq_printf(m, "# %s _-----=> irqs-off\n", tgid ? " " : ""); 3362 const char space[] = " ";
3363 seq_printf(m, "# %s / _----=> need-resched\n", tgid ? " " : ""); 3363
3364 seq_printf(m, "# %s| / _---=> hardirq/softirq\n", tgid ? " " : ""); 3364 seq_printf(m, "# %s _-----=> irqs-off\n",
3365 seq_printf(m, "# %s|| / _--=> preempt-depth\n", tgid ? " " : ""); 3365 tgid ? tgid_space : space);
3366 seq_printf(m, "# %s||| / delay\n", tgid ? " " : ""); 3366 seq_printf(m, "# %s / _----=> need-resched\n",
3367 seq_printf(m, "# TASK-PID CPU#%s|||| TIMESTAMP FUNCTION\n", tgid ? " TGID " : ""); 3367 tgid ? tgid_space : space);
3368 seq_printf(m, "# | | | %s|||| | |\n", tgid ? " | " : ""); 3368 seq_printf(m, "# %s| / _---=> hardirq/softirq\n",
3369 tgid ? tgid_space : space);
3370 seq_printf(m, "# %s|| / _--=> preempt-depth\n",
3371 tgid ? tgid_space : space);
3372 seq_printf(m, "# %s||| / delay\n",
3373 tgid ? tgid_space : space);
3374 seq_printf(m, "# TASK-PID CPU#%s|||| TIMESTAMP FUNCTION\n",
3375 tgid ? " TGID " : space);
3376 seq_printf(m, "# | | | %s|||| | |\n",
3377 tgid ? " | " : space);
3369} 3378}
3370 3379
3371void 3380void