From: Francesco Valla <francesco@valla.it>
To: Brian Masney <bmasney@redhat.com>
Cc: Linux Embedded <linux-embedded@vger.kernel.org>,
Saravana Kannan <saravanak@google.com>
Subject: Re: [boot-time] [SCRIPT v4] analyze-initcall-debug.py
Date: Fri, 07 Feb 2025 08:34:28 +0100 [thread overview]
Message-ID: <2289257.vFx2qVVIhK@fedora.fritz.box> (raw)
In-Reply-To: <Z6J3WpeJKIKENC81@x13s>
Hi Brian,
On Tuesday, 4 February 2025 at 21:23:54 Brian Masney <bmasney@redhat.com> wrote:
> On Tue, Jan 28, 2025 at 06:15:53PM +0100, Francesco Valla wrote:
> > Hello,
> >
> > this is the fourth version of the analyze-initcall-debug.py script, which can
> > be used to analyze the kernel output when booting with initcall_debug
> > to extract some human-readable data from it.
> >
> > This version brings a complete bootchart of the kernel-side portion of the
> > boot sequence, showing both the initcalls and the probes.
>
> Hi Francesco,
>
> This is a useful script and I have a few suggestions:
>
> - Report on the probe deferrals, and group them by name. For example,
> this is one of the probe deferrals on my Thinkpad x13s laptop
> with a Qualcomm SoC:
>
> probe of 3210000.soundwire returned -517 after 3 usecs
>
> As a hack, I can group them together with this one liner:
>
> x13s:~$ grep 517 dmesg.txt | grep returned | \
> awk -F"probe of " '{print $2}' | awk '{print $1" "$5}' | sort \
> awk '{a[$1]+=$2} END {for (i in a) print i, a[i]}' | sort
> 15000000.iommu 750
> 18200000.rsc:regulators-2 61
> 1c00000.pcie 13458
> 1c10000.pcie 18266
> 1c20000.pcie 250
> 3200000.rxmacro 51
> 3210000.soundwire 18
> 3220000.txmacro 105
> ...
>
> and add the following to the end to get the overall time:
>
> | awk '{sum += $2} END {print sum}'
>
> 493,730 usec in this example.
>
This is certainly useful and will be added to the next version. It's
partially there for the HTML output, but can be added to the textual one
with virtually no effort.
> Note I attached the dmesg for my system since it's a pretty extreme
> example since we have pinctrl drivers set to modules instead of built
> in on Fedora.
>
> I CCed Saravana since he mentioned at the boot SIG meeting last week
> that this may not be an accurate way to measure probe deferrals. Take
> a look at the output of 'grep 33c0000.pinctrl' against the
> dmesg I attached, and see the timestamps are the range
> 2.190008 - 13.358063.
>
As far as I understood, this is not accurate since also the "forced"
deferrals caused by devlink are accounted for. But that would be fine,
since it's time spent for the given driver nonetheless. I'll let Saravana
comment more, though.
> - Run pylint against the code and fix up some of the warnings that are
> reported.
Noted.
>
> - Add commas to some of the output. For example, change:
>
> Top 10 initcall durations:
> * apm_driver_init -> 804412us
> * panel_edp_init -> 205809us
>
> to:
>
> Top 10 probe durations:
> * gprsvc:service:2:1 -> 5288,273us
> * 1c10000.pcie -> 1,091,920us
>
Not a big fan of commas as separators, but I'll give it a thought.
> - Map the return values to their pretty name. For example, change:
>
> Failed initcalls/probes:
> * kvm_arm_init -> ret = -19
> * test_kstrtox_init -> ret = -22
>
> to:
>
> * kvm_arm_init -> ret = -ENODEV (-19)
> * test_kstrtox_init -> ret = -EINVAL (-22)
>
Will do for sure.
> Brian
>
Thank you for the feedback!
Francesco
prev parent reply other threads:[~2025-02-07 14:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 17:15 [boot-time] [SCRIPT v4] analyze-initcall-debug.py Francesco Valla
2025-02-04 20:23 ` Brian Masney
2025-02-07 7:34 ` Francesco Valla [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=2289257.vFx2qVVIhK@fedora.fritz.box \
--to=francesco@valla.it \
--cc=bmasney@redhat.com \
--cc=linux-embedded@vger.kernel.org \
--cc=saravanak@google.com \
/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).