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


Groups > linux.kernel > #1182170 > unrolled thread

[PATCH 0/2] Improve trace output format

Started byJungseok Lee <jungseoklee85@gmail.com>
First post2015-07-11 17:00 +0200
Last post2015-07-17 03:50 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] Improve trace output format Jungseok Lee <jungseoklee85@gmail.com> - 2015-07-11 17:00 +0200
    [PATCH 1/2] tracing: Fix function graph duration format for 7-digit number Jungseok Lee <jungseoklee85@gmail.com> - 2015-07-11 17:00 +0200
      Re: [PATCH 1/2] tracing: Fix function graph duration format for  7-digit number Steven Rostedt <rostedt@goodmis.org> - 2015-07-17 03:50 +0200

#1182170 — [PATCH 0/2] Improve trace output format

FromJungseok Lee <jungseoklee85@gmail.com>
Date2015-07-11 17:00 +0200
Subject[PATCH 0/2] Improve trace output format
Message-ID<pL4pY-4oi-11@gated-at.bofh.it>
I have found out a space to improve a delay feature of trace output
format as playing with function_graph. This patchset deals with delay
of 7-digit number and introduction of two additional delay marks.

All works are based on the following repository with ARM64 platform.

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core

Any feedbacks are always welcome. Thanks in advance!

Best Regards
Jungseok Lee

Jungseok Lee (2):
  tracing: Fix function graph duration format for 7-digit number
  tracing: Introduce two additional marks for delay

 Documentation/trace/ftrace.txt       | 51 ++++++++++++----
 kernel/trace/trace_functions_graph.c |  2 +
 kernel/trace/trace_output.c          |  4 +-
 3 files changed, 43 insertions(+), 14 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1182171 — [PATCH 1/2] tracing: Fix function graph duration format for 7-digit number

FromJungseok Lee <jungseoklee85@gmail.com>
Date2015-07-11 17:00 +0200
Subject[PATCH 1/2] tracing: Fix function graph duration format for 7-digit number
Message-ID<pL4pY-4oi-17@gated-at.bofh.it>
In reply to#1182170
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 */

Signed-off-by: Jungseok Lee <jungseoklee85@gmail.com>
---
 kernel/trace/trace_functions_graph.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 8968bf7..0bc16c4 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -716,6 +716,8 @@ 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);
+	} else if (len == 7) {
+		len -= 1;
 	}
 
 	trace_seq_puts(s, " us ");
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1186368 — Re: [PATCH 1/2] tracing: Fix function graph duration format for 7-digit number

FromSteven Rostedt <rostedt@goodmis.org>
Date2015-07-17 03:50 +0200
SubjectRe: [PATCH 1/2] tracing: Fix function graph duration format for 7-digit number
Message-ID<pN2WJ-7I8-5@gated-at.bofh.it>
In reply to#1182171
On Sat, 11 Jul 2015 14:51:39 +0000
Jungseok Lee <jungseoklee85@gmail.com> wrote:

> diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
> index 8968bf7..0bc16c4 100644
> --- a/kernel/trace/trace_functions_graph.c
> +++ b/kernel/trace/trace_functions_graph.c
> @@ -716,6 +716,8 @@ 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);
> +	} else if (len == 7) {
> +		len -= 1;

Don't you mean len--;

>  	}
>  
>  	trace_seq_puts(s, " us ");

I don't care much for an extra branch here. I'm going to go with the
following patch:

-- Steve

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, ' ');
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web