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.