Page MenuHomeFreeBSD

dtrace: fix the panic action
ClosedPublic

Authored by markj on Apr 22 2015, 9:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jul 5, 5:07 PM
Unknown Object (File)
Jul 2 2025, 7:32 AM
Unknown Object (File)
Jun 25 2025, 6:55 PM
Unknown Object (File)
Jun 21 2025, 11:05 AM
Unknown Object (File)
Jun 21 2025, 1:25 AM
Unknown Object (File)
Jun 20 2025, 10:11 AM
Unknown Object (File)
Jun 16 2025, 9:28 AM
Unknown Object (File)
Jun 16 2025, 12:06 AM
Subscribers

Details

Summary

Previously, dtrace_panic() would call into some unfinished compat code
and return without panicking. This compat code is responsible for doing
a bunch of things that are handled by panic(9) in FreeBSD, so we don't
actually need it. In particular:

  • we don't need to serialize calls to panic(9), since the first thing vpanic does is send an IPI to all other CPUs to put them in a busy loop, and wait for all other CPUs to acknowledge before proceeding
  • we don't need to save registers, since said IPI causes all CPUs to save their registers to stoppcbs
  • we don't use a dedicated panic stack

This change just exports FreeBSD's vpanic() and modifies dtrace_panic()
to call it directly.

Test Plan

Tried using the panic() action from a few different probes, and made sure that the kernel panicked cleanly and dumped core. In particular, 'fbt::: {panic();}' works properly on amd64.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

markj retitled this revision from to dtrace: fix the panic action.
markj edited the test plan for this revision. (Show Details)
markj updated this object.
markj added reviewers: avg, DTrace.
avg edited edge metadata.

The change totally makes sense and the patch looks good to me.
Thanks!

This revision is now accepted and ready to land.Apr 23 2015, 9:48 AM
This revision was automatically updated to reflect the committed changes.