]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
perf annotate: Avoid reallocation in objdump parsing
authorIan Rogers <irogers@google.com>
Thu, 10 Oct 2019 18:36:45 +0000 (11:36 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 15 Oct 2019 11:36:22 +0000 (08:36 -0300)
commit353dcaa2f979a04f9397306ae3165ccf9fc731df
tree54de0062f1a74a5922ae24889571770daeb93cb4
parent800d3f561659b5436f8c57e7c26dd1f6928b5615
perf annotate: Avoid reallocation in objdump parsing

Objdump output is parsed using getline which allocates memory for the
read. Getline will realloc if the memory is too small, but currently the
line is always freed after the call.

Simplify parse_objdump_line by performing the reading in symbol__disassemble.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: clang-built-linux@googlegroups.com
Link: http://lore.kernel.org/lkml/20191010183649.23768-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.c