perf tools: Pass build_id object to build_id__sprintf()

Passing build_id object to build_id__sprintf function, so it can operate
with the proper size of build id.

This will create proper md5 build id readable names,
like following:

  a50e350e97c43b4708d09bcd85ebfff7

instead of:

  a50e350e97c43b4708d09bcd85ebfff700000000

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20201013192441.1299447-5-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Jiri Olsa
2020-10-13 21:24:36 +02:00
committed by Arnaldo Carvalho de Melo
parent 3ff1b8c8cc
commit bf5411695a
12 changed files with 43 additions and 35 deletions

View File

@@ -37,7 +37,7 @@ static int build_id_cache__add_file(const char *filename)
return err;
}
build_id__sprintf(bid.data, sizeof(bid.data), sbuild_id);
build_id__sprintf(&bid, sbuild_id);
err = build_id_cache__add_s(sbuild_id, filename, NULL, false, false);
if (err < 0)
pr_debug("Failed to add build id cache of %s\n", filename);