Lines Matching full:cyc
274 /* We recover from previous CYC losses. */ in pt_time_update_mtc()
341 /* Adjust a CYC packet's payload spanning multiple MTC periods.
343 * CYC packets measure the Fast Counter since the last CYC(-eligible) packet.
344 * Depending on the CYC threshold, we may not get a CYC for each MTC, so a CYC
350 * If we find a CYC packet to span multiple MTC packets, though, we try to
354 * We only consider MTC. For the first CYC after TSC, the corresponding TMA
359 static int pt_time_adjust_cyc(uint64_t *cyc, const struct pt_time *time, in pt_time_adjust_cyc() argument
379 * fcr = (fc << pt_tcal_fcr_shr) / cyc in pt_time_adjust_cyc()
381 * So cyc = (fc << pt_tcal_fcr_shr) / fcr. in pt_time_adjust_cyc()
393 total_cyc = *cyc; in pt_time_adjust_cyc()
396 * CYC payload to any previous MTC period. in pt_time_adjust_cyc()
398 * We lost an unknown portion of the CYC payload for the current MTC in pt_time_adjust_cyc()
404 *cyc = total_cyc - old_cyc; in pt_time_adjust_cyc()
412 uint64_t cyc, fc; in pt_time_update_cyc() local
422 cyc = packet->value; in pt_time_update_cyc()
427 errcode = pt_time_adjust_cyc(&cyc, time, config, fcr); in pt_time_update_cyc()
432 fc += (cyc * fcr) >> pt_tcal_fcr_shr; in pt_time_update_cyc()
522 uint64_t tsc, last_tsc, tsc_delta, cyc, fcr; in pt_tcal_header_tsc() local
530 cyc = tcal->cyc_tsc; in pt_tcal_header_tsc()
537 if (!last_tsc || !cyc) in pt_tcal_header_tsc()
562 fcr = (tsc_delta << pt_tcal_fcr_shr) / cyc; in pt_tcal_header_tsc()
619 uint64_t cyc, fc, fcr; in pt_tcal_update_mtc() local
627 cyc = tcal->cyc_mtc; in pt_tcal_update_mtc()
647 if (!cyc) in pt_tcal_update_mtc()
674 fcr = (fc << pt_tcal_fcr_shr) / cyc; in pt_tcal_update_mtc()
676 /* SKL168: Intel(R) PT CYC Packets Can be Dropped When Immediately in pt_tcal_update_mtc()
680 * it looks like we lost a wrap CYC packet. in pt_tcal_update_mtc()
689 /* The case is less clear for a lost wrap CYC packet since we do in pt_tcal_update_mtc()
692 * The CYC counter wraps on the affected processors every 4096 in pt_tcal_update_mtc()
708 dfc = (tcal->fcr * (cyc + 0xf00)) >> pt_tcal_fcr_shr; in pt_tcal_update_mtc()
710 /* If we didn't drop a wrap CYC, @dfc should be way in pt_tcal_update_mtc()
733 uint64_t cyc; in pt_tcal_update_cyc() local
740 cyc = packet->value; in pt_tcal_update_cyc()
741 tcal->cyc_mtc += cyc; in pt_tcal_update_cyc()
742 tcal->cyc_tsc += cyc; in pt_tcal_update_cyc()