aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-07-26 16:16:46 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-26 16:16:46 -0400
commitce9ee4a2de20062a97ad50ecc11ebda7e7618fd1 (patch)
treeef980cf58a571de41ddf4d682f529601ab5e1ed4 /tools/perf/util/annotate.c
parent64831a21db13495008665b33878e31b48c1e3dc7 (diff)
perf annotate stdio: Set enough columns for --show-total-period
Now that we set the first column header according to wether --show-total-period is being used, we need to size it accordingly. Based-on-a-patch-by: Taeung Song <treeze.taeung@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Milian Wolff <milian.wolff@kdab.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/n/tip-pu504ffnit4m334k09hxcbs3@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index c2b4b00166ed..5125c2bbacaa 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1142,7 +1142,7 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
1142 color = get_percent_color(percent); 1142 color = get_percent_color(percent);
1143 1143
1144 if (symbol_conf.show_total_period) 1144 if (symbol_conf.show_total_period)
1145 color_fprintf(stdout, color, " %7" PRIu64, 1145 color_fprintf(stdout, color, " %11" PRIu64,
1146 sample.period); 1146 sample.period);
1147 else 1147 else
1148 color_fprintf(stdout, color, " %7.2f", percent); 1148 color_fprintf(stdout, color, " %7.2f", percent);
@@ -1165,7 +1165,7 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
1165 } else if (max_lines && printed >= max_lines) 1165 } else if (max_lines && printed >= max_lines)
1166 return 1; 1166 return 1;
1167 else { 1167 else {
1168 int width = 8; 1168 int width = symbol_conf.show_total_period ? 12 : 8;
1169 1169
1170 if (queue) 1170 if (queue)
1171 return -1; 1171 return -1;
@@ -1806,7 +1806,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
1806 int printed = 2, queue_len = 0; 1806 int printed = 2, queue_len = 0;
1807 int more = 0; 1807 int more = 0;
1808 u64 len; 1808 u64 len;
1809 int width = 8; 1809 int width = symbol_conf.show_total_period ? 12 : 8;
1810 int graph_dotted_len; 1810 int graph_dotted_len;
1811 1811
1812 filename = strdup(dso->long_name); 1812 filename = strdup(dso->long_name);