linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf, tool: Fix prefix matching for kernel maps
@ 2012-02-05 17:11 Jiri Olsa
  2012-02-06 20:08 ` Arnaldo Carvalho de Melo
  2012-02-07 19:35 ` [tip:perf/core] perf tools: " tip-bot for Jiri Olsa
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Olsa @ 2012-02-05 17:11 UTC (permalink / raw)
  To: acme, a.p.zijlstra, mingo, paulus, cjashfor; +Cc: linux-kernel, Jiri Olsa

In some perf ancient versions we used '[kernel.kallsyms._text]' as
the name for the kernel map.

This got changed with commit:
  perf: 'perf kvm' tool for monitoring guest performance from host
  commit a1645ce12adb6c9cc9e19d7695466204e3f017fe
  Author: Zhang, Yanmin <yanmin_zhang@linux.intel.com>

and we started to use following name '[kernel.kallsyms]_text'.

This name change is important for the report code dealing with ancient
perf data. When processing the kernel map event, we need to recognize
the old naming (dont match the last ']') and initialize the kernel map
correctly.

The subsequent call to maps__set_kallsyms_ref_reloc_sym deals with the
superfluous ']' to get correct symbol name.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
 tools/perf/util/event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 73ddaf0..2044324 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -554,7 +554,7 @@ static int perf_event__process_kernel_mmap(struct perf_tool *tool __used,
 
 	is_kernel_mmap = memcmp(event->mmap.filename,
 				kmmap_prefix,
-				strlen(kmmap_prefix)) == 0;
+				strlen(kmmap_prefix) - 1) == 0;
 	if (event->mmap.filename[0] == '/' ||
 	    (!is_kernel_mmap && event->mmap.filename[0] == '[')) {
 
-- 
1.7.4.4


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

* Re: [PATCH] perf, tool: Fix prefix matching for kernel maps
  2012-02-05 17:11 [PATCH] perf, tool: Fix prefix matching for kernel maps Jiri Olsa
@ 2012-02-06 20:08 ` Arnaldo Carvalho de Melo
  2012-02-07 19:35 ` [tip:perf/core] perf tools: " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-02-06 20:08 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: a.p.zijlstra, mingo, paulus, cjashfor, linux-kernel

Em Sun, Feb 05, 2012 at 06:11:05PM +0100, Jiri Olsa escreveu:
> In some perf ancient versions we used '[kernel.kallsyms._text]' as
> the name for the kernel map.
> 
> This got changed with commit:
>   perf: 'perf kvm' tool for monitoring guest performance from host
>   commit a1645ce12adb6c9cc9e19d7695466204e3f017fe
>   Author: Zhang, Yanmin <yanmin_zhang@linux.intel.com>
> 
> and we started to use following name '[kernel.kallsyms]_text'.
> 
> This name change is important for the report code dealing with ancient
> perf data. When processing the kernel map event, we need to recognize
> the old naming (dont match the last ']') and initialize the kernel map
> correctly.
> 
> The subsequent call to maps__set_kallsyms_ref_reloc_sym deals with the
> superfluous ']' to get correct symbol name.

Good catch & fix, thanks.

People curious about that -1 can look at 'git blame' to read the above
historical explanation ;-)

- Arnaldo
 
> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
> ---
>  tools/perf/util/event.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
> index 73ddaf0..2044324 100644
> --- a/tools/perf/util/event.c
> +++ b/tools/perf/util/event.c
> @@ -554,7 +554,7 @@ static int perf_event__process_kernel_mmap(struct perf_tool *tool __used,
>  
>  	is_kernel_mmap = memcmp(event->mmap.filename,
>  				kmmap_prefix,
> -				strlen(kmmap_prefix)) == 0;
> +				strlen(kmmap_prefix) - 1) == 0;
>  	if (event->mmap.filename[0] == '/' ||
>  	    (!is_kernel_mmap && event->mmap.filename[0] == '[')) {
>  
> -- 
> 1.7.4.4

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

* [tip:perf/core] perf tools: Fix prefix matching for kernel maps
  2012-02-05 17:11 [PATCH] perf, tool: Fix prefix matching for kernel maps Jiri Olsa
  2012-02-06 20:08 ` Arnaldo Carvalho de Melo
@ 2012-02-07 19:35 ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jiri Olsa @ 2012-02-07 19:35 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, jolsa,
	tglx, cjashfor, mingo

Commit-ID:  bf32c9ebc9890764c7a9984e3a0c8a57a059753d
Gitweb:     http://git.kernel.org/tip/bf32c9ebc9890764c7a9984e3a0c8a57a059753d
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Sun, 5 Feb 2012 18:11:05 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 6 Feb 2012 18:57:39 -0200

perf tools: Fix prefix matching for kernel maps

In some perf ancient versions we used '[kernel.kallsyms._text]' as the
name for the kernel map.

This got changed with commit:
  perf: 'perf kvm' tool for monitoring guest performance from host
  commit a1645ce12adb6c9cc9e19d7695466204e3f017fe
  Author: Zhang, Yanmin <yanmin_zhang@linux.intel.com>

and we started to use following name '[kernel.kallsyms]_text'.

This name change is important for the report code dealing with ancient
perf data. When processing the kernel map event, we need to recognize
the old naming (dont match the last ']') and initialize the kernel map
correctly.

The subsequent call to maps__set_kallsyms_ref_reloc_sym deals with the
superfluous ']' to get correct symbol name.

Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1328461865-6127-1-git-send-email-jolsa@redhat.com
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 73ddaf0..2044324 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -554,7 +554,7 @@ static int perf_event__process_kernel_mmap(struct perf_tool *tool __used,
 
 	is_kernel_mmap = memcmp(event->mmap.filename,
 				kmmap_prefix,
-				strlen(kmmap_prefix)) == 0;
+				strlen(kmmap_prefix) - 1) == 0;
 	if (event->mmap.filename[0] == '/' ||
 	    (!is_kernel_mmap && event->mmap.filename[0] == '[')) {
 

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

end of thread, other threads:[~2012-02-07 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-05 17:11 [PATCH] perf, tool: Fix prefix matching for kernel maps Jiri Olsa
2012-02-06 20:08 ` Arnaldo Carvalho de Melo
2012-02-07 19:35 ` [tip:perf/core] perf tools: " tip-bot for Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).