Lines Matching full:tsc

362 	 * A TSC packet can slip past MTC packets so that the timestamp appears  in intel_pt_decoder_new()
364 * cycles, which is certainly less than 0x1000 TSC ticks, but accept in intel_pt_decoder_new()
879 * For now, do not support using TSC packets - refer in intel_pt_calc_cyc_cb()
965 …intel_pt_log("Timestamp: calculated %g TSC ticks per cycle too big (c.f. CBR-based value %g), pos … in intel_pt_calc_cyc_cb()
974 …intel_pt_log("Timestamp: calculated %g TSC ticks per cycle c.f. CBR-based value %g, pos " x64_fmt … in intel_pt_calc_cyc_cb()
977 …intel_pt_log("Timestamp: calculated %g TSC ticks per cycle c.f. unknown CBR-based value, pos " x64… in intel_pt_calc_cyc_cb()
1002 * For now, do not support using TSC packets for at least the reasons: in intel_pt_calc_cyc_to_tsc()
1004 * 2) TSC packets within PSB+ can slip against CYC packets in intel_pt_calc_cyc_to_tsc()
2318 bool tsc, pip, vmcs, tma, psbend; member
2341 data->tsc = true; in intel_pt_vm_psb_lookahead_cb()
2421 /* Lookahead and get the TMA packet after TSC */
2456 * expect last_mtc_ctc to be before ctc, but the TSC packet can slip in intel_pt_calc_expected_tsc()
2465 * Convert CTC ticks to TSC ticks, add the starting point in intel_pt_calc_expected_tsc()
2502 /* VMX adds the TSC Offset, so subtract to get host TSC */ in intel_pt_translate_vm_tsc()
2504 /* TSC packet has only 7 bytes */ in intel_pt_translate_vm_tsc()
2514 intel_pt_log("Translated VM TSC %#" PRIx64 " -> %#" PRIx64 in intel_pt_translate_vm_tsc()
2515 " VMCS %#" PRIx64 " TSC Offset %#" PRIx64 "\n", in intel_pt_translate_vm_tsc()
2543 p_log("VMCS: %#" PRIx64 " TSC Offset %#" PRIx64, in intel_pt_print_vmcs_info()
2554 if (data->tsc && !data->psbend) in intel_pt_vm_tm_corr_psb()
2566 p_log("ERROR: First TSC is not in PSB+"); in intel_pt_vm_tm_corr_first_tsc()
2575 p_log("ERROR: First TSC, unknown TSC Offset"); in intel_pt_vm_tm_corr_first_tsc()
2589 p_log("ERROR: First TSC, no PIP, unknown TSC Offset"); in intel_pt_vm_tm_corr_first_tsc()
2623 p_log("ERROR: TSC without TMA"); in intel_pt_vm_tm_corr_tsc()
2645 /* Determine if TSC is from Host or Guest */ in intel_pt_vm_tm_corr_tsc()
2664 return; /* Zero TSC Offset, assume Host */ in intel_pt_vm_tm_corr_tsc()
2666 * TSC packet has only 7 bytes of TSC. We have no in intel_pt_vm_tm_corr_tsc()
2675 /* Same TSC Offset as last VMCS, assume Guest */ in intel_pt_vm_tm_corr_tsc()
2682 * the next host TSC in the same buffer, but we don't bother to in intel_pt_vm_tm_corr_tsc()
2686 /* Within expected range for Host TSC, assume Host */ in intel_pt_vm_tm_corr_tsc()
2694 /* Determine whether to assign TSC Offset */ in intel_pt_vm_tm_corr_tsc()
2700 /* Continuous tracing, TSC in a PSB is not a time loss */ in intel_pt_vm_tm_corr_tsc()
2705 * Unlikely to be a time loss TSC in a PSB which is not in intel_pt_vm_tm_corr_tsc()
2713 /* Record VMCS TSC Offset */ in intel_pt_vm_tm_corr_tsc()
2724 /* Determine what TSC Offset to use */ in intel_pt_vm_tm_corr_tsc()
2733 p_log("ERROR: Unknown TSC Offset for VMCS %#" PRIx64, in intel_pt_vm_tm_corr_tsc()
2771 /* Within expected range for Host TSC, assume Host */ in intel_pt_vm_tm_corr_pebs_tsc()
2777 /* Translate Guest TSC to Host TSC */ in intel_pt_vm_tm_corr_pebs_tsc()
2780 intel_pt_log("Translated VM TSC %#" PRIx64 " -> %#" PRIx64 in intel_pt_vm_tm_corr_pebs_tsc()
2781 " VMCS %#" PRIx64 " TSC Offset %#" PRIx64 "\n", in intel_pt_vm_tm_corr_pebs_tsc()
4053 * When using only TSC/MTC to compute cycles, IPC can be in intel_pt_decode()
4060 /* Let PSB event always have TSC timestamp */ in intel_pt_decode()
4160 * intel_pt_next_tsc - find and return next TSC.
4163 * @tsc: TSC value returned
4164 * @rem: returns remaining size when TSC is found
4166 * Find a TSC packet in @buf and return the TSC value. This function assumes
4167 * that @buf starts at a PSB and that PSB+ will contain TSC and so stops if a
4170 * Return: %true if TSC is found, false otherwise.
4172 static bool intel_pt_next_tsc(unsigned char *buf, size_t len, uint64_t *tsc, in intel_pt_next_tsc() argument
4184 *tsc = packet.payload; in intel_pt_next_tsc()
4198 * @tsc1: first TSC to compare
4199 * @tsc2: second TSC to compare
4201 * This function compares 7-byte TSC values allowing for the possibility that
4202 * TSC wrapped around. Generally it is not possible to know if TSC has wrapped
4259 * using TSC.
4266 * @ooo_tsc: out-of-order TSC due to VM TSC offset / scaling
4268 * If the trace contains TSC we can look at the last TSC of @buf_a and the
4269 * first TSC of @buf_b in order to determine if the buffers overlap, and then
4270 * walk forward in @buf_b until a later TSC is found. A precondition is that
4299 return buf_b; /* No TSC in buf_a => assume no overlap */ in intel_pt_find_overlap_tsc()
4303 /* Ignore PSB+ with no TSC */ in intel_pt_find_overlap_tsc()
4307 /* Same TSC, so buffers are consecutive */ in intel_pt_find_overlap_tsc()
4330 * @have_tsc: can use TSC packets to detect overlap
4333 * @ooo_tsc: out-of-order TSC due to VM TSC offset / scaling
4412 uint64_t tsc; in intel_pt_ff_cb() local
4420 !intel_pt_next_tsc(buf, len, &tsc, &rem)) in intel_pt_ff_cb()
4423 tsc = intel_pt_8b_tsc(tsc, buffer->ref_timestamp); in intel_pt_ff_cb()
4426 tsc, buffer->ref_timestamp); in intel_pt_ff_cb()
4432 if (tsc < d->timestamp) in intel_pt_ff_cb()
4489 uint64_t tsc; in intel_pt_fast_forward() local
4492 if (!intel_pt_next_tsc(buf, len, &tsc, &rem)) in intel_pt_fast_forward()
4494 tsc = intel_pt_8b_tsc(tsc, decoder->buf_timestamp); in intel_pt_fast_forward()
4496 * A TSC packet can slip past MTC packets but, after fast in intel_pt_fast_forward()
4497 * forward, decoding starts at the TSC timestamp. That means in intel_pt_fast_forward()
4501 if (tsc < timestamp) { in intel_pt_fast_forward()
4502 intel_pt_log("Fast forward to next PSB timestamp " x64_fmt "\n", tsc); in intel_pt_fast_forward()