Page MenuHomeFreeBSD

tslog: Handle curthread equal to NULL
ClosedPublic

Authored by cperciva on May 30 2023, 3:13 AM.
Tags
None
Referenced Files
F169748355: D40324.diff
Wed, Sep 2, 11:06 AM
F169745085: D40324.id122592.diff
Wed, Sep 2, 10:53 AM
Unknown Object (File)
Tue, Sep 1, 8:18 AM
Unknown Object (File)
Mon, Aug 31, 4:31 PM
Unknown Object (File)
Mon, Aug 31, 11:21 AM
Unknown Object (File)
Mon, Aug 31, 10:28 AM
Unknown Object (File)
Sun, Aug 30, 8:25 AM
Unknown Object (File)
Sat, Aug 29, 2:13 PM
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 Not Applicable
Unit
Tests Not Applicable