public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: Fix annotation with kcore
@ 2014-11-11 10:04 Adrian Hunter
  2014-11-11 13:05 ` Arnaldo Carvalho de Melo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Adrian Hunter @ 2014-11-11 10:04 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, linux-kernel, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Namhyung Kim, Paul Mackerras, Stephane Eranian

Patch "perf tools: Fix build-id matching on vmlinux"
breaks annotation with kcore.  The problem is that
symbol__annotate() first gets the filename based on
the build-id which was previously not set.
This patch provides a quick fix, however there should
probably be only one way to determine the filename. e.g.
symbol__annotate() should use the same way as
dso__data_fd().

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/annotate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 7dabde1..873c877 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -915,6 +915,8 @@ int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize)
 			return -ENOMEM;
 		}
 		goto fallback;
+	} else if (dso__is_kcore(dso)) {
+		goto fallback;
 	} else if (readlink(symfs_filename, command, sizeof(command)) < 0 ||
 		   strstr(command, "[kernel.kallsyms]") ||
 		   access(symfs_filename, R_OK)) {
-- 
1.9.1


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

* Re: [PATCH] perf tools: Fix annotation with kcore
  2014-11-11 10:04 [PATCH] perf tools: Fix annotation with kcore Adrian Hunter
@ 2014-11-11 13:05 ` Arnaldo Carvalho de Melo
  2014-11-11 13:56   ` Adrian Hunter
  2014-11-12 13:34 ` Arnaldo Carvalho de Melo
  2014-11-20  7:37 ` [tip:perf/core] " tip-bot for Adrian Hunter
  2 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-11-11 13:05 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Peter Zijlstra, linux-kernel, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Namhyung Kim, Paul Mackerras, Stephane Eranian

Em Tue, Nov 11, 2014 at 12:04:54PM +0200, Adrian Hunter escreveu:
> Patch "perf tools: Fix build-id matching on vmlinux"

So, I will check this, but please state for which branch this is
supposed to be applied, i.e. does it fixes perf/urgent stuff and thus
needs to go ASAP, or is this something that affects perf/core and thus
can wait till I process more urgent stuff?

- Arnaldo

> breaks annotation with kcore.  The problem is that
> symbol__annotate() first gets the filename based on
> the build-id which was previously not set.
> This patch provides a quick fix, however there should
> probably be only one way to determine the filename. e.g.
> symbol__annotate() should use the same way as
> dso__data_fd().
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>  tools/perf/util/annotate.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index 7dabde1..873c877 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -915,6 +915,8 @@ int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize)
>  			return -ENOMEM;
>  		}
>  		goto fallback;
> +	} else if (dso__is_kcore(dso)) {
> +		goto fallback;
>  	} else if (readlink(symfs_filename, command, sizeof(command)) < 0 ||
>  		   strstr(command, "[kernel.kallsyms]") ||
>  		   access(symfs_filename, R_OK)) {
> -- 
> 1.9.1

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

* Re: [PATCH] perf tools: Fix annotation with kcore
  2014-11-11 13:05 ` Arnaldo Carvalho de Melo
@ 2014-11-11 13:56   ` Adrian Hunter
  0 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2014-11-11 13:56 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, linux-kernel, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Namhyung Kim, Paul Mackerras, Stephane Eranian

On 11/11/14 15:05, Arnaldo Carvalho de Melo wrote:
> Em Tue, Nov 11, 2014 at 12:04:54PM +0200, Adrian Hunter escreveu:
>> Patch "perf tools: Fix build-id matching on vmlinux"
> 
> So, I will check this, but please state for which branch this is
> supposed to be applied, i.e. does it fixes perf/urgent stuff and thus
> needs to go ASAP, or is this something that affects perf/core and thus
> can wait till I process more urgent stuff?

It is perf/core so it can wait.

> 
> - Arnaldo
> 
>> breaks annotation with kcore.  The problem is that
>> symbol__annotate() first gets the filename based on
>> the build-id which was previously not set.
>> This patch provides a quick fix, however there should
>> probably be only one way to determine the filename. e.g.
>> symbol__annotate() should use the same way as
>> dso__data_fd().
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>>  tools/perf/util/annotate.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
>> index 7dabde1..873c877 100644
>> --- a/tools/perf/util/annotate.c
>> +++ b/tools/perf/util/annotate.c
>> @@ -915,6 +915,8 @@ int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize)
>>  			return -ENOMEM;
>>  		}
>>  		goto fallback;
>> +	} else if (dso__is_kcore(dso)) {
>> +		goto fallback;
>>  	} else if (readlink(symfs_filename, command, sizeof(command)) < 0 ||
>>  		   strstr(command, "[kernel.kallsyms]") ||
>>  		   access(symfs_filename, R_OK)) {
>> -- 
>> 1.9.1
> 
> 


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

* Re: [PATCH] perf tools: Fix annotation with kcore
  2014-11-11 10:04 [PATCH] perf tools: Fix annotation with kcore Adrian Hunter
  2014-11-11 13:05 ` Arnaldo Carvalho de Melo
