Page MenuHomeFreeBSD

tslog: Handle curthread equal to NULL
ClosedPublic

Authored by cperciva on May 30 2023, 3:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 21 2024, 1:37 AM
Unknown Object (File)
Mar 19 2024, 7:24 PM
Unknown Object (File)
Mar 19 2024, 7:24 PM
Unknown Object (File)
Mar 19 2024, 7:12 PM
Unknown Object (File)
Feb 20 2024, 12:00 PM
Unknown Object (File)
Dec 26 2023, 12:21 AM
Unknown Object (File)
Dec 23 2023, 1:45 AM
Unknown Object (File)
Dec 12 2023, 1:40 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