|
@@ -173,7 +173,7 @@ void hif_display_latest_desc_hist(struct hif_opaque_softc *hif_ctx)
|
|
|
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
|
|
|
struct ce_desc_hist *ce_hist;
|
|
|
struct latest_evt_history *evt;
|
|
|
- int i;
|
|
|
+ int i, j;
|
|
|
|
|
|
if (!scn)
|
|
|
return;
|
|
@@ -184,12 +184,14 @@ void hif_display_latest_desc_hist(struct hif_opaque_softc *hif_ctx)
|
|
|
if (!ce_hist->enable[i + HIF_CE_MAX_LATEST_HIST])
|
|
|
continue;
|
|
|
|
|
|
- evt = &ce_hist->latest_evt[i];
|
|
|
- hif_info_high("CE_id:%d cpu_id:%d irq_entry:0x%llx tasklet_entry:0x%llx tasklet_resched:0x%llx tasklet_exit:0x%llx ce_work:0x%llx hp:%x tp:%x",
|
|
|
- (i + HIF_CE_MAX_LATEST_HIST), evt->cpu_id,
|
|
|
- evt->irq_entry_ts, evt->bh_entry_ts,
|
|
|
- evt->bh_resched_ts, evt->bh_exit_ts,
|
|
|
- evt->bh_work_ts, evt->ring_hp, evt->ring_tp);
|
|
|
+ for (j = 0; j < HIF_CE_MAX_LATEST_EVTS; j++) {
|
|
|
+ evt = &ce_hist->latest_evts[i][j];
|
|
|
+ hif_info_high("CE_id:%d event_idx:%d cpu_id:%d irq_entry:0x%llx tasklet_entry:0x%llx tasklet_resched:0x%llx tasklet_exit:0x%llx ce_work:0x%llx hp:%x tp:%x",
|
|
|
+ (i + HIF_CE_MAX_LATEST_HIST), j, evt->cpu_id,
|
|
|
+ evt->irq_entry_ts, evt->bh_entry_ts,
|
|
|
+ evt->bh_resched_ts, evt->bh_exit_ts,
|
|
|
+ evt->bh_work_ts, evt->ring_hp, evt->ring_tp);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -198,32 +200,48 @@ void hif_record_latest_evt(struct ce_desc_hist *ce_hist,
|
|
|
int ce_id, uint64_t time,
|
|
|
uint32_t hp, uint32_t tp)
|
|
|
{
|
|
|
- struct latest_evt_history *latest_evt;
|
|
|
+ struct latest_evt_history *latest_evts;
|
|
|
+ int idx = 0;
|
|
|
|
|
|
if (ce_id != 2 && ce_id != 3)
|
|
|
return;
|
|
|
|
|
|
- latest_evt = &ce_hist->latest_evt[ce_id - HIF_CE_MAX_LATEST_HIST];
|
|
|
+ latest_evts = &ce_hist->latest_evts[ce_id - HIF_CE_MAX_LATEST_HIST][idx];
|
|
|
|
|
|
switch (type) {
|
|
|
case HIF_IRQ_EVENT:
|
|
|
- latest_evt->irq_entry_ts = time;
|
|
|
- latest_evt->cpu_id = qdf_get_cpu();
|
|
|
+ if (latest_evts[idx].irq_entry_ts >
|
|
|
+ latest_evts[idx + 1].irq_entry_ts)
|
|
|
+ idx = 1;
|
|
|
+ latest_evts[idx].irq_entry_ts = time;
|
|
|
+ latest_evts[idx].cpu_id = qdf_get_cpu();
|
|
|
break;
|
|
|
case HIF_CE_TASKLET_ENTRY:
|
|
|
- latest_evt->bh_entry_ts = time;
|
|
|
+ if (latest_evts[idx].bh_entry_ts >
|
|
|
+ latest_evts[idx + 1].bh_entry_ts)
|
|
|
+ idx = 1;
|
|
|
+ latest_evts[idx].bh_entry_ts = time;
|
|
|
break;
|
|
|
case HIF_CE_TASKLET_RESCHEDULE:
|
|
|
- latest_evt->bh_resched_ts = time;
|
|
|
+ if (latest_evts[idx].bh_resched_ts >
|
|
|
+ latest_evts[idx + 1].bh_resched_ts)
|
|
|
+ idx = 1;
|
|
|
+ latest_evts[idx].bh_resched_ts = time;
|
|
|
break;
|
|
|
case HIF_CE_TASKLET_EXIT:
|
|
|
- latest_evt->bh_exit_ts = time;
|
|
|
+ if (latest_evts[idx].bh_exit_ts >
|
|
|
+ latest_evts[idx + 1].bh_exit_ts)
|
|
|
+ idx = 1;
|
|
|
+ latest_evts[idx].bh_exit_ts = time;
|
|
|
break;
|
|
|
case HIF_TX_DESC_COMPLETION:
|
|
|
case HIF_CE_DEST_STATUS_RING_REAP:
|
|
|
- latest_evt->bh_work_ts = time;
|
|
|
- latest_evt->ring_hp = hp;
|
|
|
- latest_evt->ring_tp = tp;
|
|
|
+ if (latest_evts[idx].bh_work_ts >
|
|
|
+ latest_evts[idx + 1].bh_work_ts)
|
|
|
+ idx = 1;
|
|
|
+ latest_evts[idx].bh_work_ts = time;
|
|
|
+ latest_evts[idx].ring_hp = hp;
|
|
|
+ latest_evts[idx].ring_tp = tp;
|
|
|
break;
|
|
|
default:
|
|
|
break;
|