Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_mod.c
| Show First 20 Lines • Show All 4,977 Lines • ▼ Show 20 Lines | pmc_capture_user_callchain(int cpu, int ring, struct trapframe *tf) | ||||
| int start_ticks __diagused; | int start_ticks __diagused; | ||||
| psb = pmc_pcpu[cpu]->pc_sb[ring]; | psb = pmc_pcpu[cpu]->pc_sb[ring]; | ||||
| td = curthread; | td = curthread; | ||||
| nrecords = INT_MAX; | nrecords = INT_MAX; | ||||
| pass = 0; | pass = 0; | ||||
| start_ticks = ticks; | start_ticks = ticks; | ||||
| KASSERT(td->td_pflags & TDP_CALLCHAIN, | KASSERT(ring == PMC_UR || (td->td_pflags & TDP_CALLCHAIN) != 0, | ||||
| ("[pmc,%d] Retrieving callchain for thread that doesn't want it", | ("[pmc,%d] Retrieving callchain for thread that doesn't want it", | ||||
| __LINE__)); | __LINE__)); | ||||
| restart: | restart: | ||||
| if (ring == PMC_UR) | if (ring == PMC_UR) | ||||
| nrecords = atomic_readandclear_32(&td->td_pmcpend); | nrecords = atomic_readandclear_32(&td->td_pmcpend); | ||||
| for (iter = 0, considx = psb->ps_considx, prodidx = psb->ps_prodidx; | for (iter = 0, considx = psb->ps_considx, prodidx = psb->ps_prodidx; | ||||
| considx < prodidx && iter < pmc_nsamples; considx++, iter++) { | considx < prodidx && iter < pmc_nsamples; considx++, iter++) { | ||||
| ▲ Show 20 Lines • Show All 1,142 Lines • Show Last 20 Lines | |||||