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)
Mar 3 2024, 12:38 PM
Unknown Object (File)
Mar 3 2024, 12:38 PM
Unknown Object (File)
Mar 3 2024, 11:34 AM
Unknown Object (File)
Mar 3 2024, 11:16 AM
Unknown Object (File)
Feb 29 2024, 2:18 AM
Unknown Object (File)
Dec 25 2023, 5:05 PM
Unknown Object (File)
Dec 21 2023, 11:23 PM
Unknown Object (File)
Dec 20 2023, 12:11 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 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.