[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-4pour7egur07tkrpbynawemv@git.kernel.org>
Date: Wed, 2 May 2018 10:57:53 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, jolsa@...nel.org, adrian.hunter@...el.com,
acme@...hat.com, wangnan0@...wei.com, tglx@...utronix.de,
linux-kernel@...r.kernel.org, mingo@...nel.org,
namhyung@...nel.org, dsahern@...il.com
Subject: [tip:perf/core] perf map: Remove map_type arg from
map_groups__find()
Commit-ID: e1f2a0d0f2d80c7fedb5f910367bc12d02e914a7
Gitweb: https://git.kernel.org/tip/e1f2a0d0f2d80c7fedb5f910367bc12d02e914a7
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Thu, 26 Apr 2018 09:49:31 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
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.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: https://lkml.kernel.org/n/tip-4pour7egur07tkrpbynawemv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
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(-)
diff --git a/tools/perf/arch/arm/tests/dwarf-unwind.c b/tools/perf/arch/arm/tests/dwarf-unwind.c
index 7d7a65ca2e8d..9a0242e74cfc 100644
--- a/tools/perf/arch/arm/tests/dwarf-unwind.c
+++ b/tools/perf/arch/arm/tests/dwarf-unwind.c
@@ -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);
diff --git a/tools/perf/arch/arm64/tests/dwarf-unwind.c b/tools/perf/arch/arm64/tests/dwarf-unwind.c
index f053eae3b6eb..5522ce384723 100644
--- a/tools/perf/arch/arm64/tests/dwarf-unwind.c
+++ b/tools/perf/arch/arm64/tests/dwarf-unwind.c
@@ -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);
diff --git a/tools/perf/arch/powerpc/tests/dwarf-unwind.c b/tools/perf/arch/powerpc/tests/dwarf-unwind.c
index b22d643cb602..5f39efef0856 100644
--- a/tools/perf/arch/powerpc/tests/dwarf-unwind.c
+++ b/tools/perf/arch/powerpc/tests/dwarf-unwind.c
@@ -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);
diff --git a/tools/perf/arch/x86/tests/dwarf-unwind.c b/tools/perf/arch/x86/tests/dwarf-unwind.c
index 7da845026323..7879df34569a 100644
--- a/tools/perf/arch/x86/tests/dwarf-unwind.c
+++ b/tools/perf/arch/x86/tests/dwarf-unwind.c
@@ -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);
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index 579ad7d2711d..d035d8f0d5b2 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -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);
Powered by blists - more mailing lists