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

Jiri Olsa
2020-02-21T20:50:11Z

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);

jirka