From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] libtraceevent: Show migrate-disable field
Date: Mon, 9 Jan 2023 18:40:34 -0500 [thread overview]
Message-ID: <20230109184034.359f10ad@gandalf.local.home> (raw)
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Since Linux kernel 5.15 (specifically with the addition of 54357f0c9149c
("tracing: Add migrate-disabled counter to tracing output.")), the
common_preempt_count field of each event also held the "migrate-disable"
field in the most significant byte. This needs to be accounted for as when
the migrate disable field is set, it will show:
systemd--268 3d..3 15368.334398: rcu_dyntick: --= 4000000000000002 4000000000000000 0x63c
systemd--268 3d..13 15368.334399: rcu_dyntick: ++= 4000000000000000 4000000000000002 0x63c
systemd--268 3d..12 15368.334400: irq_disable: caller=ct_irq_enter_irqson+0x17 parent=0x0
systemd--268 3d..13 15368.334400: rcu_dyntick: --= 4000000000000002 4000000000000000 0x63c
systemd--268 3d..12 15368.334401: rcu_dyntick: ++= 4000000000000000 4000000000000002 0x63c
Where the events above have:
preempt-count migrate-disable
------------- ---------------
3 0
3 1
2 1
3 1
2 1
That is, in the above print of "3d..13", the '3' of the '13' is the
preempt count and the '1' is the migrate disable. But it really should be:
systemd--268 3d..3. 15368.334398: rcu_dyntick: --= 4000000000000002 4000000000000000 0x63c
systemd--268 3d..31 15368.334399: rcu_dyntick: ++= 4000000000000000 4000000000000002 0x63c
systemd--268 3d..21 15368.334400: irq_disable: caller=ct_irq_enter_irqson+0x17 parent=0x0
systemd--268 3d..31 15368.334400: rcu_dyntick: --= 4000000000000002 4000000000000000 0x63c
systemd--268 3d..21 15368.334401: rcu_dyntick: ++= 4000000000000000 4000000000000002 0x63c
Where the migrate disabled is always displayed with a '.' when zero and
its hex count when set.
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
src/event-parse.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/event-parse.c b/src/event-parse.c
index 18db7fcb456d..e655087dad60 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -6768,8 +6768,13 @@ static void data_latency_format(struct tep_handle *tep, struct trace_seq *s,
(hardirq && softirq) ? 'H' :
hardirq ? 'h' : softirq ? 's' : '.');
- if (pc)
- trace_seq_printf(&sq, "%x", pc);
+ if (pc & 0xf)
+ trace_seq_printf(&sq, "%x", pc & 0xf);
+ else
+ trace_seq_printf(&sq, ".");
+
+ if (pc & 0xf0)
+ trace_seq_printf(&sq, "%x", pc >> 4);
else
trace_seq_printf(&sq, ".");
--
2.35.1
reply other threads:[~2023-01-09 23:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230109184034.359f10ad@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
/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).