perf map: Shorten map_groups__find() signature
Subsystems (2)
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: abe5449d2de6ccc58444451b6fed130100892097 Gitweb: https://git.kernel.org/tip/abe5449d2de6ccc58444451b6fed130100892097 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Wed, 25 Apr 2018 12:39:22 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 26 Apr 2018 13:47:12 -0300
perf map: Shorten map_groups__find() signature
Removing the map_type, that is going away.
Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/arch/arm/tests/dwarf-unwind.c | 2 +- tools/perf/arch/arm64/tests/dwarf-unwind.c | 2 +- tools/perf/arch/powerpc/tests/dwarf-unwind.c | 2 +- tools/perf/arch/x86/tests/dwarf-unwind.c | 2 +- tools/perf/tests/vmlinux-kallsyms.c | 3 +-- tools/perf/util/event.c | 2 +- tools/perf/util/map.c | 5 ++--- tools/perf/util/map.h | 9 +++++++-- tools/perf/util/symbol.c | 2 +- 9 files changed, 16 insertions(+), 13 deletions(-)
tools/perf/arch/arm/tests/dwarf-unwind.c +1 -1
@@ -25,7 +25,7 @@ static int sample_ustack(struct perf_sample *sample, sp = (unsigned long ) regs[PERF_REG_ARM_SP ]; - map =map_groups__find (thread->mg,MAP__VARIABLE , (u64 ) sp); + map =__map_groups__find (thread->mg,MAP__VARIABLE , (u64 ) sp);if (!map) {pr_debug ("failed to get stack map\n" );free (buf);
tools/perf/arch/arm64/tests/dwarf-unwind.c +1 -1
@@ -25,7 +25,7 @@ static int sample_ustack(struct perf_sample *sample, sp = (unsigned long ) regs[PERF_REG_ARM64_SP ]; - map =map_groups__find (thread->mg,MAP__VARIABLE , (u64 ) sp); + map =__map_groups__find (thread->mg,MAP__VARIABLE , (u64 ) sp);if (!map) {pr_debug ("failed to get stack map\n" );free (buf);
tools/perf/arch/powerpc/tests/dwarf-unwind.c +1 -1
@@ -26,7 +26,7 @@ static int sample_ustack(struct perf_sample *sample, sp = (unsigned long ) regs[PERF_REG_POWERPC_R1 ]; - map =map_groups__find (thread->mg,MAP__VARIABLE , (u64 ) sp); + map =__map_groups__find (thread->mg,MAP__VARIABLE , (u64 ) sp);if (!map) {pr_debug ("failed to get stack map\n" );free (buf);
tools/perf/arch/x86/tests/dwarf-unwind.c +1 -1
@@ -26,7 +26,7 @@ static int sample_ustack(struct perf_sample *sample, sp = (unsigned long ) regs[PERF_REG_X86_SP ]; - map =map_groups__find (thread->mg,MAP__VARIABLE , (u64 ) sp); + map =__map_groups__find (thread->mg,MAP__VARIABLE , (u64 ) sp);if (!map) {pr_debug ("failed to get stack map\n" );free (buf);
tools/perf/tests/vmlinux-kallsyms.c +1 -2
@@ -19,7 +19,6 @@ int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, int subteststruct symbol *sym;struct map *kallsyms_map, *vmlinux_map, *map;struct machine kallsyms, vmlinux; -enum map_type type =MAP__FUNCTION ;struct maps *maps =machine__kernel_maps (&vmlinux);u64 mem_start, mem_end;bool header_printed;
@@ -205,7 +204,7 @@ next_pair: mem_start = vmlinux_map->unmap_ip (vmlinux_map, map->start); mem_end = vmlinux_map->unmap_ip (vmlinux_map, map->end); - pair =map_groups__find (&kallsyms.kmaps, type, mem_start); + pair =map_groups__find (&kallsyms.kmaps, mem_start);if (pair ==NULL || pair->priv)continue ;
tools/perf/util/event.c +1 -1
@@ -1534,7 +1534,7 @@ struct map *__thread__find_map(struct thread *thread, u8 cpumode, enum map_typereturn NULL ; } try_again: - al->map =map_groups__find (mg, type, al->addr); + al->map =__map_groups__find (mg, type, al->addr);if (al->map ==NULL ) {/* * If this is outside of all known maps, and is a negative
tools/perf/util/map.c +2 -3
@@ -574,7 +574,7 @@ struct symbol *map_groups__find_symbol(struct map_groups *mg, enum map_type type, u64 addr, struct map **mapp) { - struct map *map = map_groups__find(mg, type, addr); + struct map *map = __map_groups__find(mg, type, addr);/* Ensure map is loaded before using map->map_ip */ if (map !=NULL &&map__load (map) >=0 ) {
@@ -627,8 +627,7 @@ int map_groups__find_ams(struct addr_map_symbol *ams)if (ams->addr < ams->map->start || ams->addr >= ams->map->end) {if (ams->map->groups ==NULL )return -1 ; - ams->map =map_groups__find (ams->map->groups, ams->map->type, - ams->addr); + ams->map =__map_groups__find (ams->map->groups, ams->map->type, ams->addr);if (ams->map ==NULL )return -1 ; }
tools/perf/util/map.h +7 -2
@@ -214,12 +214,17 @@ static inline void map_groups__remove(struct map_groups *mg, struct map *map)maps__remove (&mg->maps[map->type], map); } -static inline struct map *map_groups__find (struct map_groups *mg, -enum map_type type,u64 addr) +static inline struct map *__map_groups__find (struct map_groups *mg, +enum map_type type,u64 addr) {return maps__find (&mg->maps[type], addr); } +static inline struct map *map_groups__find (struct map_groups *mg,u64 addr) +{ +return __map_groups__find (mg,MAP__FUNCTION , addr); +} +static inline struct map *map_groups__first (struct map_groups *mg,enum map_type type) {
tools/perf/util/symbol.c +1 -1
@@ -723,7 +723,7 @@ static int dso__split_kallsyms_for_kcore(struct dso *dso, struct map *map)if (module) *module ='\0' ; - curr_map =map_groups__find (kmaps, map->type, pos->start); + curr_map =__map_groups__find (kmaps, map->type, pos->start);if (!curr_map) {symbol__delete (pos);