@ 2014-11-12 13:34 ` Arnaldo Carvalho de Melo
  2014-11-20  7:37 ` [tip:perf/core] " tip-bot for Adrian Hunter
  2 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-11-12 13:34 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Peter Zijlstra, linux-kernel, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Namhyung Kim, Paul Mackerras, Stephane Eranian

Em Tue, Nov 11, 2014 at 12:04:54PM +0200, Adrian Hunter escreveu:
> Patch "perf tools: Fix build-id matching on vmlinux"
> breaks annotation with kcore.  The problem is that
> symbol__annotate() first gets the filename based on
> the build-id which was previously not set.
> This patch provides a quick fix, however there should
> probably be only one way to determine the filename. e.g.
> symbol__annotate() should use the same way as
> dso__data_fd().

Agreed, please provide a patch if you feel like cleaning this up :-)

- Arnaldo
 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>  tools/perf/util/annotate.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index 7dabde1..873c877 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -915,6 +915,8 @@ int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize)
>  			return -ENOMEM;
>  		}
>  		goto fallback;
> +	} else if (dso__is_kcore(dso)) {
> +		goto fallback;
>  	} else if (readlink(symfs_filename, command, sizeof(command)) < 0 ||
>  		   strstr(command, "[kernel.kallsyms]") ||
>  		   access(symfs_filename, R_OK)) {
> -- 
> 1.9.1

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

* [tip:perf/core] perf tools: Fix annotation with kcore
  2014-11-11 10:04 [PATCH] perf tools: Fix annotation with kcore Adrian Hunter
  2014-11-11 13:05 ` Arnaldo Carvalho de Melo
  2014-11-12 13:34 ` Arnaldo Carvalho de Melo
@ 2014-11-20  7:37 ` tip-bot for Adrian Hunter
  2 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Adrian Hunter @ 2014-11-20  7:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: dsahern, tglx, peterz, adrian.hunter, jolsa, mingo, eranian, hpa,
	fweisbec, paulus, linux-kernel, acme, namhyung

Commit-ID:  ee205503f2333d639550eaed37abb455733510a3
Gitweb:     http://git.kernel.org/tip/ee205503f2333d639550eaed37abb455733510a3
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Tue, 11 Nov 2014 12:04:54 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 19 Nov 2014 12:33:47 -0300

perf tools: Fix annotation with kcore

Patch "perf tools: Fix build-id matching on vmlinux" breaks annotation
with kcore.  The problem is that symbol__annotate() first gets the
filename based on the build-id which was previously not set.

This patch provides a quick fix, however there should probably be only
one way to determine the filename. e.g.  symbol__annotate() should use
the same way as dso__data_fd().

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1415700294-30816-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 7dabde1..873c877 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -915,6 +915,8 @@ int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize)
 			return -ENOMEM;
 		}
 		goto fallback;
+	} else if (dso__is_kcore(dso)) {
+		goto fallback;
 	} else if (readlink(symfs_filename, command, sizeof(command)) < 0 ||
 		   strstr(command, "[kernel.kallsyms]") ||
 		   access(symfs_filename, R_OK)) {

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

end of thread, other threads:[~2014-11-20  7:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-11 10:04 [PATCH] perf tools: Fix annotation with kcore Adrian Hunter
2014-11-11 13:05 ` Arnaldo Carvalho de Melo
2014-11-11 13:56   ` Adrian Hunter
2014-11-12 13:34 ` Arnaldo Carvalho de Melo
2014-11-20  7:37 ` [tip:perf/core] " tip-bot for Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox