Skip to contentSkip to conversation

perf map: Remove map_type arg from map_groups__find()

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message May 2, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  e1f2a0d0f2d80c7fedb5f910367bc12d02e914a7
Gitweb:     https://git.kernel.org/tip/e1f2a0d0f2d80c7fedb5f910367bc12d02e914a7
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 26 Apr 2018 09:49:31 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 26 Apr 2018 13:47:18 -0300

perf map: Remove map_type arg from map_groups__find()

One more step in ditching the split.

---
 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/util/map.h                        | 3 ++-
 5 files changed, 6 insertions(+), 5 deletions(-)
tools/perf/arch/arm/tests/dwarf-unwind.c +1 -1
index 7d7a65ca2e8d..9a0242e74cfc 100644
@@ -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, (u64)sp);
 	if (!map) {
 		pr_debug("failed to get stack map\n");
 		free(buf);
tools/perf/arch/arm64/tests/dwarf-unwind.c +1 -1
index f053eae3b6eb..5522ce384723 100644
@@ -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, (u64)sp);
 	if (!map) {
 		pr_debug("failed to get stack map\n");
 		free(buf);
tools/perf/arch/powerpc/tests/dwarf-unwind.c +1 -1
index b22d643cb602..5f39efef0856 100644
@@ -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, (u64)sp);
 	if (!map) {
 		pr_debug("failed to get stack map\n");
 		free(buf);
tools/perf/arch/x86/tests/dwarf-unwind.c +1 -1
index 7da845026323..7879df34569a 100644
@@ -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, (u64)sp);
 	if (!map) {
 		pr_debug("failed to get stack map\n");
 		free(buf);
tools/perf/util/map.h +2 -1
index 579ad7d2711d..d035d8f0d5b2 100644
@@ -222,7 +222,8 @@ static inline struct map *__map_groups__find(struct map_groups *mg,
 
 static inline struct map *map_groups__find(struct map_groups *mg, u64 addr)
 {
-	return __map_groups__find(mg, MAP__FUNCTION, addr);
+	struct map *map = __map_groups__find(mg, MAP__FUNCTION, addr);
+	return map ?: __map_groups__find(mg, MAP__VARIABLE, addr);
 }
 
 struct map *map_groups__first(struct map_groups *mg);