mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jungseok Lee <jungseoklee85@gmail.com>
Subject: [for-next][PATCH 11/13] ftrace: Fix function_graph duration spacing with 7-digits
Date: Tue, 21 Jul 2015 15:14:29 -0400	[thread overview]
Message-ID: <20150721191437.896836871@goodmis.org> (raw)
In-Reply-To: <20150721191418.772796260@goodmis.org>

[-- Attachment #1: 0011-ftrace-Fix-function_graph-duration-spacing-with-7-di.patch --]
[-- Type: text/plain, Size: 1855 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

Jungseok Lee noticed the following:

Currently, row's width of 7-digit duration numbers not aligned with
other cases like the following example.

 3) $ 3999884 us |      }
 3)               |      finish_task_switch() {
 3)   0.365 us    |        _raw_spin_unlock_irq();
 3)   3.333 us    |      }
 3) $ 3999976 us |    }
 3) $ 3999979 us |  } /* schedule */

As adding a single white space in case of 7-digit numbers, the format
could be unified easily as follows.

 3) $ 2237472 us  |      }
 3)               |      finish_task_switch() {
 3)   0.364 us    |        _raw_spin_unlock_irq();
 3)   3.125 us    |      }
 3) $ 2237556 us  |    }
 3) $ 2237559 us  |  } /* schedule */

Instead of making a special case for 7-digit numbers, the logic
of the len and the space loop is slightly modified to make the
two cases have the same format.

Link: http://lkml.kernel.org/r/1436626300-1679-2-git-send-email-jungseoklee85@gmail.com

Reported-by: Jungseok Lee <jungseoklee85@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_functions_graph.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 8968bf720c12..ca98445782ac 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -715,13 +715,13 @@ trace_print_graph_duration(unsigned long long duration, struct trace_seq *s)
 
 		snprintf(nsecs_str, slen, "%03lu", nsecs_rem);
 		trace_seq_printf(s, ".%s", nsecs_str);
-		len += strlen(nsecs_str);
+		len += strlen(nsecs_str) + 1;
 	}
 
 	trace_seq_puts(s, " us ");
 
 	/* Print remaining spaces to fit the row's width */
-	for (i = len; i < 7; i++)
+	for (i = len; i < 8; i++)
 		trace_seq_putc(s, ' ');
 }
 
-- 
2.1.4



  parent reply	other threads:[~2015-07-21 19:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21 19:14 [for-next][PATCH 00/13] tracing: Updates for 4.3 Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 01/13] tracing: Prefer kcalloc over kzalloc with multiply Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 02/13] tracing: Fix for non-continuous cpu ids Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 03/13] ftrace: correct the counter increment for trace_buffer data Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 04/13] ring-buffer: Add event descriptor to simplify passing data Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 05/13] ring-buffer: Move the adding of the extended timestamp out of line Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 06/13] ring-buffer: Get timestamp after event is allocated Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 07/13] ring-buffer: Make sure event has enough room for extend and padding Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 08/13] ring-buffer: Reorganize function locations Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 09/13] tracing: Clean up stack tracing and fix fentry updates Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 10/13] ftrace: add tracing_thresh to function profile Steven Rostedt
2015-07-21 19:14 ` Steven Rostedt [this message]
2015-07-21 19:14 ` [for-next][PATCH 12/13] tracing: Introduce two additional marks for delay Steven Rostedt
2015-07-21 19:14 ` [for-next][PATCH 13/13] ftrace: Format MCOUNT_ADDR address as type unsigned long Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150721191437.896836871@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=jungseoklee85@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®