Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685758 > unrolled thread

[for-next][PATCH 1/4] tracing: Fixup trace file header alignment

Started bySteven Rostedt <rostedt@goodmis.org>
First post2017-07-12 15:00 +0200
Last post2017-07-12 15:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [for-next][PATCH 1/4] tracing: Fixup trace file header alignment Steven Rostedt <rostedt@goodmis.org> - 2017-07-12 15:00 +0200
    Re: [for-next][PATCH 1/4] tracing: Fixup trace file header alignment Joel Fernandes <joelaf@google.com> - 2017-07-12 15:10 +0200

#1685758 — [for-next][PATCH 1/4] tracing: Fixup trace file header alignment

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-07-12 15:00 +0200
Subject[for-next][PATCH 1/4] tracing: Fixup trace file header alignment
Message-ID<u2ppg-8lO-19@gated-at.bofh.it>
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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>
---
 kernel/trace/trace.c | 25 +++++++++++++++++--------
 1 file 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
 				       unsigned int flags)
 {
 	bool tgid = flags & TRACE_ITER_RECORD_TGID;
-
-	seq_printf(m, "#                          %s  _-----=> irqs-off\n",	    tgid ? "          " : "");
-	seq_printf(m, "#                          %s / _----=> need-resched\n",	    tgid ? "          " : "");
-	seq_printf(m, "#                          %s| / _---=> hardirq/softirq\n",  tgid ? "          " : "");
-	seq_printf(m, "#                          %s|| / _--=> preempt-depth\n",    tgid ? "          " : "");
-	seq_printf(m, "#                          %s||| /     delay\n",		    tgid ? "          " : "");
-	seq_printf(m, "#           TASK-PID   CPU#%s||||    TIMESTAMP  FUNCTION\n", tgid ? "   TGID   " : "");
-	seq_printf(m, "#              | |       | %s||||       |         |\n",	    tgid ? "     |    " : "");
+	const char tgid_space[] = "          ";
+	const char space[] = "  ";
+
+	seq_printf(m, "#                          %s  _-----=> irqs-off\n",
+		   tgid ? tgid_space : space);
+	seq_printf(m, "#                          %s / _----=> need-resched\n",
+		   tgid ? tgid_space : space);
+	seq_printf(m, "#                          %s| / _---=> hardirq/softirq\n",
+		   tgid ? tgid_space : space);
+	seq_printf(m, "#                          %s|| / _--=> preempt-depth\n",
+		   tgid ? tgid_space : space);
+	seq_printf(m, "#                          %s||| /     delay\n",
+		   tgid ? tgid_space : space);
+	seq_printf(m, "#           TASK-PID   CPU#%s||||    TIMESTAMP  FUNCTION\n",
+		   tgid ? "   TGID   " : space);
+	seq_printf(m, "#              | |       | %s||||       |         |\n",
+		   tgid ? "     |    " : space);
 }
 
 void
-- 
2.10.2

[toc] | [next] | [standalone]


#1685764

FromJoel Fernandes <joelaf@google.com>
Date2017-07-12 15:10 +0200
Message-ID<u2pyW-cE-23@gated-at.bofh.it>
In reply to#1685758
On Wed, Jul 12, 2017 at 5:57 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> 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>
> ---
>  kernel/trace/trace.c | 25 +++++++++++++++++--------
>  1 file 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
>                                        unsigned int flags)
>  {
>         bool tgid = flags & TRACE_ITER_RECORD_TGID;
> -
> -       seq_printf(m, "#                          %s  _-----=> irqs-off\n",         tgid ? "          " : "");
> -       seq_printf(m, "#                          %s / _----=> need-resched\n",     tgid ? "          " : "");
> -       seq_printf(m, "#                          %s| / _---=> hardirq/softirq\n",  tgid ? "          " : "");
> -       seq_printf(m, "#                          %s|| / _--=> preempt-depth\n",    tgid ? "          " : "");
> -       seq_printf(m, "#                          %s||| /     delay\n",             tgid ? "          " : "");
> -       seq_printf(m, "#           TASK-PID   CPU#%s||||    TIMESTAMP  FUNCTION\n", tgid ? "   TGID   " : "");
> -       seq_printf(m, "#              | |       | %s||||       |         |\n",      tgid ? "     |    " : "");
> +       const char tgid_space[] = "          ";
> +       const char space[] = "  ";
> +
> +       seq_printf(m, "#                          %s  _-----=> irqs-off\n",
> +                  tgid ? tgid_space : space);
> +       seq_printf(m, "#                          %s / _----=> need-resched\n",
> +                  tgid ? tgid_space : space);
> +       seq_printf(m, "#                          %s| / _---=> hardirq/softirq\n",
> +                  tgid ? tgid_space : space);
> +       seq_printf(m, "#                          %s|| / _--=> preempt-depth\n",
> +                  tgid ? tgid_space : space);
> +       seq_printf(m, "#                          %s||| /     delay\n",
> +                  tgid ? tgid_space : space);
> +       seq_printf(m, "#           TASK-PID   CPU#%s||||    TIMESTAMP  FUNCTION\n",
> +                  tgid ? "   TGID   " : space);
> +       seq_printf(m, "#              | |       | %s||||       |         |\n",
> +                  tgid ? "     |    " : space);
>  }
>

Acked-by: Joel Fernandes <joelaf@google.com>

Thanks,

-Joel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web