perf map: Remove map_type arg from map_groups__find()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 26 Apr 2018 12:49:31 +0000 (09:49 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 26 Apr 2018 16:47:18 +0000 (13:47 -0300)
One more step in ditching the split.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-4pour7egur07tkrpbynawemv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/arm/tests/dwarf-unwind.c
tools/perf/arch/arm64/tests/dwarf-unwind.c
tools/perf/arch/powerpc/tests/dwarf-unwind.c
tools/perf/arch/x86/tests/dwarf-unwind.c
tools/perf/util/map.h

index 7d7a65ca2e8da793fe020c16261dfd40b352e16d..9a0242e74cfc3e5b53736977e588ffc8027b347c 100644 (file)
@@ -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);
index f053eae3b6eb6b2231d45f28f9e9e0a20a9bd1c4..5522ce384723ae84abd5e8d42bce33239247a9e8 100644 (file)
@@ -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);
index b22d643cb602a1897b4c62c99ffe60658af1438d..5f39efef0856d0294ba817f975dcc56283e0afcc 100644 (file)
@@ -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);
index 7da845026323d9b65980adb644e0404074287580..7879df34569a0d8b3098226f0c7eeb095a059360 100644 (file)
@@ -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);
index 579ad7d2711d06064b22eb9fc52718d268aa7b39..d035d8f0d5b286b6ecc0d56829933d7dab59fc3a 100644 (file)
@@ -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);