Page MenuHomeFreeBSD

tslog: Handle curthread equal to NULL
ClosedPublic

Authored by cperciva on May 30 2023, 3:13 AM.
Tags
None
Referenced Files
F101997111: D40324.diff
Wed, Nov 6, 8:48 AM
Unknown Object (File)
Sat, Oct 26, 7:08 PM
Unknown Object (File)
Oct 5 2024, 10:11 AM
Unknown Object (File)
Sep 18 2024, 9:58 AM
Unknown Object (File)
Sep 16 2024, 10:19 AM
Unknown Object (File)
Sep 13 2024, 8:59 PM
Unknown Object (File)
Sep 10 2024, 2:14 AM
Unknown Object (File)
Sep 8 2024, 9:54 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 51764
Build 48655: arc lint + arc unit