Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1566171 > unrolled thread

[PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used

Started byJosh Hunt <johunt@akamai.com>
First post2017-01-24 23:00 +0100
Last post2017-01-26 03:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used Josh Hunt <johunt@akamai.com> - 2017-01-24 23:00 +0100
    Re: [PATCH] perf probe: Ignore vmlinux build-id when offline  vmlinux and dry-run used Masami Hiramatsu <mhiramat@kernel.org> - 2017-01-26 03:40 +0100
      Re: [PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux  and dry-run used Josh Hunt <johunt@akamai.com> - 2017-01-26 03:50 +0100

#1566171 — [PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used

FromJosh Hunt <johunt@akamai.com>
Date2017-01-24 23:00 +0100
Subject[PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used
Message-ID<t3hia-1ka-15@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1567089 — Re: [PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2017-01-26 03:40 +0100
SubjectRe: [PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used
Message-ID<t3I8F-1CG-3@gated-at.bofh.it>
In reply to#1566171
On Tue, 24 Jan 2017 16:41:28 -0500
Josh Hunt <johunt@akamai.com> wrote:

> 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 .

Sorry, NAK.
Could you use -D (--definition) for that usage? It directly gives you
the definition on stdout, and also ignore the buildid.

Thank you,

> 
> 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
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

[toc] | [prev] | [next] | [standalone]


#1567090 — Re: [PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used

FromJosh Hunt <johunt@akamai.com>
Date2017-01-26 03:50 +0100
SubjectRe: [PATCH] perf probe: Ignore vmlinux build-id when offline vmlinux and dry-run used
Message-ID<t3Iil-1Gc-1@gated-at.bofh.it>
In reply to#1567089
On 01/25/2017 08:37 PM, Masami Hiramatsu wrote:
> On Tue, 24 Jan 2017 16:41:28 -0500
> Josh Hunt <johunt@akamai.com> wrote:
>
>> 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 .
>
> Sorry, NAK.
> Could you use -D (--definition) for that usage? It directly gives you
> the definition on stdout, and also ignore the buildid.

Ahhh! I guess I totally missed the point of that flag. You're right. It 
works exactly the way I want :)

Thanks. Please ignore my patch.

Josh

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web