diff options
author | Namhyung Kim <namhyung@kernel.org> | 2016-12-22 01:03:48 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-12-22 14:35:45 -0500 |
commit | 0e6758e8231d5905c2e267566e9bd679a68a7b00 (patch) | |
tree | 0dd06a8dad10e2a56ae1c8997f149e3393d98f05 /tools | |
parent | 1134c2b5cb840409ffd966d8c2a9468f64e6a494 (diff) |
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: Namhyung 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: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-sched.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index c1c07bfe132c..020f9c9cef7b 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1817,7 +1817,7 @@ static void timehist_header(struct perf_sched *sched) | |||
1817 | printf(" "); | 1817 | printf(" "); |
1818 | } | 1818 | } |
1819 | 1819 | ||
1820 | printf(" %-20s %9s %9s %9s", | 1820 | printf(" %-*s %9s %9s %9s", comm_width, |
1821 | "task name", "wait time", "sch delay", "run time"); | 1821 | "task name", "wait time", "sch delay", "run time"); |
1822 | 1822 | ||
1823 | printf("\n"); | 1823 | printf("\n"); |
@@ -1830,7 +1830,8 @@ static void timehist_header(struct perf_sched *sched) | |||
1830 | if (sched->show_cpu_visual) | 1830 | if (sched->show_cpu_visual) |
1831 | printf(" %*s ", ncpus, ""); | 1831 | printf(" %*s ", ncpus, ""); |
1832 | 1832 | ||
1833 | printf(" %-20s %9s %9s %9s\n", "[tid/pid]", "(msec)", "(msec)", "(msec)"); | 1833 | printf(" %-*s %9s %9s %9s\n", comm_width, |
1834 | "[tid/pid]", "(msec)", "(msec)", "(msec)"); | ||
1834 | 1835 | ||
1835 | /* | 1836 | /* |
1836 | * separator | 1837 | * separator |
@@ -1840,7 +1841,7 @@ static void timehist_header(struct perf_sched *sched) | |||
1840 | if (sched->show_cpu_visual) | 1841 | if (sched->show_cpu_visual) |
1841 | printf(" %.*s ", ncpus, graph_dotted_line); | 1842 | printf(" %.*s ", ncpus, graph_dotted_line); |
1842 | 1843 | ||
1843 | printf(" %.20s %.9s %.9s %.9s", | 1844 | printf(" %.*s %.9s %.9s %.9s", comm_width, |
1844 | graph_dotted_line, graph_dotted_line, graph_dotted_line, | 1845 | graph_dotted_line, graph_dotted_line, graph_dotted_line, |
1845 | graph_dotted_line); | 1846 | graph_dotted_line); |
1846 | 1847 | ||