From: Steven Rostedt <rostedt@goodmis.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] trace: Add migrate-disabled counter to tracing output.
Date: Fri, 6 Aug 2021 13:51:24 -0400 [thread overview]
Message-ID: <20210806135124.1279fc94@oasis.local.home> (raw)
In-Reply-To: <20210806164907.xtgvrb25eb4isxhd@linutronix.de>
On Fri, 6 Aug 2021 18:49:07 +0200
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
>
> migrate_disable() forbids task migration to another CPU. It is available
> since v5.11 and has already users such as highmem or BPF. It is useful
> to observe this task state in tracing which already has other states
> like the preemption counter.
>
> Add the migrate-disable counter to the trace entry so it shows up in the
> trace. Due to the users mentioned above, it is already possible to
> observe it:
>
> | bash-1108 [000] ...21 73.950578: rss_stat: mm_id=2213312838 curr=0 type=MM_ANONPAGES size=8192B
> | bash-1108 [000] d..31 73.951222: irq_disable: caller=flush_tlb_mm_range+0x115/0x130 parent=ptep_clear_flush+0x42/0x50
> | bash-1108 [000] d..31 73.951222: tlb_flush: pages:1 reason:local mm shootdown (3)
>
> The last value is the migrate-disable counter.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> [bigeasy: patch description.]
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> include/linux/trace_events.h | 2 ++
> kernel/trace/trace.c | 26 +++++++++++++++++++-------
> kernel/trace/trace_events.c | 1 +
> kernel/trace/trace_output.c | 5 +++++
> 4 files changed, 27 insertions(+), 7 deletions(-)
>
> diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
> index ad413b382a3ca..7c4280b4c6be7 100644
> --- a/include/linux/trace_events.h
> +++ b/include/linux/trace_events.h
> @@ -69,6 +69,7 @@ struct trace_entry {
> unsigned char flags;
> unsigned char preempt_count;
> int pid;
> + unsigned char migrate_disable;
The only issue I have with this patch is this part. It extends the
header of all events beyond 8 bytes, and actually adds another 4 or 8
bytes despite being just a char in size. That's because this is a
header of a structure, which depending on the first field of an event,
padding may be added to have 4 or 8 byte alignment.
I'll be fine with merging this counter with either flags or
preempt_count (neither needs all 8 bits). I can figure out how to
update libtraceevent to handle this case.
-- Steve
> };
>
> #define TRACE_EVENT_TYPE_MAX \
> @@ -157,6 +158,7 @@ static inline void tracing_generic_entry_update(struct trace_entry *entry,
> unsigned int trace_ctx)
next prev parent reply other threads:[~2021-08-06 17:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 16:49 [PATCH] trace: Add migrate-disabled counter to tracing output Sebastian Andrzej Siewior
2021-08-06 17:51 ` Steven Rostedt [this message]
2021-08-06 18:10 ` Sebastian Andrzej Siewior
2021-08-10 13:26 ` [PATCH v2] " Sebastian Andrzej Siewior
2021-09-02 7:16 ` Sebastian Andrzej Siewior
2021-09-03 22:50 ` Steven Rostedt
2021-09-03 23:42 ` Steven Rostedt
2021-09-06 8:13 ` Sebastian Andrzej Siewior
2021-09-07 15:21 ` Steven Rostedt
2021-09-07 15:24 ` Sebastian Andrzej Siewior
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=20210806135124.1279fc94@oasis.local.home \
--to=rostedt@goodmis.org \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).