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: default avatarTaeung 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 64831a21
...@@ -1142,7 +1142,7 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st ...@@ -1142,7 +1142,7 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
color = get_percent_color(percent); color = get_percent_color(percent);
if (symbol_conf.show_total_period) if (symbol_conf.show_total_period)
color_fprintf(stdout, color, " %7" PRIu64, color_fprintf(stdout, color, " %11" PRIu64,
sample.period); sample.period);
else else
color_fprintf(stdout, color, " %7.2f", percent); 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,7 +1165,7 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
} else if (max_lines && printed >= max_lines) } else if (max_lines && printed >= max_lines)
return 1; return 1;
else { else {
int width = 8; int width = symbol_conf.show_total_period ? 12 : 8;
if (queue) if (queue)
return -1; return -1;
...@@ -1806,7 +1806,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, ...@@ -1806,7 +1806,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
int printed = 2, queue_len = 0; int printed = 2, queue_len = 0;
int more = 0; int more = 0;
u64 len; u64 len;
int width = 8; int width = symbol_conf.show_total_period ? 12 : 8;
int graph_dotted_len; int graph_dotted_len;
filename = strdup(dso->long_name); filename = strdup(dso->long_name);
......
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