All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used
@ 2017-01-24 21:41 Josh Hunt
  2017-01-26  2:37 ` Masami Hiramatsu
  0 siblings, 1 reply; 3+ messages in thread
From: Josh Hunt @ 2017-01-24 21:41 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin
  Cc: linux-kernel, mhiramat, bgregg, Josh Hunt

Commit e50243bb ("perf probe: Ignore vmlinux Build-id when offline vmlinux given")
added the ability to ignore vmlinux when an offline vmlinux is passed and no
l, d, or a flag is also passed. This extends that to ignore build-id when
-n/--dry-run is used. This way we can gather probe information for offline kernels
using the method Brendan Gregg mentions in this post:
http://www.brendangregg.com/blog/2014-09-11/perf-kernel-line-tracing.html .

Ex:
 $ ./perf probe -k ./vmlinux-3.14.59 -nv 'do_sys_open=do_sys_open:7 filename:string dfd flags op'

will generate:
 do_sys_open+91 filename_string=+0(%si):string dfd=%di:s32 flags=%bx:s32 op=-60(%bp):u64

and then copy/paste this to the machine running the 3.14.59 kernel.

Signed-off-by: Josh Hunt <johunt@akamai.com>
---
 tools/perf/builtin-probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index f87996b..e0eea723 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -616,7 +616,7 @@ static int perf_del_probe_events(struct strfilter *filter)
 	 * nor change running kernel. So if user gives offline vmlinux,
 	 * ignore its buildid.
 	 */
-	if (!strchr("lda", params.command) && symbol_conf.vmlinux_name)
+	if ((!strchr("lda", params.command) || probe_event_dry_run) && symbol_conf.vmlinux_name)
 		symbol_conf.ignore_vmlinux_buildid = true;
 
 	switch (params.command) {
-- 
1.9.1

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

end of thread, other threads:[~2017-01-26  2:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-24 21:41 [PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used Josh Hunt
2017-01-26  2:37 ` Masami Hiramatsu
2017-01-26  2:46   ` Josh Hunt

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.