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, Nov 2, 1:37 AM
Unknown Object (File)
Oct 3 2024, 11:19 AM
Unknown Object (File)
Sep 30 2024, 3:33 PM
Unknown Object (File)
Sep 29 2024, 6:15 PM
Unknown Object (File)
Sep 25 2024, 9:56 PM
Unknown Object (File)
Sep 25 2024, 9:33 PM
Unknown Object (File)
Sep 23 2024, 4:44 AM
Unknown Object (File)
Sep 19 2024, 1:40 PM
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 Not Applicable
Unit
Tests Not Applicable

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.