[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1354929851.17101.105.camel@gandalf.local.home>
Date: Fri, 07 Dec 2012 20:24:11 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: James Hogan <james.hogan@...tec.com>
Cc: linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v2 04/44] trace/ring_buffer: handle 64bit aligned structs
On Wed, 2012-12-05 at 16:08 +0000, James Hogan wrote:
> Some 32 bit architectures have 64 bit struct alignment (for example
> Meta which has 64 bit read/write instructions). These require 8 byte
> alignment of event data too, so use CONFIG_HAVE_64BIT_ALIGNED_STRUCT
> instead of CONFIG_64BIT to decide alignment, and align
> buffer_data_page::data accordingly.
>
> Signed-off-by: James Hogan <james.hogan@...tec.com>
Acked-by: Steven Rostedt <rostedt@...dmis.org>
-- Steve
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Ingo Molnar <mingo@...hat.com>
> ---
> kernel/trace/ring_buffer.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index b979426..c4dc029 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -177,7 +177,8 @@ void tracing_off_permanent(void)
> #define RB_MAX_SMALL_DATA (RB_ALIGNMENT * RINGBUF_TYPE_DATA_TYPE_LEN_MAX)
> #define RB_EVNT_MIN_SIZE 8U /* two 32bit words */
>
> -#if !defined(CONFIG_64BIT) || defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
> +#if !defined(CONFIG_HAVE_64BIT_ALIGNED_STRUCT) || \
> + defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
> # define RB_FORCE_8BYTE_ALIGNMENT 0
> # define RB_ARCH_ALIGNMENT RB_ALIGNMENT
> #else
> @@ -185,6 +186,8 @@ void tracing_off_permanent(void)
> # define RB_ARCH_ALIGNMENT 8U
> #endif
>
> +#define RB_ALIGN_DATA __aligned(RB_ARCH_ALIGNMENT)
> +
> /* define RINGBUF_TYPE_DATA for 'case RINGBUF_TYPE_DATA:' */
> #define RINGBUF_TYPE_DATA 0 ... RINGBUF_TYPE_DATA_TYPE_LEN_MAX
>
> @@ -333,7 +336,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_event_data);
> struct buffer_data_page {
> u64 time_stamp; /* page time stamp */
> local_t commit; /* write committed index */
> - unsigned char data[]; /* data of buffer page */
> + unsigned char data[] RB_ALIGN_DATA; /* data of buffer page */
> };
>
> /*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists