diff options
-rw-r--r-- | tools/perf/util/sort.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 947d21f..3d3cb83 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -588,7 +588,11 @@ static char *get_trace_output(struct hist_entry *he) } else { pevent_event_info(&seq, evsel->tp_format, &rec); } - return seq.buffer; + /* + * Trim the buffer, it starts at 4KB and we're not going to + * add anything more to this buffer. + */ + return realloc(seq.buffer, seq.len + 1); } static int64_t |