From 0f1b9149057e7b78a10145d2b19256f77ef70857 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Fri, 11 Feb 2022 02:34:00 -0800 Subject: [PATCH] perf maps: Reduce scope of init and exit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Now purely accessed through new and delete, so reduce to file scope. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andrew Morton Cc: André Almeida Cc: Andy Shevchenko Cc: Darren Hart Cc: Davidlohr Bueso Cc: Dmitriy Vyukov Cc: Eric Dumazet Cc: German Gomez Cc: Hao Luo Cc: James Clark Cc: Jin Yao Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Song Liu Cc: Stephane Eranian Cc: Stephen Brennan Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: Thomas Richter Cc: Yury Norov Link: http://lore.kernel.org/lkml/20220211103415.2737789-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- 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 41c2926..df0bf90 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -524,7 +524,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); @@ -613,7 +613,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 3dd000d..7e729ff 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.7.4