perf dso: Add dso__filename_with_chroot() to reduce number of accesses to dso->nsinfo members
We'll need to reference count dso->nsinfo, so reduce the number of direct accesses by having a shorter form of obtaining a filename with a chroot (namespace one). Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com> Cc: Dmitriy Vyukov <dvyukov@google.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Riccardo Mancini <rickyman7@gmail.com> Cc: Stephane Eranian <eranian@google.com> Cc: Stephen Brennan <stephen.s.brennan@oracle.com> Link: https://lore.kernel.org/lkml/ZD26ZlqSbgSyH5lX@kernel.org [ Used nsinfo__pid(dso->nsinfo), as it was already present ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@ -630,10 +630,8 @@ static int dso__read_build_id(struct dso *dso)
|
||||
if (filename__read_build_id(dso->long_name, &dso->bid) > 0)
|
||||
dso->has_build_id = true;
|
||||
else if (dso->nsinfo) {
|
||||
char *new_name;
|
||||
char *new_name = dso__filename_with_chroot(dso, dso->long_name);
|
||||
|
||||
new_name = filename_with_chroot(dso->nsinfo->pid,
|
||||
dso->long_name);
|
||||
if (new_name && filename__read_build_id(new_name, &dso->bid) > 0)
|
||||
dso->has_build_id = true;
|
||||
free(new_name);
|
||||
|
Reference in New Issue
Block a user