Lines Matching full:tsc

353 	 * A TSC packet can slip past MTC packets so that the timestamp appears  in intel_pt_decoder_new()
355 * cycles, which is certainly less than 0x1000 TSC ticks, but accept in intel_pt_decoder_new()
863 * For now, do not support using TSC packets - refer in intel_pt_calc_cyc_cb()
949 …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()
958 …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()
961 …intel_pt_log("Timestamp: calculated %g TSC ticks per cycle c.f. unknown CBR-based value, pos " x64… in intel_pt_calc_cyc_cb()
986 * For now, do not support using TSC packets for at least the reasons: in intel_pt_calc_cyc_to_tsc()
988 * 2) TSC packets within PSB+ can slip against CYC packets in intel_pt_calc_cyc_to_tsc()
2055 bool tsc, pip, vmcs, tma, psbend; member
2078 data->tsc = true; in intel_pt_vm_psb_lookahead_cb()
2155 /* Lookahead and get the TMA packet after TSC */
2190 * expect last_mtc_ctc to be before ctc, but the TSC packet can slip in intel_pt_calc_expected_tsc()
2199 * Convert CTC ticks to TSC ticks, add the starting point in intel_pt_calc_expected_tsc()
2236 /* VMX adds the TSC Offset, so subtract to get host TSC */ in intel_pt_translate_vm_tsc()
2238 /* TSC packet has only 7 bytes */ in intel_pt_translate_vm_tsc()
2248 intel_pt_log("Translated VM TSC %#" PRIx64 " -> %#" PRIx64 in intel_pt_translate_vm_tsc()
2249 " VMCS %#" PRIx64 " TSC Offset %#" PRIx64 "\n", in intel_pt_translate_vm_tsc()
2277 p_log("VMCS: %#" PRIx64 " TSC Offset %#" PRIx64, in intel_pt_print_vmcs_info()
2288 if (data->tsc && !data->psbend) in intel_pt_vm_tm_corr_psb()
2300 p_log("ERROR: First TSC is not in PSB+"); in intel_pt_vm_tm_corr_first_tsc()
2309 p_log("ERROR: First TSC, unknown TSC Offset"); in intel_pt_vm_tm_corr_first_tsc()
2323 p_log("ERROR: First TSC, no PIP, unknown TSC Offset"); in intel_pt_vm_tm_corr_first_tsc()
2357 p_log("ERROR: TSC without TMA"); in intel_pt_vm_tm_corr_tsc()
2379 /* Determine if TSC is from Host or Guest */ in intel_pt_vm_tm_corr_tsc()
2398 return; /* Zero TSC Offset, assume Host */ in intel_pt_vm_tm_corr_tsc()
2400 * TSC packet has only 7 bytes of TSC. We have no in intel_pt_vm_tm_corr_tsc()
2409 /* Same TSC Offset as last VMCS, assume Guest */ in intel_pt_vm_tm_corr_tsc()
2416 * the next host TSC in the same buffer, but we don't bother to in intel_pt_vm_tm_corr_tsc()
2420 /* Within expected range for Host TSC, assume Host */ in intel_pt_vm_tm_corr_tsc()
2428 /* Determine whether to assign TSC Offset */ in intel_pt_vm_tm_corr_tsc()
2434 /* Continuous tracing, TSC in a PSB is not a time loss */ in intel_pt_vm_tm_corr_tsc()
2439 * Unlikely to be a time loss TSC in a PSB which is not in intel_pt_vm_tm_corr_tsc()
2447 /* Record VMCS TSC Offset */ in intel_pt_vm_tm_corr_tsc()
2458 /* Determine what TSC Offset to use */ in intel_pt_vm_tm_corr_tsc()
2467 p_log("ERROR: Unknown TSC Offset for VMCS %#" PRIx64, in intel_pt_vm_tm_corr_tsc()
2505 /* Within expected range for Host TSC, assume Host */ in intel_pt_vm_tm_corr_pebs_tsc()
2511 /* Translate Guest TSC to Host TSC */ in intel_pt_vm_tm_corr_pebs_tsc()
2514 intel_pt_log("Translated VM TSC %#" PRIx64 " -> %#" PRIx64 in intel_pt_vm_tm_corr_pebs_tsc()
2515 " VMCS %#" PRIx64 " TSC Offset %#" PRIx64 "\n", in intel_pt_vm_tm_corr_pebs_tsc()
3731 * When using only TSC/MTC to compute cycles, IPC can be in intel_pt_decode()
3738 /* Let PSB event always have TSC timestamp */ in intel_pt_decode()
3838 * intel_pt_next_tsc - find and return next TSC.
3841 * @tsc: TSC value returned
3842 * @rem: returns remaining size when TSC is found
3844 * Find a TSC packet in @buf and return the TSC value. This function assumes
3845 * that @buf starts at a PSB and that PSB+ will contain TSC and so stops if a
3848 * Return: %true if TSC is found, false otherwise.
3850 static bool intel_pt_next_tsc(unsigned char *buf, size_t len, uint64_t *tsc, in intel_pt_next_tsc() argument
3862 *tsc = packet.payload; in intel_pt_next_tsc()
3876 * @tsc1: first TSC to compare
3877 * @tsc2: second TSC to compare
3879 * This function compares 7-byte TSC values allowing for the possibility that
3880 * TSC wrapped around. Generally it is not possible to know if TSC has wrapped
3937 * using TSC.
3944 * @ooo_tsc: out-of-order TSC due to VM TSC offset / scaling
3946 * If the trace contains TSC we can look at the last TSC of @buf_a and the
3947 * first TSC of @buf_b in order to determine if the buffers overlap, and then
3948 * walk forward in @buf_b until a later TSC is found. A precondition is that
3977 return buf_b; /* No TSC in buf_a => assume no overlap */ in intel_pt_find_overlap_tsc()
3981 /* Ignore PSB+ with no TSC */ in intel_pt_find_overlap_tsc()
3985 /* Same TSC, so buffers are consecutive */ in intel_pt_find_overlap_tsc()
4008 * @have_tsc: can use TSC packets to detect overlap
4011 * @ooo_tsc: out-of-order TSC due to VM TSC offset / scaling
4090 uint64_t tsc; in intel_pt_ff_cb() local
4098 !intel_pt_next_tsc(buf, len, &tsc, &rem)) in intel_pt_ff_cb()
4101 tsc = intel_pt_8b_tsc(tsc, buffer->ref_timestamp); in intel_pt_ff_cb()
4104 tsc, buffer->ref_timestamp); in intel_pt_ff_cb()
4110 if (tsc < d->timestamp) in intel_pt_ff_cb()
4167 uint64_t tsc; in intel_pt_fast_forward() local
4170 if (!intel_pt_next_tsc(buf, len, &tsc, &rem)) in intel_pt_fast_forward()
4172 tsc = intel_pt_8b_tsc(tsc, decoder->buf_timestamp); in intel_pt_fast_forward()
4174 * A TSC packet can slip past MTC packets but, after fast in intel_pt_fast_forward()
4175 * forward, decoding starts at the TSC timestamp. That means in intel_pt_fast_forward()
4179 if (tsc < timestamp) { in intel_pt_fast_forward()
4180 intel_pt_log("Fast forward to next PSB timestamp " x64_fmt "\n", tsc); in intel_pt_fast_forward()