All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] perf report: Provide libtraceevent with a kernel symbol resolver
@ 2018-03-08  3:28 Wang YanQing
  2018-03-09  8:57 ` [tip:perf/core] " tip-bot for Wang YanQing
  0 siblings, 1 reply; 2+ messages in thread
From: Wang YanQing @ 2018-03-08  3:28 UTC (permalink / raw)
  To: acme; +Cc: peterz, mingo, jolsa, alexander.shishkin, linux-kernel

So that beautifiers wanting to resolve kernel function addresses to
names can do its work, and when we use "perf report" for output of
"perf kmem record", we will get kernel symbol output.

This patch affect the output of "perf report" for the record data
generated by "perf kmem record" looks like below:

Before patch:
0.01%  call_site=ffffffff814e5828 ptr=0x99bb000 bytes_req=3616 bytes_alloc=4096 gfp_flags=GFP_ATOMIC
0.01%  call_site=ffffffff81370b87 ptr=0x428a3060 bytes_req=32 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO

After patch:
0.01%  (aa_alloc_task_context+0x27) call_site=ffffffff81370b87 ptr=0x428a3060 bytes_req=32 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO
0.01%  (__tty_buffer_request_room+0x88) call_site=ffffffff814e5828 ptr=0x99bb000 bytes_req=3616 bytes_alloc=4096 gfp_flags=GFP_ATOMIC

Signed-off-by: Wang YanQing <udknight@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
---
 Changes v2-v3:
 1: Fix one WARNING reported by ./scripts/checkpatch.pl
 Note: the ./scripts/checkpatch.pl report "WARNING: Possible unwrapped commit description"
       for the output of "perf report", I think we can avoid that warning, because the
       original output of "perf report" is unwrapped.

 Changes v1-v2:
 1: Add a before and after output of tools affected by the patch in the changelog.
 2: Rebase the patch to last kernel version.

 tools/perf/builtin-report.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 1eedb18..677ff58 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1337,6 +1337,15 @@ int cmd_report(int argc, const char **argv)
 		report.range_num = 1;
 	}
 
+	if (session->tevent.pevent &&
+	    pevent_set_function_resolver(session->tevent.pevent,
+					 machine__resolve_kernel_addr,
+					 &session->machines.host) < 0) {
+		pr_err("%s: failed to set libtraceevent function resolver\n",
+		       __func__);
+		return -1;
+	}
+
 	sort__setup_elide(stdout);
 
 	ret = __cmd_report(&report);
-- 
1.8.5.6.2.g3d8a54e.dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:perf/core] perf report: Provide libtraceevent with a kernel symbol resolver
  2018-03-08  3:28 [PATCH v3] perf report: Provide libtraceevent with a kernel symbol resolver Wang YanQing
@ 2018-03-09  8:57 ` tip-bot for Wang YanQing
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Wang YanQing @ 2018-03-09  8:57 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: udknight, peterz, alexander.shishkin, mingo, hpa, tglx, jolsa,
	jolsa, linux-kernel, acme

Commit-ID:  ea85ab24c502720d2eb3dec30bedb6df06d4900b
Gitweb:     https://git.kernel.org/tip/ea85ab24c502720d2eb3dec30bedb6df06d4900b
Author:     Wang YanQing <udknight@gmail.com>
AuthorDate: Thu, 8 Mar 2018 11:28:50 +0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 8 Mar 2018 11:30:51 -0300

perf report: Provide libtraceevent with a kernel symbol resolver

So that beautifiers wanting to resolve kernel function addresses to
names can do its work, and when we use "perf report" for output of "perf
kmem record", we will get kernel symbol output.

This patch affect the output of "perf report" for the record data
generated by "perf kmem record" looks like below:

Before patch:
0.01%  call_site=ffffffff814e5828 ptr=0x99bb000 bytes_req=3616 bytes_alloc=4096 gfp_flags=GFP_ATOMIC
0.01%  call_site=ffffffff81370b87 ptr=0x428a3060 bytes_req=32 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO

After patch:
0.01%  (aa_alloc_task_context+0x27) call_site=ffffffff81370b87 ptr=0x428a3060 bytes_req=32 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO
0.01%  (__tty_buffer_request_room+0x88) call_site=ffffffff814e5828 ptr=0x99bb000 bytes_req=3616 bytes_alloc=4096 gfp_flags=GFP_ATOMIC

Signed-off-by: Wang YanQing <udknight@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180308032850.GA12383@udknight-ThinkPad-E550
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-report.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c3603d4c0c57..971ccba85464 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1348,6 +1348,15 @@ repeat:
 		report.range_num = 1;
 	}
 
+	if (session->tevent.pevent &&
+	    pevent_set_function_resolver(session->tevent.pevent,
+					 machine__resolve_kernel_addr,
+					 &session->machines.host) < 0) {
+		pr_err("%s: failed to set libtraceevent function resolver\n",
+		       __func__);
+		return -1;
+	}
+
 	sort__setup_elide(stdout);
 
 	ret = __cmd_report(&report);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-09  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08  3:28 [PATCH v3] perf report: Provide libtraceevent with a kernel symbol resolver Wang YanQing
2018-03-09  8:57 ` [tip:perf/core] " tip-bot for Wang YanQing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.