summaryrefslogtreecommitdiff
path: root/tools/perf/util/symbol-minimal.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2020-10-13 21:24:35 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-10-14 08:46:02 -0300
commit3ff1b8c8cc123f21828ff9538f13f1770a9a4099 (patch)
tree49e0feac476f5bbd3a3355cae92afdf24e7665b1 /tools/perf/util/symbol-minimal.c
parentf766819cd5290d42efa55c505b9bed184fec17bf (diff)
perf tools: Pass build id object to sysfs__read_build_id()
Passing build id object to sysfs__read_build_id function, so it can populate the size of the build_id object. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20201013192441.1299447-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol-minimal.c')
-rw-r--r--tools/perf/util/symbol-minimal.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index 5173331ee6e4..dba6b9e5d64e 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -222,9 +222,8 @@ out:
return ret;
}
-int sysfs__read_build_id(const char *filename, void *build_id, size_t size __maybe_unused)
+int sysfs__read_build_id(const char *filename, struct build_id *bid)
{
- struct build_id bid;
int fd;
int ret = -1;
struct stat stbuf;
@@ -246,9 +245,7 @@ int sysfs__read_build_id(const char *filename, void *build_id, size_t size __may
if (read(fd, buf, buf_size) != (ssize_t) buf_size)
goto out_free;
- ret = read_build_id(buf, buf_size, &bid, false);
- if (ret > 0)
- memcpy(build_id, bid.data, bid.size);
+ ret = read_build_id(buf, buf_size, bid, false);
out_free:
free(buf);
out: