* [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
@ 2015-01-27 6:34 ` Victor Kamensky
0 siblings, 0 replies; 18+ messages in thread
From: Victor Kamensky @ 2015-01-27 6:34 UTC (permalink / raw)
To: linux-arm-kernel
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] 18+ messages in thread
* Re: [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
2015-01-27 6:34 ` Victor Kamensky
@ 2015-01-29 1:38 ` Namhyung Kim
-1 siblings, 0 replies; 18+ 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] 18+ messages in thread
* [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
@ 2015-01-29 1:38 ` Namhyung Kim
0 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2015-01-29 1:38 UTC (permalink / raw)
To: linux-arm-kernel
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 at 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] 18+ 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
-1 siblings, 0 replies; 18+ 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] 18+ messages in thread
* [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
@ 2015-01-29 4:08 ` Victor Kamensky
0 siblings, 0 replies; 18+ messages in thread
From: Victor Kamensky @ 2015-01-29 4:08 UTC (permalink / raw)
To: linux-arm-kernel
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 at 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] 18+ 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
-1 siblings, 0 replies; 18+ 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] 18+ messages in thread
* [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
@ 2015-01-29 6:54 ` Namhyung Kim
0 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2015-01-29 6:54 UTC (permalink / raw)
To: linux-arm-kernel
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] 18+ 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
-1 siblings, 0 replies; 18+ 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] 18+ messages in thread
* [PATCH V3 2/2] perf symbols: debuglink should take symfs option into account
@ 2015-01-30 14:40 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 18+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-01-30 14:40 UTC (permalink / raw)
To: linux-arm-kernel
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] 18+ messages in thread
* [tip:perf/core] perf symbols: debuglink should take symfs option into account
2015-01-27 6:34 ` Victor Kamensky
(?)
(?)
@ 2015-02-18 18:26 ` tip-bot for Victor Kamensky
-1 siblings, 0 replies; 18+ 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] 18+ messages in thread