diff --git a/tools/perf/tests/hists_common.c b/tools/perf/tests/hists_common.c index bcde1d27919c2aab17074c2035695a4f84e34e2c..915f60af6a0ebe6fba525e0f65b1e8205a1da025 100644 --- a/tools/perf/tests/hists_common.c +++ b/tools/perf/tests/hists_common.c @@ -121,8 +121,7 @@ struct machine *setup_fake_machine(struct machines *machines) size_t k; struct dso *dso; - dso = __dsos__findnew(&machine->dsos, - fake_symbols[i].dso_name); + dso = machine__findnew_dso(machine, fake_symbols[i].dso_name); if (dso == NULL) goto out; diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index ff040b0569d6c006d067cb7c69f0530ad52a6a59..b335db3532a2b471ed97428ec31f8bb675a938bf 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -833,7 +833,7 @@ struct dso *machine__findnew_kernel(struct machine *machine, const char *name, /* * The kernel dso could be created by build_id processing. */ - struct dso *dso = __dsos__findnew(&machine->dsos, name); + struct dso *dso = machine__findnew_dso(machine, name); /* * We need to run this in all cases, since during the build_id diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index a900e9441fb53e23c898b8fb8466f9ee9c39db81..851143a7988d303ce7d9ef882c56333309767bfc 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -1264,7 +1264,7 @@ static int __event_process_build_id(struct build_id_event *bev, goto out; } - dso = __dsos__findnew(&machine->dsos, filename); + dso = machine__findnew_dso(machine, filename); if (dso != NULL) { char sbuild_id[BUILD_ID_SIZE * 2 + 1]; diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index ffd31079d44712484c243175aa72d6c529e8c96e..698da1da51686a99097531d1e6e5089bec166ea1 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1157,7 +1157,7 @@ static int machine__process_kernel_mmap_event(struct machine *machine, } if (kernel == NULL) - kernel = __dsos__findnew(&machine->dsos, kmmap_prefix); + kernel = machine__findnew_dso(machine, kmmap_prefix); if (kernel == NULL) goto out_problem; @@ -1915,3 +1915,8 @@ int machine__get_kernel_start(struct machine *machine) } return err; } + +struct dso *machine__findnew_dso(struct machine *machine, const char *filename) +{ + return __dsos__findnew(&machine->dsos, filename); +} diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index aabca583e6559450c0796e127b734c8b63346711..39a0ca06cbd804c912f265750ed340f2ee9f0794 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h @@ -154,6 +154,8 @@ static inline bool machine__is_host(struct machine *machine) struct thread *__machine__findnew_thread(struct machine *machine, pid_t pid, pid_t tid); struct thread *machine__findnew_thread(struct machine *machine, pid_t pid, pid_t tid); +struct dso *machine__findnew_dso(struct machine *machine, const char *filename); + size_t machine__fprintf(struct machine *machine, FILE *fp); static inline diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 57ff0256c22cd7bf6587f0b52905c58e3fd01877..d15e1e9dd2ae878a1e64819c0f6f90842fc24885 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -180,7 +180,7 @@ struct map *map__new(struct machine *machine, u64 start, u64 len, pgoff = 0; dso = vdso__dso_findnew(machine, thread); } else - dso = __dsos__findnew(&machine->dsos, filename); + dso = machine__findnew_dso(machine, filename); if (dso == NULL) goto out_delete;