public inbox for kernelci@lists.linux.dev
 help / color / mirror / Atom feed
From: Laura Nao <laura.nao@collabora.com>
To: laura.nao@collabora.com
Cc: kernel@collabora.com, kernelci@lists.linux.dev,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	mhiramat@kernel.org, shuah@kernel.org, skhan@linuxfoundation.org,
	tim.bird@sony.com, todd.e.brandt@linux.intel.com
Subject: Re: [RFC PATCH 1/1] kselftests: Add test to detect boot event slowdowns
Date: Thu,  8 Aug 2024 12:45:34 +0200	[thread overview]
Message-ID: <20240808104534.17994-1-laura.nao@collabora.com> (raw)
In-Reply-To: <20240731092534.16213-1-laura.nao@collabora.com>

On 7/31/24 11:25, Laura Nao wrote:
> 
> It looks like sleepgraph.py is more focused on analyzing suspend/resume
> timings, while bootgraph.py measures boot time using the kernel log and
> ftrace. The latter might indeed come in handy.
> As far as I can see, the script doesn't support automatic detection of
> boot slowdowns, and the output is in HTML format, which is meant for
> human analysis. However, I can look into adding support for a more
> machine-readable output format too. The test proposed in this patch could
> then use bootgraph.py to generate the reference file and measure current
> boot timings.
> 
> I'll look into this and report back.
> 

After examining the bootgraph.py script, it seems feasible to add
support for generating the output in a machine-readable format 
(e.g., JSON) for automated analysis. Todd, I've CC'd you on this 
discussion in case you have feedback on possibly using bootgraph.py in 
an automated test to detect slowdowns.

Some points to consider:

- The bootgraph.py script supports ftrace through the -fstat and -ftrace
  options, and it parses the kernel log to get initcall timings. To use
  this in an automated test, we need a way to provide the necessary 
  command line options. One approach is to include these options in a 
  bootconfig file embedded in the kernel image (as per proposal in this 
  RFC). Shuah, do you think this is acceptable? I haven't seen other 
  tests doing this, so I'm unsure if this is a proper way to handle 
  required command line options in a selftest.

- The bootgraph.py script tracks timings for all init calls, which might
  be excessive and generate too much output when integrated in an 
  automated test. We might need to limit the test output to report only 
  significant slowdowns to make it manageable.

- I'd like to get some feedback on which key boot process events are
  more relevant to track; depending on this, we could use the 
  bootgraph.py script to monitor initcalls and possibly other events 
  tracked via ftrace. The script currently uses the function_graph 
  tracer, and its parser is designed for this tracer's output. If we need 
  to track other events (e.g., kprobe events), the parser might need some 
  adjustments.

I'll be discussing this at LPC in September
(https://lpc.events/event/18/contributions/1700/) and look forward to
exploring more details and alternative approaches for an automated boot
time test.

Best,

Laura

  reply	other threads:[~2024-08-08 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25 11:06 [RFC PATCH 0/1] Add kselftest to detect boot event slowdowns Laura Nao
2024-07-25 11:06 ` [RFC PATCH 1/1] kselftests: Add test " Laura Nao
2024-07-25 15:50   ` Shuah Khan
2024-07-31  9:25     ` Laura Nao
2024-08-08 10:45       ` Laura Nao [this message]
2024-07-25 15:47 ` [RFC PATCH 0/1] Add kselftest " Shuah Khan

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=20240808104534.17994-1-laura.nao@collabora.com \
    --to=laura.nao@collabora.com \
    --cc=kernel@collabora.com \
    --cc=kernelci@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tim.bird@sony.com \
    --cc=todd.e.brandt@linux.intel.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