Re: [for-next][PATCH 21/21] tracing: Use a struct alignof to determine trace event field alignment

From: Steven Rostedt
Date: Mon Aug 01 2022 - 17:08:16 EST


On Mon, 1 Aug 2022 07:46:22 +0000
David Laight <David.Laight@xxxxxxxxxx> wrote:

> > Define a macro as:
> >
> > ALIGN_STRUCTFIELD(type) ((int)(offsetof(struct {char a; type b;}, b)))
> >
> > which gives the actual alignment of types in a structure.
>
> The simpler:
> __alignof__(struct {type b;})
> also works.

I'll have to try that out.

For now, as the previous version made it through all my tests, I may be
pushing it, but change it to this for simplicity if that also works and
passes all my test.

Thanks,

-- Steve