Re: [PATCH RT] tracing: make preempt_lazy and migrate_disable counter smaller

Jiri Olsa
2020-02-24T11:54:15Z

On Mon, Feb 24, 2020 at 11:01:04AM +0100, Sebastian Andrzej Siewior wrote:
> On 2020-02-21 21:49:57 [+0100], Jiri Olsa wrote:
> > On Fri, Feb 21, 2020 at 06:44:19PM +0100, Sebastian Andrzej Siewior wrote:
> > > The migrate_disable counter should not exceed 255 so it is enough to
> > > store it in an 8bit field.
> > > With this change we can move the `preempt_lazy_count' member into the
> > > gap so the whole struct shrinks by 4 bytes to 12 bytes in total.
> > >
> > > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > > ---
> > > include/linux/trace_events.h | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
> > > index f3b1ef07e4a5f..c8b3f06cb5ed7 100644
> > > --- a/include/linux/trace_events.h
> > > +++ b/include/linux/trace_events.h
> > > @@ -62,9 +62,9 @@ struct trace_entry {
> > > unsigned char flags;
> > > unsigned char preempt_count;
> > > int pid;
> > > - unsigned short migrate_disable;
> > > - unsigned short padding;
> > > + unsigned char migrate_disable;
> > > unsigned char preempt_lazy_count;
> > > + unsigned short padding;
> >
> > also we still need to put preempt_lazy_count as common field:
> >
> > __common_field(unsigned char, preempt_lazy_count);
>
> so I need to update the struct as I did (and drop the padding field like
> Steven suggested) and then do the "same" change to
> "trace_define_common_fields" ?

yep, AFAICS that's it

thanks,
jirka