aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r--tools/perf/util/hist.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index e7263d49bcf0..be22ae6ef055 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -876,6 +876,9 @@ unsigned int hists__sort_list_width(struct hists *self)
876 if (!se->elide) 876 if (!se->elide)
877 ret += 2 + hists__col_len(self, se->se_width_idx); 877 ret += 2 + hists__col_len(self, se->se_width_idx);
878 878
879 if (verbose) /* Addr + origin */
880 ret += 3 + BITS_PER_LONG / 4;
881
879 return ret; 882 return ret;
880} 883}
881 884
@@ -980,9 +983,9 @@ int hist_entry__inc_addr_samples(struct hist_entry *self, u64 ip)
980 return 0; 983 return 0;
981} 984}
982 985
983static struct objdump_line *objdump_line__new(s64 offset, char *line) 986static struct objdump_line *objdump_line__new(s64 offset, char *line, size_t privsize)
984{ 987{
985 struct objdump_line *self = malloc(sizeof(*self)); 988 struct objdump_line *self = malloc(sizeof(*self) + privsize);
986 989
987 if (self != NULL) { 990 if (self != NULL) {
988 self->offset = offset; 991 self->offset = offset;
@@ -1014,7 +1017,7 @@ struct objdump_line *objdump__get_next_ip_line(struct list_head *head,
1014} 1017}
1015 1018
1016static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file, 1019static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
1017 struct list_head *head) 1020 struct list_head *head, size_t privsize)
1018{ 1021{
1019 struct symbol *sym = self->ms.sym; 1022 struct symbol *sym = self->ms.sym;
1020 struct objdump_line *objdump_line; 1023 struct objdump_line *objdump_line;
@@ -1065,7 +1068,7 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
1065 offset = -1; 1068 offset = -1;
1066 } 1069 }
1067 1070
1068 objdump_line = objdump_line__new(offset, line); 1071 objdump_line = objdump_line__new(offset, line, privsize);
1069 if (objdump_line == NULL) { 1072 if (objdump_line == NULL) {
1070 free(line); 1073 free(line);
1071 return -1; 1074 return -1;
@@ -1075,7 +1078,8 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
1075 return 0; 1078 return 0;
1076} 1079}
1077 1080
1078int hist_entry__annotate(struct hist_entry *self, struct list_head *head) 1081int hist_entry__annotate(struct hist_entry *self, struct list_head *head,
1082 size_t privsize)
1079{ 1083{
1080 struct symbol *sym = self->ms.sym; 1084 struct symbol *sym = self->ms.sym;
1081 struct map *map = self->ms.map; 1085 struct map *map = self->ms.map;
@@ -1140,7 +1144,7 @@ fallback:
1140 goto out_free_filename; 1144 goto out_free_filename;
1141 1145
1142 while (!feof(file)) 1146 while (!feof(file))
1143 if (hist_entry__parse_objdump_line(self, file, head) < 0) 1147 if (hist_entry__parse_objdump_line(self, file, head, privsize) < 0)
1144 break; 1148 break;
1145 1149
1146 pclose(file); 1150 pclose(file);