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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 62ec9b0e4b9a..be22ae6ef055 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -983,9 +983,9 @@ int hist_entry__inc_addr_samples(struct hist_entry *self, u64 ip)
983 return 0; 983 return 0;
984} 984}
985 985
986static struct objdump_line *objdump_line__new(s64 offset, char *line) 986static struct objdump_line *objdump_line__new(s64 offset, char *line, size_t privsize)
987{ 987{
988 struct objdump_line *self = malloc(sizeof(*self)); 988 struct objdump_line *self = malloc(sizeof(*self) + privsize);
989 989
990 if (self != NULL) { 990 if (self != NULL) {
991 self->offset = offset; 991 self->offset = offset;
@@ -1017,7 +1017,7 @@ struct objdump_line *objdump__get_next_ip_line(struct list_head *head,
1017} 1017}
1018 1018
1019static 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,
1020 struct list_head *head) 1020 struct list_head *head, size_t privsize)
1021{ 1021{
1022 struct symbol *sym = self->ms.sym; 1022 struct symbol *sym = self->ms.sym;
1023 struct objdump_line *objdump_line; 1023 struct objdump_line *objdump_line;
@@ -1068,7 +1068,7 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
1068 offset = -1; 1068 offset = -1;
1069 } 1069 }
1070 1070
1071 objdump_line = objdump_line__new(offset, line); 1071 objdump_line = objdump_line__new(offset, line, privsize);
1072 if (objdump_line == NULL) { 1072 if (objdump_line == NULL) {
1073 free(line); 1073 free(line);
1074 return -1; 1074 return -1;
@@ -1078,7 +1078,8 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
1078 return 0; 1078 return 0;
1079} 1079}
1080 1080
1081int 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)
1082{ 1083{
1083 struct symbol *sym = self->ms.sym; 1084 struct symbol *sym = self->ms.sym;
1084 struct map *map = self->ms.map; 1085 struct map *map = self->ms.map;
@@ -1143,7 +1144,7 @@ fallback:
1143 goto out_free_filename; 1144 goto out_free_filename;
1144 1145
1145 while (!feof(file)) 1146 while (!feof(file))
1146 if (hist_entry__parse_objdump_line(self, file, head) < 0) 1147 if (hist_entry__parse_objdump_line(self, file, head, privsize) < 0)
1147 break; 1148 break;
1148 1149
1149 pclose(file); 1150 pclose(file);