diff options
author | Jiri Olsa <jolsa@kernel.org> | 2020-10-13 21:24:35 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-10-14 13:46:02 +0200 |
commit | 3ff1b8c8cc123f21828ff9538f13f1770a9a4099 (patch) | |
tree | 49e0feac476f5bbd3a3355cae92afdf24e7665b1 /tools/perf/util/build-id.c | |
parent | perf tools: Pass build_id object to filename__read_build_id() (diff) | |
download | linux-3ff1b8c8cc123f21828ff9538f13f1770a9a4099.tar.xz linux-3ff1b8c8cc123f21828ff9538f13f1770a9a4099.zip |
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/build-id.c')
-rw-r--r-- | tools/perf/util/build-id.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index 62b258aaa128..1c332e78bbc3 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c @@ -113,7 +113,7 @@ int build_id__sprintf(const u8 *build_id, int len, char *bf) int sysfs__sprintf_build_id(const char *root_dir, char *sbuild_id) { char notes[PATH_MAX]; - u8 build_id[BUILD_ID_SIZE]; + struct build_id bid; int ret; if (!root_dir) @@ -121,11 +121,11 @@ int sysfs__sprintf_build_id(const char *root_dir, char *sbuild_id) scnprintf(notes, sizeof(notes), "%s/sys/kernel/notes", root_dir); - ret = sysfs__read_build_id(notes, build_id, sizeof(build_id)); + ret = sysfs__read_build_id(notes, &bid); if (ret < 0) return ret; - return build_id__sprintf(build_id, sizeof(build_id), sbuild_id); + return build_id__sprintf(bid.data, sizeof(bid.data), sbuild_id); } int filename__sprintf_build_id(const char *pathname, char *sbuild_id) |