Page MenuHomeFreeBSD

Convert tests of panicstr to KERNEL_PANICKED().
AbandonedPublic

Authored by tmunro on Oct 16 2018, 11:04 AM.
Tags
None
Referenced Files
F80191205: D17581.diff
Fri, Mar 29, 12:44 AM
Unknown Object (File)
Feb 21 2024, 7:57 PM
Unknown Object (File)
Dec 21 2023, 10:13 PM
Unknown Object (File)
Dec 20 2023, 1:29 AM
Unknown Object (File)
Jan 14 2023, 2:21 PM
Unknown Object (File)
Dec 30 2022, 12:05 AM
Unknown Object (File)
Dec 22 2022, 1:53 PM
Subscribers

Details

Reviewers
mjg
allanjude
Summary

Many code paths check if the kernel has panicked by accessing
panicstr. Change them all to use a new function-like macro
KERNEL_PANICKED(). This lets us use __predict_false()
consistently, and lets us make further changes to the way the
condition is detected in future.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Here's a better version (the last one had an unintended stray change).
Note: this is a refactoring suggested by mjg, to support his future plans to change the representation of panic state to something small in __read_frequently. The new macro will hide those details from all these call sites, though for now it just does what it was doing before (with the addition of the prediction).

Future note: please upload patches with full context, either using the 'arcanist' tool, or just generate the diff with -U99999 (svn diff -x -U99999)

This revision is now accepted and ready to land.Oct 17 2018, 4:38 AM
mjg requested changes to this revision.Oct 20 2018, 2:59 AM

with this patch applied git grep panicstr still reveals entries in cddl/ code. it should also get modified or the boolean switch is not going to work.

This revision now requires changes to proceed.Oct 20 2018, 2:59 AM

Discussed with Mateusz, he would prefer to write a Coccinelle script to automate this change, so I am abandoning this patch.