Re: [PATCH v3 07/22] perf maps: Reduce scope of init and exit

Arnaldo Carvalho de Melo
2022-02-11T17:26:09Z

Em Fri, Feb 11, 2022 at 02:34:00AM -0800, Ian Rogers escreveu:
> Now purely accessed through new and delete, so reduce to file scope.

Seems to depend on previously dropped patch proposals.

- Arnaldo

> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> tools/perf/util/map.c | 4 ++--
> tools/perf/util/maps.h | 2 --
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
> index ae99b52502d5..4d1de363c19a 100644
> --- a/tools/perf/util/map.c
> +++ b/tools/perf/util/map.c
> @@ -527,7 +527,7 @@ u64 map__objdump_2mem(struct map *map, u64 ip)
> return ip + map->reloc;
> }
>
> -void maps__init(struct maps *maps, struct machine *machine)
> +static void maps__init(struct maps *maps, struct machine *machine)
> {
> maps->entries = RB_ROOT;
> init_rwsem(&maps->lock);
> @@ -616,7 +616,7 @@ static void __maps__purge(struct maps *maps)
> }
> }
>
> -void maps__exit(struct maps *maps)
> +static void maps__exit(struct maps *maps)
> {
> down_write(&maps->lock);
> __maps__purge(maps);
> diff --git a/tools/perf/util/maps.h b/tools/perf/util/maps.h
> index 3dd000ddf925..7e729ff42749 100644
> --- a/tools/perf/util/maps.h
> +++ b/tools/perf/util/maps.h
> @@ -60,8 +60,6 @@ static inline struct maps *maps__get(struct maps *maps)
> }
>
> void maps__put(struct maps *maps);
> -void maps__init(struct maps *maps, struct machine *machine);
> -void maps__exit(struct maps *maps);
> int maps__clone(struct thread *thread, struct maps *parent);
> size_t maps__fprintf(struct maps *maps, FILE *fp);
>
> --
> 2.35.1.265.g69c8d7142f-goog

--

- Arnaldo