Page MenuHomeFreeBSD

Don't panic when stopping sampling
ClosedPublic

Authored by andrew on May 26 2016, 4:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 18, 6:27 PM
Unknown Object (File)
Mar 17 2024, 9:14 AM
Unknown Object (File)
Mar 17 2024, 8:53 AM
Unknown Object (File)
Mar 8 2024, 9:05 PM
Unknown Object (File)
Feb 7 2024, 12:54 PM
Unknown Object (File)
Feb 2 2024, 9:06 PM
Unknown Object (File)
Jan 26 2024, 9:45 PM
Unknown Object (File)
Jan 26 2024, 6:41 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 Not Applicable
Unit
Tests Not Applicable

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.