Page MenuHomeFreeBSD

dtrace: fix the panic action
ClosedPublic

Authored by markj on Apr 22 2015, 9:49 PM.
Tags
None
Referenced Files
F146883163: D2349.diff
Fri, Mar 6, 11:31 AM
F146883143: D2349.diff
Fri, Mar 6, 11:30 AM
Unknown Object (File)
Mon, Mar 2, 5:46 PM
Unknown Object (File)
Mon, Mar 2, 5:31 PM
Unknown Object (File)
Mon, Mar 2, 5:31 PM
Unknown Object (File)
Sat, Feb 7, 6:21 PM
Unknown Object (File)
Nov 28 2025, 2:15 PM
Unknown Object (File)
Nov 28 2025, 9:04 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.