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


Groups > linux.kernel > #1243932 > unrolled thread

Re: [PATCH 1/5] perf: unwind: fix unw_word_t pointer casts

Started byRabin Vincent <rabin@rab.in>
First post2015-10-10 18:00 +0200
Last post2015-10-12 10:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/5] perf: unwind: fix unw_word_t pointer casts Rabin Vincent <rabin@rab.in> - 2015-10-10 18:00 +0200
    Re: [PATCH 1/5] perf: unwind: fix unw_word_t pointer casts Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-11 01:40 +0200
      Re: [PATCH 1/5] perf: unwind: fix unw_word_t pointer casts Jiri Olsa <jolsa@redhat.com> - 2015-10-12 10:40 +0200

#1243932 — Re: [PATCH 1/5] perf: unwind: fix unw_word_t pointer casts

FromRabin Vincent <rabin@rab.in>
Date2015-10-10 18:00 +0200
SubjectRe: [PATCH 1/5] perf: unwind: fix unw_word_t pointer casts
Message-ID<qi4IX-5qN-27@gated-at.bofh.it>
Hi Arnaldo,

Do you have any comments on this patch set?

Thanks.

On Sun, Sep 27, 2015 at 08:37:55PM +0200, Rabin Vincent wrote:
> unw_word_t is uint64_t even on 32-bit MIPS.  Cast it to uintptr_t before
> the cast to void *p to get rid of the following errors:
> 
> util/unwind-libunwind.c: In function 'access_mem':
> util/unwind-libunwind.c:464:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> util/unwind-libunwind.c:475:2: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> cc1: all warnings being treated as errors
> make[3]: *** [util/unwind-libunwind.o] Error 1
> 
> Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
> ---
>  tools/perf/util/unwind-libunwind.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
> index 4c00507..ef799dc 100644
> --- a/tools/perf/util/unwind-libunwind.c
> +++ b/tools/perf/util/unwind-libunwind.c
> @@ -461,7 +461,7 @@ static int access_mem(unw_addr_space_t __maybe_unused as,
>  		if (ret) {
>  			pr_debug("unwind: access_mem %p not inside range"
>  				 " 0x%" PRIx64 "-0x%" PRIx64 "\n",
> -				 (void *) addr, start, end);
> +				 (void *) (uintptr_t) addr, start, end);
>  			*valp = 0;
>  			return ret;
>  		}
> @@ -471,7 +471,7 @@ static int access_mem(unw_addr_space_t __maybe_unused as,
>  	offset = addr - start;
>  	*valp  = *(unw_word_t *)&stack->data[offset];
>  	pr_debug("unwind: access_mem addr %p val %lx, offset %d\n",
> -		 (void *) addr, (unsigned long)*valp, offset);
> +		 (void *) (uintptr_t) addr, (unsigned long)*valp, offset);
>  	return 0;
>  }
>  
> -- 
> 1.7.10.4
> 
> --
> 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/
--
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/

[toc] | [next] | [standalone]


#1244033

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-10-11 01:40 +0200
Message-ID<qibU6-7vg-19@gated-at.bofh.it>
In reply to#1243932
Em Sat, Oct 10, 2015 at 05:49:40PM +0200, Rabin Vincent escreveu:
> Hi Arnaldo,
> 
> Do you have any comments on this patch set?

I looked at the patches now, all seem fine from a quick look.

The last patch is interesting, and a more general way of installing what
is required for a full build using the native method for a distro, i.e.
using yum/dnf/apt/etc would come in handy as well, so that it doesn't
look like we recommend this fetch-the-sources-and-build-it method, but
sure, that can come later, when someone steps up to that work.

Since this touches the build system and libunwind, areas that Jiri
wrote/knows better, I'd like to get his ack, Jiri?

- Arnaldo
 
> Thanks.
> 
> On Sun, Sep 27, 2015 at 08:37:55PM +0200, Rabin Vincent wrote:
> > unw_word_t is uint64_t even on 32-bit MIPS.  Cast it to uintptr_t before
> > the cast to void *p to get rid of the following errors:
> > 
> > util/unwind-libunwind.c: In function 'access_mem':
> > util/unwind-libunwind.c:464:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > util/unwind-libunwind.c:475:2: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > cc1: all warnings being treated as errors
> > make[3]: *** [util/unwind-libunwind.o] Error 1
> > 
> > Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
> > ---
> >  tools/perf/util/unwind-libunwind.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
> > index 4c00507..ef799dc 100644
> > --- a/tools/perf/util/unwind-libunwind.c
> > +++ b/tools/perf/util/unwind-libunwind.c
> > @@ -461,7 +461,7 @@ static int access_mem(unw_addr_space_t __maybe_unused as,
> >  		if (ret) {
> >  			pr_debug("unwind: access_mem %p not inside range"
> >  				 " 0x%" PRIx64 "-0x%" PRIx64 "\n",
> > -				 (void *) addr, start, end);
> > +				 (void *) (uintptr_t) addr, start, end);
> >  			*valp = 0;
> >  			return ret;
> >  		}
> > @@ -471,7 +471,7 @@ static int access_mem(unw_addr_space_t __maybe_unused as,
> >  	offset = addr - start;
> >  	*valp  = *(unw_word_t *)&stack->data[offset];
> >  	pr_debug("unwind: access_mem addr %p val %lx, offset %d\n",
> > -		 (void *) addr, (unsigned long)*valp, offset);
> > +		 (void *) (uintptr_t) addr, (unsigned long)*valp, offset);
> >  	return 0;
> >  }
> >  
> > -- 
> > 1.7.10.4
> > 
> > --
> > 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/
--
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/

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


#1244487

FromJiri Olsa <jolsa@redhat.com>
Date2015-10-12 10:40 +0200
Message-ID<qiGOe-1WT-15@gated-at.bofh.it>
In reply to#1244033
On Sat, Oct 10, 2015 at 08:34:08PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Sat, Oct 10, 2015 at 05:49:40PM +0200, Rabin Vincent escreveu:
> > Hi Arnaldo,
> > 
> > Do you have any comments on this patch set?
> 
> I looked at the patches now, all seem fine from a quick look.
> 
> The last patch is interesting, and a more general way of installing what
> is required for a full build using the native method for a distro, i.e.
> using yum/dnf/apt/etc would come in handy as well, so that it doesn't
> look like we recommend this fetch-the-sources-and-build-it method, but
> sure, that can come later, when someone steps up to that work.
> 
> Since this touches the build system and libunwind, areas that Jiri
> wrote/knows better, I'd like to get his ack, Jiri?

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web