diff options
-rw-r--r-- | tools/perf/util/hist.c | 26 | ||||
-rw-r--r-- | tools/perf/util/sort.c | 2 |
2 files changed, 16 insertions, 12 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 514fc0470e38..72b4eec820c3 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -70,9 +70,17 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h) | |||
70 | int symlen; | 70 | int symlen; |
71 | u16 len; | 71 | u16 len; |
72 | 72 | ||
73 | if (h->ms.sym) | 73 | /* |
74 | hists__new_col_len(hists, HISTC_SYMBOL, h->ms.sym->namelen + 4); | 74 | * +4 accounts for '[x] ' priv level info |
75 | else { | 75 | * +2 accounts for 0x prefix on raw addresses |
76 | * +3 accounts for ' y ' symtab origin info | ||
77 | */ | ||
78 | if (h->ms.sym) { | ||
79 | symlen = h->ms.sym->namelen + 4; | ||
80 | if (verbose) | ||
81 | symlen += BITS_PER_LONG / 4 + 2 + 3; | ||
82 | hists__new_col_len(hists, HISTC_SYMBOL, symlen); | ||
83 | } else { | ||
76 | symlen = unresolved_col_width + 4 + 2; | 84 | symlen = unresolved_col_width + 4 + 2; |
77 | hists__new_col_len(hists, HISTC_SYMBOL, symlen); | 85 | hists__new_col_len(hists, HISTC_SYMBOL, symlen); |
78 | hists__set_unres_dso_col_len(hists, HISTC_DSO); | 86 | hists__set_unres_dso_col_len(hists, HISTC_DSO); |
@@ -91,12 +99,10 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h) | |||
91 | hists__new_col_len(hists, HISTC_PARENT, h->parent->namelen); | 99 | hists__new_col_len(hists, HISTC_PARENT, h->parent->namelen); |
92 | 100 | ||
93 | if (h->branch_info) { | 101 | if (h->branch_info) { |
94 | /* | ||
95 | * +4 accounts for '[x] ' priv level info | ||
96 | * +2 account of 0x prefix on raw addresses | ||
97 | */ | ||
98 | if (h->branch_info->from.sym) { | 102 | if (h->branch_info->from.sym) { |
99 | symlen = (int)h->branch_info->from.sym->namelen + 4; | 103 | symlen = (int)h->branch_info->from.sym->namelen + 4; |
104 | if (verbose) | ||
105 | symlen += BITS_PER_LONG / 4 + 2 + 3; | ||
100 | hists__new_col_len(hists, HISTC_SYMBOL_FROM, symlen); | 106 | hists__new_col_len(hists, HISTC_SYMBOL_FROM, symlen); |
101 | 107 | ||
102 | symlen = dso__name_len(h->branch_info->from.map->dso); | 108 | symlen = dso__name_len(h->branch_info->from.map->dso); |
@@ -109,6 +115,8 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h) | |||
109 | 115 | ||
110 | if (h->branch_info->to.sym) { | 116 | if (h->branch_info->to.sym) { |
111 | symlen = (int)h->branch_info->to.sym->namelen + 4; | 117 | symlen = (int)h->branch_info->to.sym->namelen + 4; |
118 | if (verbose) | ||
119 | symlen += BITS_PER_LONG / 4 + 2 + 3; | ||
112 | hists__new_col_len(hists, HISTC_SYMBOL_TO, symlen); | 120 | hists__new_col_len(hists, HISTC_SYMBOL_TO, symlen); |
113 | 121 | ||
114 | symlen = dso__name_len(h->branch_info->to.map->dso); | 122 | symlen = dso__name_len(h->branch_info->to.map->dso); |
@@ -121,10 +129,6 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h) | |||
121 | } | 129 | } |
122 | 130 | ||
123 | if (h->mem_info) { | 131 | if (h->mem_info) { |
124 | /* | ||
125 | * +4 accounts for '[x] ' priv level info | ||
126 | * +2 account of 0x prefix on raw addresses | ||
127 | */ | ||
128 | if (h->mem_info->daddr.sym) { | 132 | if (h->mem_info->daddr.sym) { |
129 | symlen = (int)h->mem_info->daddr.sym->namelen + 4 | 133 | symlen = (int)h->mem_info->daddr.sym->namelen + 4 |
130 | + unresolved_col_width + 2; | 134 | + unresolved_col_width + 2; |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 5f52d492590c..16d5e38befe5 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -194,7 +194,7 @@ static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym, | |||
194 | if (verbose) { | 194 | if (verbose) { |
195 | char o = map ? dso__symtab_origin(map->dso) : '!'; | 195 | char o = map ? dso__symtab_origin(map->dso) : '!'; |
196 | ret += repsep_snprintf(bf, size, "%-#*llx %c ", | 196 | ret += repsep_snprintf(bf, size, "%-#*llx %c ", |
197 | BITS_PER_LONG / 4, ip, o); | 197 | BITS_PER_LONG / 4 + 2, ip, o); |
198 | } | 198 | } |
199 | 199 | ||
200 | ret += repsep_snprintf(bf + ret, size - ret, "[%c] ", level); | 200 | ret += repsep_snprintf(bf + ret, size - ret, "[%c] ", level); |