From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH 1/3] perf sched timehist: Enlarge default comm_width
Date: Thu, 22 Dec 2016 10:19:26 -0300 [thread overview]
Message-ID: <20161222131925.GB3717@kernel.org> (raw)
In-Reply-To: <20161222060350.17655-1-namhyung@kernel.org>
Em Thu, Dec 22, 2016 at 03:03:48PM +0900, Namhyung Kim escreveu:
> Current default value is 20 but it's easily changed to a bigger value as
> task has a long name and different tid and pid. And it makes the output
> not aligned. So change it to have a large value as summary shows.
So you're doing multiple things here:
1) making more places honour the comm_width (header)
2) changing its default from 20 to 30 and due to this, removing the
setting to 30 done at timehist_print_summary
I'll break it into two to reflect that.
- Arnaldo
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/builtin-sched.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index c1c07bfe132c..5052caa91caa 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -1775,7 +1775,7 @@ static u64 perf_evsel__get_time(struct perf_evsel *evsel, u32 cpu)
> return r->last_time[cpu];
> }
>
> -static int comm_width = 20;
> +static int comm_width = 30;
>
> static char *timehist_get_commstr(struct thread *thread)
> {
> @@ -1817,7 +1817,7 @@ static void timehist_header(struct perf_sched *sched)
> printf(" ");
> }
>
> - printf(" %-20s %9s %9s %9s",
> + printf(" %-*s %9s %9s %9s", comm_width,
> "task name", "wait time", "sch delay", "run time");
>
> printf("\n");
> @@ -1830,7 +1830,8 @@ static void timehist_header(struct perf_sched *sched)
> if (sched->show_cpu_visual)
> printf(" %*s ", ncpus, "");
>
> - printf(" %-20s %9s %9s %9s\n", "[tid/pid]", "(msec)", "(msec)", "(msec)");
> + printf(" %-*s %9s %9s %9s\n", comm_width,
> + "[tid/pid]", "(msec)", "(msec)", "(msec)");
>
> /*
> * separator
> @@ -1840,7 +1841,7 @@ static void timehist_header(struct perf_sched *sched)
> if (sched->show_cpu_visual)
> printf(" %.*s ", ncpus, graph_dotted_line);
>
> - printf(" %.20s %.9s %.9s %.9s",
> + printf(" %.*s %.9s %.9s %.9s", comm_width,
> graph_dotted_line, graph_dotted_line, graph_dotted_line,
> graph_dotted_line);
>
> @@ -2626,9 +2627,6 @@ static void timehist_print_summary(struct perf_sched *sched,
>
> memset(&totals, 0, sizeof(totals));
>
> - if (comm_width < 30)
> - comm_width = 30;
> -
> if (sched->idle_hist) {
> printf("\nIdle-time summary\n");
> printf("%*s parent sched-out ", comm_width, "comm");
> --
> 2.10.0
next prev parent reply other threads:[~2016-12-22 13:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-22 6:03 [PATCH 1/3] perf sched timehist: Enlarge default comm_width Namhyung Kim
2016-12-22 6:03 ` [PATCH 2/3] perf sched timehist: Fix invalid period calculation Namhyung Kim
2016-12-23 19:29 ` [tip:perf/urgent] " tip-bot for Namhyung Kim
2016-12-22 6:03 ` [PATCH 3/3] perf sched timehist: Show total scheduling time Namhyung Kim
2017-01-05 7:49 ` [tip:perf/urgent] " tip-bot for Namhyung Kim
2016-12-22 13:19 ` Arnaldo Carvalho de Melo [this message]
2016-12-23 19:27 ` [tip:perf/urgent] perf sched timehist: Honour 'comm_width' when aligning the headers tip-bot for Namhyung Kim
2016-12-23 19:28 ` [tip:perf/urgent] perf sched timehist: Enlarge default 'comm_width' tip-bot for Namhyung Kim
2016-12-23 19:28 ` [tip:perf/urgent] perf sched timehist: Remove hardcoded 'comm_width' check at print_summary tip-bot for Namhyung Kim
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=20161222131925.GB3717@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@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