All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Jiri Olsa <jolsa@kernel.org>,
	linux-rt-users@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Juri Lelli <juri.lelli@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: [PATCH RT v2] tracing: make preempt_lazy and migrate_disable counter smaller
Date: Mon, 9 Mar 2020 13:30:06 +0100	[thread overview]
Message-ID: <20200309123006.GC67774@krava> (raw)
In-Reply-To: <20200224170101.qvxapdecp5vsbwrw@linutronix.de>

On Mon, Feb 24, 2020 at 06:01:01PM +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.
> Remove the `padding' field, it is not needed.
> Update the tracing fields in trace_define_common_fields() (it was
> missing the preempt_lazy_count field).
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> v1…v2:
>   - drop the `padding' member
>   - update the members in trace_define_common_fields() to match struct
>     trace_entry.

seems ok to me.. not sure we care, but just wanted to point out
that there's a 'not described gap' in the sched_wakeup's format
file and probably in other formats as well:

	# cat /sys/kernel/debug/tracing/events/sched/sched_wakeup/format
	name: sched_wakeup
	ID: 310
	format:
		field:unsigned short common_type;       offset:0;       size:2; signed:0;
		field:unsigned char common_flags;       offset:2;       size:1; signed:0;
		field:unsigned char common_preempt_count;       offset:3;       size:1; signed:0;
		field:int common_pid;   offset:4;       size:4; signed:1;
		field:unsigned char common_migrate_disable;     offset:8;       size:1; signed:0;
		field:unsigned char common_preempt_lazy_count;  offset:9;       size:1; signed:0;

		field:char comm[16];    offset:12;      size:16;        signed:1;
		field:pid_t pid;        offset:28;      size:4; signed:1;
		field:int prio; offset:32;      size:4; signed:1;
		field:int success;      offset:36;      size:4; signed:1;
		field:int target_cpu;   offset:40;      size:4; signed:1;


there's "common_preempt_lazy_count" field on offset 9 with size 1:
	common_preempt_lazy_count;  offset:9;       size:1;

followed by "comm" field on offset 12:
	field:char comm[16];    offset:12;      size:16;        signed:1;


which makes 2 bytes gap in between, that might confuse some applications
like bpftrace ;-) however there's still enough data to workaround that,
so I'm ok with that

thanks,
jirka


      reply	other threads:[~2020-03-09 12:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 15:35 [PATCH] tracing: Fix trace entry and trace common fields for preempt_lazy_count Jiri Olsa
2020-02-21 15:49 ` Steven Rostedt
2020-02-21 16:10   ` Jiri Olsa
2020-02-21 16:21     ` Steven Rostedt
2020-02-21 16:29       ` Jiri Olsa
2020-02-21 16:50         ` Steven Rostedt
2020-02-21 16:37       ` Sebastian Andrzej Siewior
2020-02-21 17:44         ` [PATCH RT] tracing: make preempt_lazy and migrate_disable counter smaller Sebastian Andrzej Siewior
2020-02-21 19:51           ` Steven Rostedt
2020-02-21 20:20             ` Sebastian Andrzej Siewior
2020-02-21 20:49           ` Jiri Olsa
2020-02-24 10:01             ` Sebastian Andrzej Siewior
2020-02-24 11:54               ` Jiri Olsa
2020-02-24 17:01                 ` [PATCH RT v2] " Sebastian Andrzej Siewior
2020-03-09 12:30                   ` Jiri Olsa [this message]

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=20200309123006.GC67774@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=jolsa@kernel.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.