public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Gerald BAEZA <gerald.baeza@st.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	Andi Kleen <ak@linux.intel.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Subject: Re: [PATCH] libperf: fix alignment trap in perf stat
Date: Thu, 22 Aug 2019 12:24:35 -0300	[thread overview]
Message-ID: <20190822152435.GD29569@kernel.org> (raw)
In-Reply-To: <1566464769-16374-1-git-send-email-gerald.baeza@st.com>

Em Thu, Aug 22, 2019 at 09:07:01AM +0000, Gerald BAEZA escreveu:
> Following the patch 'perf stat: Fix --no-scale', an
> alignment trap happens in process_counter_values()
> on ARMv7 platforms due to the attempt to copy non
> 64 bits aligned double words (pointed by 'count')
> via a NEON vectored instruction ('vld1' with 64
> bits alignment constraint).
> 
> This patch sets a 64 bits alignment constraint on
> 'contents[]' field in 'struct xyarray' since the
> 'count' pointer used above points to such a
> structure.

You forgot to add Mathieu and Andi, which I just did.

I think this is ok and I'm applying, please holler anyone if think this
isn't the case,

- Arnaldo
 
> Signed-off-by: Gerald Baeza <gerald.baeza@st.com>
> ---
>  tools/perf/lib/include/internal/xyarray.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/lib/include/internal/xyarray.h b/tools/perf/lib/include/internal/xyarray.h
> index 3bf70e4..51e35d6 100644
> --- a/tools/perf/lib/include/internal/xyarray.h
> +++ b/tools/perf/lib/include/internal/xyarray.h
> @@ -2,6 +2,7 @@
>  #ifndef __LIBPERF_INTERNAL_XYARRAY_H
>  #define __LIBPERF_INTERNAL_XYARRAY_H
>  
> +#include <linux/compiler.h>
>  #include <sys/types.h>
>  
>  struct xyarray {
> @@ -10,7 +11,7 @@ struct xyarray {
>  	size_t entries;
>  	size_t max_x;
>  	size_t max_y;
> -	char contents[];
> +	char contents[] __aligned(8);
>  };
>  
>  struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size);
> -- 
> 2.7.4

-- 

- Arnaldo

  reply	other threads:[~2019-08-22 15:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22  9:07 [PATCH] libperf: fix alignment trap in perf stat Gerald BAEZA
2019-08-22 15:24 ` Arnaldo Carvalho de Melo [this message]
2019-08-23 12:29 ` [tip: perf/core] libperf: Fix alignment trap with xyarray contents in 'perf stat' tip-bot2 for Gerald BAEZA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190822152435.GD29569@kernel.org \
    --to=arnaldo.melo@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexandre.torgue@st.com \
    --cc=gerald.baeza@st.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox