HomeFreeBSD

tslog: Handle curthread equal to NULL

Description

tslog: Handle curthread equal to NULL

Early in the kernel boot, curthread goes through three stages:

  1. Kernel crash when you try to access it, because PCPU doesn't exist.
  2. NULL, because PCU exists but isn't initialized.
  3. &thread0, which is where most of the kernel boot process runs.

This broke TSLOG from inside hammer_time since the scripts which parse
logged records didn't understand that NULL meant &thread0.

Tell tslog to record &thread0 as the active thread if passed NULL.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40324

Details

Provenance
cpercivaAuthored on May 21 2023, 8:03 PM
Differential Revision
D40324: tslog: Handle curthread equal to NULL
Parents
rG9d5a47e13c17: ossl: Provide a fallback definition of __uint128_t when needed
Branches
Unknown
Tags
Unknown