File perf-annotate-stdio-set-enough-columns-for-show-total-period.patch of Package perf
54
1
From: Arnaldo Carvalho de Melo <acme@redhat.com>
2
Date: Wed, 26 Jul 2017 17:16:46 -0300
3
Subject: perf annotate stdio: Set enough columns for --show-total-period
4
Git-commit: ce9ee4a2de20062a97ad50ecc11ebda7e7618fd1
5
Patch-mainline: v4.14-rc1
6
References: bsc#1070010 (git-fixes - dependency)
7
Signed-off-By: Tony Jones <tonyj@suse.de>
8
9
Now that we set the first column header according to wether
10
--show-total-period is being used, we need to size it accordingly.
11
12
Based-on-a-patch-by: Taeung Song <treeze.taeung@gmail.com>
13
Cc: Jiri Olsa <jolsa@redhat.com>
14
Cc: Milian Wolff <milian.wolff@kdab.com>
15
Cc: Namhyung Kim <namhyung@kernel.org>
16
Link: http://lkml.kernel.org/n/tip-pu504ffnit4m334k09hxcbs3@git.kernel.org
17
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
18
---
19
tools/perf/util/annotate.c | 6 +++---
20
1 file changed, 3 insertions(+), 3 deletions(-)
21
22
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
23
index c2b4b00166ed..5125c2bbacaa 100644
24
--- a/tools/perf/util/annotate.c
25
+++ b/tools/perf/util/annotate.c
26
27
color = get_percent_color(percent);
28
29
if (symbol_conf.show_total_period)
30
- color_fprintf(stdout, color, " %7" PRIu64,
31
+ color_fprintf(stdout, color, " %11" PRIu64,
32
sample.period);
33
else
34
color_fprintf(stdout, color, " %7.2f", percent);
35
36
} else if (max_lines && printed >= max_lines)
37
return 1;
38
else {
39
- int width = 8;
40
+ int width = symbol_conf.show_total_period ? 12 : 8;
41
42
if (queue)
43
return -1;
44
45
int printed = 2, queue_len = 0;
46
int more = 0;
47
u64 len;
48
- int width = 8;
49
+ int width = symbol_conf.show_total_period ? 12 : 8;
50
int graph_dotted_len;
51
52
filename = strdup(dso->long_name);
53
54