Commit 0e6758e8 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf sched timehist: Honour 'comm_width' when aligning the headers

Current default value is 20, but that may change in the future, so make
places where we have 20 hardcoded use 'comm_width'.
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20161222060350.17655-1-namhyung@kernel.org
[ Split from a larger patch ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 1134c2b5
...@@ -1817,7 +1817,7 @@ static void timehist_header(struct perf_sched *sched) ...@@ -1817,7 +1817,7 @@ static void timehist_header(struct perf_sched *sched)
printf(" "); printf(" ");
} }
printf(" %-20s %9s %9s %9s", printf(" %-*s %9s %9s %9s", comm_width,
"task name", "wait time", "sch delay", "run time"); "task name", "wait time", "sch delay", "run time");
printf("\n"); printf("\n");
...@@ -1830,7 +1830,8 @@ static void timehist_header(struct perf_sched *sched) ...@@ -1830,7 +1830,8 @@ static void timehist_header(struct perf_sched *sched)
if (sched->show_cpu_visual) if (sched->show_cpu_visual)
printf(" %*s ", ncpus, ""); 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 * separator
...@@ -1840,7 +1841,7 @@ static void timehist_header(struct perf_sched *sched) ...@@ -1840,7 +1841,7 @@ static void timehist_header(struct perf_sched *sched)
if (sched->show_cpu_visual) if (sched->show_cpu_visual)
printf(" %.*s ", ncpus, graph_dotted_line); 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, graph_dotted_line, graph_dotted_line,
graph_dotted_line); graph_dotted_line);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment