linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/2] perf symbols: debuglink and arm mapping symbols changes
@ 2015-01-27  6:34 Victor Kamensky
  2015-01-27  6:34 ` [PATCH V3 1/2] perf symbols: Ignore mapping symbols on aarch64 Victor Kamensky
  2015-01-27  6:34 ` [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account Victor Kamensky
  0 siblings, 2 replies; 10+ messages in thread
From: Victor Kamensky @ 2015-01-27  6:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Russell King, Namhyung Kim,
	David Ahern, Will Deacon
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Adrian Hunter,
	Jiri Olsa, Avi Kivity, Masami Hiramatsu, Anton Blanchard,
	Dave Martin, linux-kernel, linux-arm-kernel, Victor Kamensky

Hi Folks,

Here is third version of mini-series that addresses couple issues
in perf symbols handling.

Changes since V2:

o Since V2 caused some controversy wrt aarch64/arm fixes [3], replace
'perf symbols: Ignore mapping symbols on aarch64' and 'perf symbols: 
improve abi compliance in arm mapping symbols handling with another 
version of almost equivalent single patch that was discussed on [1].
In new patch superset of aarch64 and arm mapping symbols handled by
single code snippet, that is more aligned with other places where
aarch64 and arm mapping symbols are handled.

Changes since V1:

o 'perf symbols: Ignore mapping symbols on aarch64': based on feedback
from Will Deacon and Russell King [1] added code that handles ARM/Aarch64
mapping symbols like "$d.<any>". Code uses similar snippet to handle
ARM mapping symbols as in another places in kernel, but it has its
own version of the code. Added proper Acked-by.

o 'perf symbols: debuglink should take symfs option into account':
based on feedback from David Ahern [2] picked more simple version that
does not make malloced copy of 'filename', that makes patch simpler.
Added proper 'Acked-and-tested-by'.

[1] https://lkml.org/lkml/2015/1/13/507

[2] https://lkml.org/lkml/2015/1/13/508

[3] https://lkml.org/lkml/2015/1/22/382

Victor Kamensky (2):
  perf symbols: Ignore mapping symbols on aarch64
  perf symbols: debuglink should take symfs option into account

 tools/perf/util/dso.c        | 6 +++---
 tools/perf/util/symbol-elf.c | 7 +++----
 2 files changed, 6 insertions(+), 7 deletions(-)

-- 
1.9.3


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

* [PATCH V3 1/2] perf symbols: Ignore mapping symbols on aarch64
  2015-01-27  6:34 [PATCH V3 0/2] perf symbols: debuglink and arm mapping symbols changes Victor Kamensky
@ 2015-01-27  6:34 ` Victor Kamensky
  2015-01-29  1:39   ` Namhyung Kim
  2015-02-18 18:26   ` [tip:perf/core] " tip-bot for Victor Kamensky
  2015-01-27  6:34 ` [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account Victor Kamensky
  1 sibling, 2 replies; 10+ messages in thread
From: Victor Kamensky @ 2015-01-27  6:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Russell King, Namhyung Kim,
	David Ahern, Will Deacon
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Adrian Hunter,
	Jiri Olsa, Avi Kivity, Masami Hiramatsu, Anton Blanchard,
	Dave Martin, linux-kernel, linux-arm-kernel, Victor Kamensky

Aarch64 ELF files use mapping symbols with special names $x, $d
to identify regions of Aarch64 code (see Aarch64 ELF ABI - "ARM
IHI 0056B", section "4.5.4 Mapping symbols").

The patch filters out these symbols at load time, similar to
"696b97a perf symbols: Ignore mapping symbols on ARM" changes
done for ARM before V8.

Also added handling of mapping symbols that has format
"$d.<any>" and similar for both cases.

Note we are not making difference between EM_ARM and
EM_AARCH64 mapping symbols instead code handles superset
of both.

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Avi Kivity <avi@cloudius-systems.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Dave Martin <Dave.Martin@arm.com>
---
 tools/perf/util/symbol-elf.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 06fcd1b..8fc6e2f 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -856,10 +856,9 @@ int dso__load_sym(struct dso *dso, struct map *map,
 		/* Reject ARM ELF "mapping symbols": these aren't unique and
 		 * don't identify functions, so will confuse the profile
 		 * output: */
-		if (ehdr.e_machine == EM_ARM) {
-			if (!strcmp(elf_name, "$a") ||
-			    !strcmp(elf_name, "$d") ||
-			    !strcmp(elf_name, "$t"))
+		if (ehdr.e_machine == EM_ARM || ehdr.e_machine == EM_AARCH64) {
+			if (elf_name[0] == '$' && strchr("adtx", elf_name[1])
+			    && (elf_name[2] == '\0' || elf_name[2] == '.'))
 				continue;
 		}
 
-- 
1.9.3


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

* [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
  2015-01-27  6:34 [PATCH V3 0/2] perf symbols: debuglink and arm mapping symbols changes Victor Kamensky
  2015-01-27  6:34 ` [PATCH V3 1/2] perf symbols: Ignore mapping symbols on aarch64 Victor Kamensky
@ 2015-01-27  6:34 ` Victor Kamensky
  2015-01-29  1:38   ` Namhyung Kim
  2015-02-18 18:26   ` [tip:perf/core] " tip-bot for Victor Kamensky
  1 sibling, 2 replies; 10+ messages in thread
From: Victor Kamensky @ 2015-01-27  6:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Russell King, Namhyung Kim,
	David Ahern, Will Deacon
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Adrian Hunter,
	Jiri Olsa, Avi Kivity, Masami Hiramatsu, Anton Blanchard,
	Dave Martin, linux-kernel, linux-arm-kernel, Victor Kamensky,
	Jiri Olsa, Waiman Long

Currently code that tries to read corresponding debug symbol
file from .gnu_debuglink section (DSO_BINARY_TYPE__DEBUGLINK)
does not take in account symfs option, so filename__read_debuglink
function cannot open ELF file, if symfs option is used.

Fix is to add proper handling of symfs as it is done in other
places: use __symbol__join_symfs function to get real file name
of target ELF file.

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Waiman Long <Waiman.Long@hp.com>
Cc: David Ahern <dsahern@gmail.com>
Acked-and-tested-by: David Ahern <dsahern@gmail.com>
---
 tools/perf/util/dso.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 45be944..ca8d8d5 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso,
 	case DSO_BINARY_TYPE__DEBUGLINK: {
 		char *debuglink;
 
-		strncpy(filename, dso->long_name, size);
-		debuglink = filename + dso->long_name_len;
+		len = __symbol__join_symfs(filename, size, dso->long_name);
+		debuglink = filename + len;
 		while (debuglink != filename && *debuglink != '/')
 			debuglink--;
 		if (*debuglink == '/')
 			debuglink++;
-		ret = filename__read_debuglink(dso->long_name, debuglink,
+		ret = filename__read_debuglink(filename, debuglink,
 					       size - (debuglink - filename));
 		}
 		break;
-- 
1.9.3


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

* Re: [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
  2015-01-27  6:34 ` [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account Victor Kamensky
@ 2015-01-29  1:38   ` Namhyung Kim
  2015-01-29  4:08     ` Victor Kamensky
  2015-02-18 18:26   ` [tip:perf/core] " tip-bot for Victor Kamensky
  1 sibling, 1 reply; 10+ messages in thread
From: Namhyung Kim @ 2015-01-29  1:38 UTC (permalink / raw)
  To: Victor Kamensky
  Cc: Arnaldo Carvalho de Melo, Russell King, David Ahern, Will Deacon,
	Peter Zijlstra, Paul Mackerras, Ingo Molnar, Adrian Hunter,
	Jiri Olsa, Avi Kivity, Masami Hiramatsu, Anton Blanchard,
	Dave Martin, linux-kernel, linux-arm-kernel, Jiri Olsa,
	Waiman Long

Hi Victor,

On Mon, Jan 26, 2015 at 10:34:02PM -0800, Victor Kamensky wrote:
> Currently code that tries to read corresponding debug symbol
> file from .gnu_debuglink section (DSO_BINARY_TYPE__DEBUGLINK)
> does not take in account symfs option, so filename__read_debuglink
> function cannot open ELF file, if symfs option is used.
> 
> Fix is to add proper handling of symfs as it is done in other
> places: use __symbol__join_symfs function to get real file name
> of target ELF file.
> 
> Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Waiman Long <Waiman.Long@hp.com>
> Cc: David Ahern <dsahern@gmail.com>
> Acked-and-tested-by: David Ahern <dsahern@gmail.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/util/dso.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
> index 45be944..ca8d8d5 100644
> --- a/tools/perf/util/dso.c
> +++ b/tools/perf/util/dso.c
> @@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso,
>  	case DSO_BINARY_TYPE__DEBUGLINK: {
>  		char *debuglink;
>  
> -		strncpy(filename, dso->long_name, size);
> -		debuglink = filename + dso->long_name_len;
> +		len = __symbol__join_symfs(filename, size, dso->long_name);
> +		debuglink = filename + len;
>  		while (debuglink != filename && *debuglink != '/')
>  			debuglink--;
>  		if (*debuglink == '/')
>  			debuglink++;
> -		ret = filename__read_debuglink(dso->long_name, debuglink,
> +		ret = filename__read_debuglink(filename, debuglink,
>  					       size - (debuglink - filename));
>  		}
>  		break;
> -- 
> 1.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH V3 1/2] perf symbols: Ignore mapping symbols on aarch64
  2015-01-27  6:34 ` [PATCH V3 1/2] perf symbols: Ignore mapping symbols on aarch64 Victor Kamensky
@ 2015-01-29  1:39   ` Namhyung Kim
  2015-02-18 18:26   ` [tip:perf/core] " tip-bot for Victor Kamensky
  1 sibling, 0 replies; 10+ messages in thread
From: Namhyung Kim @ 2015-01-29  1:39 UTC (permalink / raw)
  To: Victor Kamensky
  Cc: Arnaldo Carvalho de Melo, Russell King, David Ahern, Will Deacon,
	Peter Zijlstra, Paul Mackerras, Ingo Molnar, Adrian Hunter,
	Jiri Olsa, Avi Kivity, Masami Hiramatsu, Anton Blanchard,
	Dave Martin, linux-kernel, linux-arm-kernel

On Mon, Jan 26, 2015 at 10:34:01PM -0800, Victor Kamensky wrote:
> Aarch64 ELF files use mapping symbols with special names $x, $d
> to identify regions of Aarch64 code (see Aarch64 ELF ABI - "ARM
> IHI 0056B", section "4.5.4 Mapping symbols").
> 
> The patch filters out these symbols at load time, similar to
> "696b97a perf symbols: Ignore mapping symbols on ARM" changes
> done for ARM before V8.
> 
> Also added handling of mapping symbols that has format
> "$d.<any>" and similar for both cases.
> 
> Note we are not making difference between EM_ARM and
> EM_AARCH64 mapping symbols instead code handles superset
> of both.
> 
> Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
> Acked-by: Will Deacon <will.deacon@arm.com>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Avi Kivity <avi@cloudius-systems.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Cc: Anton Blanchard <anton@samba.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Dave Martin <Dave.Martin@arm.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/util/symbol-elf.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
> index 06fcd1b..8fc6e2f 100644
> --- a/tools/perf/util/symbol-elf.c
> +++ b/tools/perf/util/symbol-elf.c
> @@ -856,10 +856,9 @@ int dso__load_sym(struct dso *dso, struct map *map,
>  		/* Reject ARM ELF "mapping symbols": these aren't unique and
>  		 * don't identify functions, so will confuse the profile
>  		 * output: */
> -		if (ehdr.e_machine == EM_ARM) {
> -			if (!strcmp(elf_name, "$a") ||
> -			    !strcmp(elf_name, "$d") ||
> -			    !strcmp(elf_name, "$t"))
> +		if (ehdr.e_machine == EM_ARM || ehdr.e_machine == EM_AARCH64) {
> +			if (elf_name[0] == '$' && strchr("adtx", elf_name[1])
> +			    && (elf_name[2] == '\0' || elf_name[2] == '.'))
>  				continue;
>  		}
>  
> -- 
> 1.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
  2015-01-29  1:38   ` Namhyung Kim
@ 2015-01-29  4:08     ` Victor Kamensky
  2015-01-29  6:54       ` Namhyung Kim
  0 siblings, 1 reply; 10+ messages in thread
From: Victor Kamensky @ 2015-01-29  4:08 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Russell King, David Ahern, Will Deacon,
	Peter Zijlstra, Paul Mackerras, Ingo Molnar, Adrian Hunter,
	Jiri Olsa, Avi Kivity, Masami Hiramatsu, Anton Blanchard,
	Dave Martin, open list, linux-arm-kernel, Jiri Olsa, Waiman Long

Hi  Namhyung,

On 28 January 2015 at 17:38, Namhyung Kim <namhyung@kernel.org> wrote:
> Hi Victor,
>
> On Mon, Jan 26, 2015 at 10:34:02PM -0800, Victor Kamensky wrote:
>> Currently code that tries to read corresponding debug symbol
>> file from .gnu_debuglink section (DSO_BINARY_TYPE__DEBUGLINK)
>> does not take in account symfs option, so filename__read_debuglink
>> function cannot open ELF file, if symfs option is used.
>>
>> Fix is to add proper handling of symfs as it is done in other
>> places: use __symbol__join_symfs function to get real file name
>> of target ELF file.
>>
>> Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
>> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
>> Cc: Paul Mackerras <paulus@samba.org>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
>> Cc: Jiri Olsa <jolsa@kernel.org>
>> Cc: Adrian Hunter <adrian.hunter@intel.com>
>> Cc: Waiman Long <Waiman.Long@hp.com>
>> Cc: David Ahern <dsahern@gmail.com>
>> Acked-and-tested-by: David Ahern <dsahern@gmail.com>
>
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thank you for the Acks! Is there any action items on my side?
Should I repost patches with your Acks? Or you or Arnaldo
will add them once they got merged in proper tree for
upstreaming?

Thanks,
Victor

> Thanks,
> Namhyung
>
>
>> ---
>>  tools/perf/util/dso.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
>> index 45be944..ca8d8d5 100644
>> --- a/tools/perf/util/dso.c
>> +++ b/tools/perf/util/dso.c
>> @@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso,
>>       case DSO_BINARY_TYPE__DEBUGLINK: {
>>               char *debuglink;
>>
>> -             strncpy(filename, dso->long_name, size);
>> -             debuglink = filename + dso->long_name_len;
>> +             len = __symbol__join_symfs(filename, size, dso->long_name);
>> +             debuglink = filename + len;
>>               while (debuglink != filename && *debuglink != '/')
>>                       debuglink--;
>>               if (*debuglink == '/')
>>                       debuglink++;
>> -             ret = filename__read_debuglink(dso->long_name, debuglink,
>> +             ret = filename__read_debuglink(filename, debuglink,
>>                                              size - (debuglink - filename));
>>               }
>>               break;
>> --
>> 1.9.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
  2015-01-29  4:08     ` Victor Kamensky
@ 2015-01-29  6:54       ` Namhyung Kim
  2015-01-30 14:40         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 10+ messages in thread
From: Namhyung Kim @ 2015-01-29  6:54 UTC (permalink / raw)
  To: Victor Kamensky
  Cc: Arnaldo Carvalho de Melo, Russell King, David Ahern, Will Deacon,
	Peter Zijlstra, Paul Mackerras, Ingo Molnar, Adrian Hunter,
	Jiri Olsa, Avi Kivity, Masami Hiramatsu, Anton Blanchard,
	Dave Martin, open list, linux-arm-kernel, Jiri Olsa, Waiman Long

On Wed, Jan 28, 2015 at 08:08:30PM -0800, Victor Kamensky wrote:
> Hi  Namhyung,
> 
> On 28 January 2015 at 17:38, Namhyung Kim <namhyung@kernel.org> wrote:
> > Hi Victor,
> >
> > On Mon, Jan 26, 2015 at 10:34:02PM -0800, Victor Kamensky wrote:
> >> Currently code that tries to read corresponding debug symbol
> >> file from .gnu_debuglink section (DSO_BINARY_TYPE__DEBUGLINK)
> >> does not take in account symfs option, so filename__read_debuglink
> >> function cannot open ELF file, if symfs option is used.
> >>
> >> Fix is to add proper handling of symfs as it is done in other
> >> places: use __symbol__join_symfs function to get real file name
> >> of target ELF file.
> >>
> >> Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
> >> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> >> Cc: Paul Mackerras <paulus@samba.org>
> >> Cc: Ingo Molnar <mingo@redhat.com>
> >> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> >> Cc: Jiri Olsa <jolsa@kernel.org>
> >> Cc: Adrian Hunter <adrian.hunter@intel.com>
> >> Cc: Waiman Long <Waiman.Long@hp.com>
> >> Cc: David Ahern <dsahern@gmail.com>
> >> Acked-and-tested-by: David Ahern <dsahern@gmail.com>
> >
> > Acked-by: Namhyung Kim <namhyung@kernel.org>
> 
> Thank you for the Acks! Is there any action items on my side?
> Should I repost patches with your Acks? Or you or Arnaldo
> will add them once they got merged in proper tree for
> upstreaming?

I think Arnaldo will merge them with Acks. ;-)

Thanks,
Namhyung

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

* Re: [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
  2015-01-29  6:54       ` Namhyung Kim
@ 2015-01-30 14:40         ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-01-30 14:40 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Victor Kamensky, Russell King, David Ahern, Will Deacon,
	Peter Zijlstra, Paul Mackerras, Ingo Molnar, Adrian Hunter,
	Jiri Olsa, Avi Kivity, Masami Hiramatsu, Anton Blanchard,
	Dave Martin, open list, linux-arm-kernel, Jiri Olsa, Waiman Long

Em Thu, Jan 29, 2015 at 03:54:50PM +0900, Namhyung Kim escreveu:
> On Wed, Jan 28, 2015 at 08:08:30PM -0800, Victor Kamensky wrote:
> > On 28 January 2015 at 17:38, Namhyung Kim <namhyung@kernel.org> wrote:
> > > Acked-by: Namhyung Kim <namhyung@kernel.org>

> > Thank you for the Acks! Is there any action items on my side?
> > Should I repost patches with your Acks? Or you or Arnaldo
> > will add them once they got merged in proper tree for
> > upstreaming?
 
> I think Arnaldo will merge them with Acks. ;-)

Yes, I like acks, they are not a guarantee for patches to be merged, but
they sure help ;-)

- Arnaldo

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

* [tip:perf/core] perf symbols: Ignore mapping symbols on aarch64
  2015-01-27  6:34 ` [PATCH V3 1/2] perf symbols: Ignore mapping symbols on aarch64 Victor Kamensky
  2015-01-29  1:39   ` Namhyung Kim
@ 2015-02-18 18:26   ` tip-bot for Victor Kamensky
  1 sibling, 0 replies; 10+ messages in thread
From: tip-bot for Victor Kamensky @ 2015-02-18 18:26 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: avi, will.deacon, dsahern, hpa, a.p.zijlstra, anton, paulus,
	tglx, adrian.hunter, masami.hiramatsu.pt, acme, victor.kamensky,
	linux, Dave.Martin, jolsa, mingo, namhyung, linux-kernel

Commit-ID:  4886f2ca19f6ff22ebfbe8e78c79c699e572b89f
Gitweb:     http://git.kernel.org/tip/4886f2ca19f6ff22ebfbe8e78c79c699e572b89f
Author:     Victor Kamensky <victor.kamensky@linaro.org>
AuthorDate: Mon, 26 Jan 2015 22:34:01 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 6 Feb 2015 11:46:36 +0100

perf symbols: Ignore mapping symbols on aarch64

Aarch64 ELF files use mapping symbols with special names $x, $d
to identify regions of Aarch64 code (see Aarch64 ELF ABI - "ARM
IHI 0056B", section "4.5.4 Mapping symbols").

The patch filters out these symbols at load time, similar to
"696b97a perf symbols: Ignore mapping symbols on ARM" changes
done for ARM before V8.

Also added handling of mapping symbols that has format
"$d.<any>" and similar for both cases.

Note we are not making difference between EM_ARM and
EM_AARCH64 mapping symbols instead code handles superset
of both.

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Avi Kivity <avi@cloudius-systems.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Russell King <linux@arm.linux.org.uk>
Link: http://lkml.kernel.org/r/1422340442-4673-2-git-send-email-victor.kamensky@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol-elf.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index b24f9d8..225eb73 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -859,10 +859,9 @@ int dso__load_sym(struct dso *dso, struct map *map,
 		/* Reject ARM ELF "mapping symbols": these aren't unique and
 		 * don't identify functions, so will confuse the profile
 		 * output: */
-		if (ehdr.e_machine == EM_ARM) {
-			if (!strcmp(elf_name, "$a") ||
-			    !strcmp(elf_name, "$d") ||
-			    !strcmp(elf_name, "$t"))
+		if (ehdr.e_machine == EM_ARM || ehdr.e_machine == EM_AARCH64) {
+			if (elf_name[0] == '$' && strchr("adtx", elf_name[1])
+			    && (elf_name[2] == '\0' || elf_name[2] == '.'))
 				continue;
 		}
 

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

* [tip:perf/core] perf symbols: debuglink should take symfs option into account
  2015-01-27  6:34 ` [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account Victor Kamensky
  2015-01-29  1:38   ` Namhyung Kim
@ 2015-02-18 18:26   ` tip-bot for Victor Kamensky
  1 sibling, 0 replies; 10+ messages in thread
From: tip-bot for Victor Kamensky @ 2015-02-18 18:26 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, anton, a.p.zijlstra, linux, linux-kernel, namhyung,
	adrian.hunter, Dave.Martin, tglx, Waiman.Long,
	masami.hiramatsu.pt, jolsa, victor.kamensky, mingo, will.deacon,
	paulus, dsahern, hpa, avi

Commit-ID:  dc6254cf870732804b76a83ff2d8a72fea4365f6
Gitweb:     http://git.kernel.org/tip/dc6254cf870732804b76a83ff2d8a72fea4365f6
Author:     Victor Kamensky <victor.kamensky@linaro.org>
AuthorDate: Mon, 26 Jan 2015 22:34:02 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 6 Feb 2015 11:46:36 +0100

perf symbols: debuglink should take symfs option into account

Currently code that tries to read corresponding debug symbol file from
.gnu_debuglink section (DSO_BINARY_TYPE__DEBUGLINK) does not take in
account symfs option, so filename__read_debuglink function cannot open
ELF file, if symfs option is used.

Fix is to add proper handling of symfs as it is done in other places:
use __symbol__join_symfs function to get real file name of target ELF
file.

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Tested-by: David Ahern <dsahern@gmail.com>
Acked-by: David Ahern <dsahern@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Avi Kivity <avi@cloudius-systems.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Waiman Long <Waiman.Long@hp.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1422340442-4673-3-git-send-email-victor.kamensky@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/dso.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index a8b3f18..814554d 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso,
 	case DSO_BINARY_TYPE__DEBUGLINK: {
 		char *debuglink;
 
-		strncpy(filename, dso->long_name, size);
-		debuglink = filename + dso->long_name_len;
+		len = __symbol__join_symfs(filename, size, dso->long_name);
+		debuglink = filename + len;
 		while (debuglink != filename && *debuglink != '/')
 			debuglink--;
 		if (*debuglink == '/')
 			debuglink++;
-		ret = filename__read_debuglink(dso->long_name, debuglink,
+		ret = filename__read_debuglink(filename, debuglink,
 					       size - (debuglink - filename));
 		}
 		break;

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

end of thread, other threads:[~2015-02-18 18:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27  6:34 [PATCH V3 0/2] perf symbols: debuglink and arm mapping symbols changes Victor Kamensky
2015-01-27  6:34 ` [PATCH V3 1/2] perf symbols: Ignore mapping symbols on aarch64 Victor Kamensky
2015-01-29  1:39   ` Namhyung Kim
2015-02-18 18:26   ` [tip:perf/core] " tip-bot for Victor Kamensky
2015-01-27  6:34 ` [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account Victor Kamensky
2015-01-29  1:38   ` Namhyung Kim
2015-01-29  4:08     ` Victor Kamensky
2015-01-29  6:54       ` Namhyung Kim
2015-01-30 14:40         ` Arnaldo Carvalho de Melo
2015-02-18 18:26   ` [tip:perf/core] " tip-bot for Victor Kamensky

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