Page MenuHomeFreeBSD

Don't panic when stopping sampling
ClosedPublic

Authored by andrew on May 26 2016, 4:07 PM.
Tags
None
Referenced Files
F103711296: D6581.diff
Thu, Nov 28, 8:31 AM
Unknown Object (File)
Mon, Nov 4, 11:17 PM
Unknown Object (File)
Oct 22 2024, 4:46 PM
Unknown Object (File)
Oct 18 2024, 7:05 AM
Unknown Object (File)
Sep 30 2024, 7:54 AM
Unknown Object (File)
Sep 29 2024, 8:57 PM
Unknown Object (File)
Sep 22 2024, 7:24 PM
Unknown Object (File)
Sep 22 2024, 4:48 PM
Subscribers

Details

Summary

When hwpmc stops sampling it will set the pm_state to something other than
PMC_STATE_RUNNING. This means the following sequence can happen:

CPU 0: Enter the interrupt handler
CPU 0: Set the thread TDP_CALLCHAIN pflag
CPU 1: Stop sampling
CPU 0: Call pmc_process_samples, find sampling is stopped, clear ps_nsamples
CPU 0: Finish interrupt processing, find the TDP_CALLCHAIN flag is set
CPU 0: Call pmc_capture_user_callchain to capture the user call chain
CPU 0: Find all the pmc sample are free so no call chains need to be captured
CPU 0: KASSERT because of this

The fix for this is to not KASSERT if any of the samples are for a pmc
that has been stopped.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3972
Build 4015: arc lint + arc unit

Event Timeline

andrew retitled this revision from to Don't panic when stopping sampling.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added a reviewer: pmc.
andrew added a subscriber: emaste.
gnn added a reviewer: gnn.
This revision is now accepted and ready to land.May 27 2016, 5:50 PM
bz added a reviewer: bz.
This revision was automatically updated to reflect the committed changes.