HomeFreeBSD

Add userland boot profiling to TSLOG

Description

Add userland boot profiling to TSLOG

On kernels compiled with 'options TSLOG', record for each process ID:

  • The timestamp of the fork() which creates it and the parent

process ID,

  • The first path passed to execve(), if any,
  • The first path resolved by namei, if any, and
  • The timestamp of the exit() which terminates the process.

Expose this information via a new sysctl, debug.tslog_user.

On kernels lacking 'options TSLOG' (the default), no information is
recorded and the sysctl does not exist.

Note that recording namei is needed in order to obtain the names of
rc.d scripts being launched, as the rc system sources them in a
subshell rather than execing the scripts.

With this commit it is now possible to generate flamecharts of the
entire boot process from the start of the loader to the end of
/etc/rc. The code needed to perform this processing is currently
found in github: https://github.com/cperciva/freebsd-boot-profiling

Reviewed by: mhorne
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D32493

Details

Provenance
cpercivaAuthored on Oct 16 2021, 6:47 PM
Reviewer
mhorne
Differential Revision
D32493: Add userland boot profiling to TSLOG
Parents
R10:498cca14836d: pf: selecting pf_map_addr is not an error
Branches
Unknown
Tags
Unknown