[PATCH] perf report: Enable finding the kernel inline function

From: Jin Yao
Date: Tue Jul 18 2017 - 08:34:45 EST


Currently perf has supported a mode to query inline stack. It works
well for finding the user space inline function but it doesn't work
for finding kernel inline function due to some unnecessary checking.

This patch removes these unnecessary checking. Now the kernel inline
function can be reported.

For example,
perf report --inline -g func --stdio

|--46.19%--do_huge_pmd_anonymous_page
| do_huge_pmd_anonymous_page (inline)
| __do_huge_pmd_anonymous_page (inline)
| __SetPageUptodate (inline)
| __set_bit (inline)

The result is compared with the output of addr2line. They are match.

Signed-off-by: Jin Yao <yao.jin@xxxxxxxxxxxxxxx>
---
tools/perf/ui/browsers/hists.c | 3 ---
tools/perf/ui/stdio/hist.c | 3 ---
2 files changed, 6 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 69f4570..f4bc246 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -166,9 +166,6 @@ static struct inline_node *inline_node__create(struct map *map, u64 ip)
if (dso == NULL)
return NULL;

- if (dso->kernel != DSO_TYPE_USER)
- return NULL;
-
node = dso__parse_addr_inlines(dso,
map__rip_2objdump(map, ip));

diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 42e432b..2df8eb1 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -35,9 +35,6 @@ static size_t inline__fprintf(struct map *map, u64 ip, int left_margin,
if (dso == NULL)
return 0;

- if (dso->kernel != DSO_TYPE_USER)
- return 0;
-
node = dso__parse_addr_inlines(dso,
map__rip_2objdump(map, ip));
if (node == NULL)
--
2.7.4