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


Groups > linux.kernel > #1447654 > unrolled thread

[PATCH] perf symbols: Fix reading build id

Started byUwe Kleine-König <uwe@kleine-koenig.org>
First post2016-07-21 09:10 +0200
Last post2016-07-22 09:40 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] perf symbols: Fix reading build id Uwe Kleine-König <uwe@kleine-koenig.org> - 2016-07-21 09:10 +0200
    Re: [PATCH] perf symbols: Fix reading build id Marc Kleine-Budde <mkl@pengutronix.de> - 2016-07-21 09:30 +0200
      Re: [PATCH] perf symbols: Fix reading build id Jiri Olsa <jolsa@redhat.com> - 2016-07-21 10:00 +0200
        Re: [PATCH] perf symbols: Fix reading build id Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2016-07-22 09:40 +0200

#1447654 — [PATCH] perf symbols: Fix reading build id

FromUwe Kleine-König <uwe@kleine-koenig.org>
Date2016-07-21 09:10 +0200
Subject[PATCH] perf symbols: Fix reading build id
Message-ID<rXghj-4gp-15@gated-at.bofh.it>
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

When is_regular_file(name) is called name points to a freshly allocated
and uninitialized chunk of memory, so is_regular_file(name) is usually
false and reading build id is skipped which makes it impossible to
find debug infos when a build id based system is in use.

Fixes: 403567217d3f ("perf symbols: Do not read symbols/data from device files")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 tools/perf/util/symbol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 54c4ff2b1cee..7044742c828f 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1430,7 +1430,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	 * Read the build id if possible. This is required for
 	 * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
 	 */
-	if (is_regular_file(name) &&
+	if (is_regular_file(dso->long_name) &&
 	    filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
 		dso__set_build_id(dso, build_id);
 
-- 
2.8.1

[toc] | [next] | [standalone]


#1447663

FromMarc Kleine-Budde <mkl@pengutronix.de>
Date2016-07-21 09:30 +0200
Message-ID<rXgAG-4nr-15@gated-at.bofh.it>
In reply to#1447654

[Multipart message — attachments visible in raw view] — view raw

On 07/21/2016 09:09 AM, Uwe Kleine-König wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> When is_regular_file(name) is called name points to a freshly allocated
> and uninitialized chunk of memory, so is_regular_file(name) is usually
> false and reading build id is skipped which makes it impossible to
> find debug infos when a build id based system is in use.
> 
> Fixes: 403567217d3f ("perf symbols: Do not read symbols/data from device files")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

See https://patchwork.kernel.org/patch/9196777/

Marc

> ---
>  tools/perf/util/symbol.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index 54c4ff2b1cee..7044742c828f 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -1430,7 +1430,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
>  	 * Read the build id if possible. This is required for
>  	 * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
>  	 */
> -	if (is_regular_file(name) &&
> +	if (is_regular_file(dso->long_name) &&
>  	    filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
>  		dso__set_build_id(dso, build_id);
>  
> 


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

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


#1447688

FromJiri Olsa <jolsa@redhat.com>
Date2016-07-21 10:00 +0200
Message-ID<rXh3H-4xZ-5@gated-at.bofh.it>
In reply to#1447663
On Thu, Jul 21, 2016 at 09:21:55AM +0200, Marc Kleine-Budde wrote:
> On 07/21/2016 09:09 AM, Uwe Kleine-König wrote:
> > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > 
> > When is_regular_file(name) is called name points to a freshly allocated
> > and uninitialized chunk of memory, so is_regular_file(name) is usually
> > false and reading build id is skipped which makes it impossible to
> > find debug infos when a build id based system is in use.
> > 
> > Fixes: 403567217d3f ("perf symbols: Do not read symbols/data from device files")
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> See https://patchwork.kernel.org/patch/9196777/

Arnaldo, could you please pull this one in?

thanks,
jirka

> 
> Marc
> 
> > ---
> >  tools/perf/util/symbol.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> > index 54c4ff2b1cee..7044742c828f 100644
> > --- a/tools/perf/util/symbol.c
> > +++ b/tools/perf/util/symbol.c
> > @@ -1430,7 +1430,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
> >  	 * Read the build id if possible. This is required for
> >  	 * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
> >  	 */
> > -	if (is_regular_file(name) &&
> > +	if (is_regular_file(dso->long_name) &&
> >  	    filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
> >  		dso__set_build_id(dso, build_id);
> >  
> > 
> 
> 
> -- 
> Pengutronix e.K.                  | Marc Kleine-Budde           |
> Industrial Linux Solutions        | Phone: +49-231-2826-924     |
> Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
> 

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


#1448445

FromUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date2016-07-22 09:40 +0200
Message-ID<rXDdT-2JE-5@gated-at.bofh.it>
In reply to#1447688
On Thu, Jul 21, 2016 at 09:53:02AM +0200, Jiri Olsa wrote:
> On Thu, Jul 21, 2016 at 09:21:55AM +0200, Marc Kleine-Budde wrote:
> > On 07/21/2016 09:09 AM, Uwe Kleine-König wrote:
> > > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > 
> > > When is_regular_file(name) is called name points to a freshly allocated
> > > and uninitialized chunk of memory, so is_regular_file(name) is usually
> > > false and reading build id is skipped which makes it impossible to
> > > find debug infos when a build id based system is in use.
> > > 
> > > Fixes: 403567217d3f ("perf symbols: Do not read symbols/data from device files")
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > 
> > See https://patchwork.kernel.org/patch/9196777/
> 
> Arnaldo, could you please pull this one in?

It is in next as ed7b630b310775f3b6c0b360ede7a12cd8dff6fe. Does "pull
in" mean "send it to Linus for 4.7"? (That's what I'd consider
approriate.)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web