All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Documentation: Add kernel minimization guide
@ 2026-11-03 15:08 Matthew Weber
  2026-11-03 15:08 ` [PATCH] Documentation: kcov: clarify coverage example Matthew Weber
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Matthew Weber @ 2026-11-03 15:08 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: linux-doc, Shuah Khan, Thorsten Leemhuis, Nathan Chancellor,
	Nicolas Schier, linux-kbuild, Dmitry Vyukov, Andrey Konovalov,
	kasan-dev, Matthew Weber

Hi all,

This series adds documentation and a script for measuring source lines of
code (SLOC) in kernel builds, supporting developers and system integrators
who need to trim a Linux kernel.

The Workload analysis section of the admin-guide already describes tracing
a workload. This series builds on that guidance with a worked example of
using workload observations to inform kernel minimization and measure the
resulting configuration. The guide is intended for developers working on
embedded and safety-critical use cases, including work related to ELISA.

The series builds on the ELISA Aerospace Working Group's ongoing
minimization discussions and iterations in
https://github.com/elisa-tech/wg-aerospace/pull/257. That effort explores a
generic, newcomer-oriented workflow for tracing a workload, iterating on a
kernel configuration, measuring kernel metrics, and understanding userspace
metrics. The ELISA documentation aims to present a complete containerized
workflow, with analysis steps to guide users through successive iterations.
This series contributes reusable, general-purpose kernel documentation and
tooling upstream to support that broader process. Clear upstream guidance can
also give AI-assisted tools reliable steering context as they help users
iterate on kernel configurations. One likely early application is producing
minimized release configurations for Space Grade Linux.

Rendered drafts are available online:

  Kernel minimization:
  https://matthew-l-weber.github.io/linux/admin-guide/kernel-minimization.html

  Workload tracing:
  https://matthew-l-weber.github.io/linux/admin-guide/workload-tracing.html

The series and its review discussion are in PR #1:
https://github.com/matthew-l-weber/linux/pull/1

The patches are:

  1/4 Documentation: kcov: clarify coverage example
      Clarify that the saved count bounds the printed entries while KCOV
      remains enabled until the disable ioctl. Document the relevant
      config requirements and PC symbolization.

  2/4 scripts: Add kernel-sloc helper script
      Add a helper to count source lines from compile_commands.json or
      estimate distinct source lines represented in a vmlinux DWARF line
      table.

  3/4 Documentation: admin-guide: Add kernel minimization guide
      Add the guide to the Workload analysis section and add its
      MAINTAINERS coverage.

  4/4 Documentation: admin-guide: Update workload tracing guide
      Expand workload tracing guidance with ftrace function-graph
      tracing, syscall tracing under QEMU with the GDB stub, and mapping
      observations to kernel configuration symbols.

Tool-use disclosure: I used GitHub Copilot CLI while preparing this series.
It helped revise the KCOV example, edit parts of the documentation, add
MAINTAINERS entries, and integrate error-handling revisions to kernel-sloc.
I reviewed the changes and take responsibility for the series.

I checked kernel-sloc syntax and help output, and ran
checkpatch.pl --strict on all four patches. The GitHub Actions htmldocs
build completed successfully with no warnings from the changed files; the
published documentation is available at
https://matthew-l-weber.github.io/linux/admin-guide/index.html#workload-analysis.
I did not run make htmldocs locally.

Any feedback is appreciated.

Thanks,
Matthew

Matthew Weber (4):
  Documentation: kcov: clarify coverage example
  scripts: Add kernel-sloc helper script
  Documentation: admin-guide: Add kernel minimization guide
  Documentation: admin-guide: Update workload tracing guide

 Documentation/admin-guide/index.rst           |   1 +
 .../admin-guide/kernel-minimization.rst       | 413 ++++++++++++++++++
 .../quickly-build-trimmed-linux.rst           |   4 +
 .../admin-guide/workload-tracing.rst          | 139 +++++-
 Documentation/dev-tools/kcov.rst              |  44 ++-
 MAINTAINERS                                   |  13 +
 scripts/kernel-sloc                           | 299 +++++++++++++
 7 files changed, 903 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/admin-guide/kernel-minimization.rst
 create mode 100755 scripts/kernel-sloc


base-commit: a592a36e49372172d7c7551ec19ed18184c935e1
-- 
2.39.5

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-05 20:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03 15:08 [PATCH 0/4] Documentation: Add kernel minimization guide Matthew Weber
2026-11-03 15:08 ` [PATCH] Documentation: kcov: clarify coverage example Matthew Weber
2026-11-03 15:08 ` [PATCH 2/4] scripts: Add kernel-sloc helper script Matthew Weber
2026-11-05  6:58   ` Nicolas Schier
2026-11-05 20:05     ` Nathan Chancellor
2026-11-03 15:08 ` [PATCH] Documentation: admin-guide: Add kernel minimization guide Matthew Weber
2026-11-04 15:09   ` sashiko-bot
2026-11-03 15:08 ` [PATCH] Documentation: admin-guide: Update workload tracing guide Matthew Weber

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.