Lines Matching full:timestamp
155 uint64_t timestamp; member
362 * A TSC packet can slip past MTC packets so that the timestamp appears in intel_pt_decoder_new()
369 intel_pt_log("timestamp: mtc_shift %u\n", decoder->mtc_shift); in intel_pt_decoder_new()
370 intel_pt_log("timestamp: tsc_ctc_ratio_n %u\n", decoder->tsc_ctc_ratio_n); in intel_pt_decoder_new()
371 intel_pt_log("timestamp: tsc_ctc_ratio_d %u\n", decoder->tsc_ctc_ratio_d); in intel_pt_decoder_new()
372 intel_pt_log("timestamp: tsc_ctc_mult %u\n", decoder->tsc_ctc_mult); in intel_pt_decoder_new()
373 intel_pt_log("timestamp: tsc_slip %#x\n", decoder->tsc_slip); in intel_pt_decoder_new()
621 decoder->sample_timestamp = decoder->timestamp; in intel_pt_update_sample_time()
630 decoder->timestamp = 0; in intel_pt_reposition()
657 intel_pt_log("Reference timestamp 0x%" PRIx64 "\n", in intel_pt_get_data()
780 uint64_t timestamp; member
811 uint64_t timestamp; in intel_pt_calc_cyc_cb() local
858 timestamp = data->ctc_timestamp + in intel_pt_calc_cyc_cb()
861 timestamp = data->ctc_timestamp + in intel_pt_calc_cyc_cb()
867 if (timestamp < data->timestamp) in intel_pt_calc_cyc_cb()
871 data->timestamp = timestamp; in intel_pt_calc_cyc_cb()
884 timestamp = pkt_info->packet.payload | in intel_pt_calc_cyc_cb()
885 (data->timestamp & (0xffULL << 56)); in intel_pt_calc_cyc_cb()
886 if (data->from_mtc && timestamp < data->timestamp && in intel_pt_calc_cyc_cb()
887 data->timestamp - timestamp < decoder->tsc_slip) in intel_pt_calc_cyc_cb()
889 if (timestamp < data->timestamp) in intel_pt_calc_cyc_cb()
890 timestamp += (1ULL << 56); in intel_pt_calc_cyc_cb()
894 data->tsc_timestamp = timestamp; in intel_pt_calc_cyc_cb()
895 data->timestamp = timestamp; in intel_pt_calc_cyc_cb()
961 cyc_to_tsc = (double)(timestamp - decoder->timestamp) / data->cycle_cnt; 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()
994 .timestamp = decoder->timestamp, in intel_pt_calc_cyc_to_tsc()
1051 uint64_t timestamp, masked_timestamp; in intel_pt_next_period() local
1053 timestamp = decoder->timestamp + decoder->timestamp_insn_cnt; in intel_pt_next_period()
1054 masked_timestamp = timestamp & decoder->period_mask; in intel_pt_next_period()
1059 timestamp += 1; in intel_pt_next_period()
1060 masked_timestamp = timestamp & decoder->period_mask; in intel_pt_next_period()
1070 return decoder->period_ticks - (timestamp - masked_timestamp); in intel_pt_next_period()
1089 uint64_t timestamp, masked_timestamp; in intel_pt_sample_insn() local
1096 timestamp = decoder->timestamp + decoder->timestamp_insn_cnt; in intel_pt_sample_insn()
1097 masked_timestamp = timestamp & decoder->period_mask; in intel_pt_sample_insn()
1771 static uint64_t intel_pt_8b_tsc(uint64_t timestamp, uint64_t ref_timestamp) in intel_pt_8b_tsc() argument
1773 timestamp |= (ref_timestamp & (0xffULL << 56)); in intel_pt_8b_tsc()
1775 if (timestamp < ref_timestamp) { in intel_pt_8b_tsc()
1776 if (ref_timestamp - timestamp > (1ULL << 55)) in intel_pt_8b_tsc()
1777 timestamp += (1ULL << 56); in intel_pt_8b_tsc()
1779 if (timestamp - ref_timestamp > (1ULL << 55)) in intel_pt_8b_tsc()
1780 timestamp -= (1ULL << 56); in intel_pt_8b_tsc()
1783 return timestamp; in intel_pt_8b_tsc()
1788 uint64_t timestamp) in intel_pt_time_in_range() argument
1796 return timestamp >= decoder->last_reliable_timestamp && in intel_pt_time_in_range()
1797 timestamp < decoder->buf_timestamp; in intel_pt_time_in_range()
1802 uint64_t timestamp; in intel_pt_calc_tsc_timestamp() local
1808 timestamp = intel_pt_8b_tsc(decoder->packet.payload, in intel_pt_calc_tsc_timestamp()
1810 decoder->tsc_timestamp = timestamp; in intel_pt_calc_tsc_timestamp()
1811 decoder->timestamp = timestamp; in intel_pt_calc_tsc_timestamp()
1814 } else if (decoder->timestamp) { in intel_pt_calc_tsc_timestamp()
1815 timestamp = decoder->packet.payload | in intel_pt_calc_tsc_timestamp()
1816 (decoder->timestamp & (0xffULL << 56)); in intel_pt_calc_tsc_timestamp()
1817 decoder->tsc_timestamp = timestamp; in intel_pt_calc_tsc_timestamp()
1818 if (timestamp < decoder->timestamp && in intel_pt_calc_tsc_timestamp()
1819 decoder->timestamp - timestamp < decoder->tsc_slip) { in intel_pt_calc_tsc_timestamp()
1820 intel_pt_log_to("Suppressing backwards timestamp", in intel_pt_calc_tsc_timestamp()
1821 timestamp); in intel_pt_calc_tsc_timestamp()
1822 timestamp = decoder->timestamp; in intel_pt_calc_tsc_timestamp()
1824 if (timestamp < decoder->timestamp) { in intel_pt_calc_tsc_timestamp()
1826 (timestamp + (1ULL << 56) < decoder->buf_timestamp)) { in intel_pt_calc_tsc_timestamp()
1827 intel_pt_log_to("Wraparound timestamp", timestamp); in intel_pt_calc_tsc_timestamp()
1828 timestamp += (1ULL << 56); in intel_pt_calc_tsc_timestamp()
1829 decoder->tsc_timestamp = timestamp; in intel_pt_calc_tsc_timestamp()
1831 intel_pt_log_to("Suppressing bad timestamp", timestamp); in intel_pt_calc_tsc_timestamp()
1832 timestamp = decoder->timestamp; in intel_pt_calc_tsc_timestamp()
1837 (bad || !intel_pt_time_in_range(decoder, timestamp)) && in intel_pt_calc_tsc_timestamp()
1839 p_log("Timestamp out of range"); in intel_pt_calc_tsc_timestamp()
1840 decoder->timestamp = timestamp; in intel_pt_calc_tsc_timestamp()
1845 decoder->cyc_ref_timestamp = decoder->timestamp; in intel_pt_calc_tsc_timestamp()
1851 intel_pt_log_to("Setting timestamp", decoder->timestamp); in intel_pt_calc_tsc_timestamp()
1874 decoder->cyc_cnt_timestamp = decoder->timestamp; in intel_pt_mtc_cyc_cnt_pge()
1895 if (!decoder->pge || decoder->timestamp <= decoder->cyc_cnt_timestamp) in intel_pt_mtc_cyc_cnt_upd()
1898 tsc_delta = decoder->timestamp - decoder->cyc_cnt_timestamp; in intel_pt_mtc_cyc_cnt_upd()
1932 intel_pt_log("CTC timestamp " x64_fmt " last MTC %#x CTC rem %#x\n", in intel_pt_calc_tma()
1938 uint64_t timestamp; in intel_pt_calc_mtc_timestamp() local
1960 timestamp = decoder->ctc_timestamp + in intel_pt_calc_mtc_timestamp()
1963 timestamp = decoder->ctc_timestamp + in intel_pt_calc_mtc_timestamp()
1969 if (timestamp < decoder->timestamp) in intel_pt_calc_mtc_timestamp()
1970 intel_pt_log("Suppressing MTC timestamp " x64_fmt " less than current timestamp " x64_fmt "\n", in intel_pt_calc_mtc_timestamp()
1971 timestamp, decoder->timestamp); in intel_pt_calc_mtc_timestamp()
1973 decoder->timestamp = timestamp; in intel_pt_calc_mtc_timestamp()
1981 decoder->cyc_ref_timestamp = decoder->timestamp; in intel_pt_calc_mtc_timestamp()
1987 intel_pt_log_to("Setting timestamp", decoder->timestamp); in intel_pt_calc_mtc_timestamp()
2007 uint64_t timestamp = decoder->cyc_ref_timestamp; in intel_pt_calc_cyc_timestamp() local
2020 timestamp += decoder->cycle_cnt * decoder->calc_cyc_to_tsc; in intel_pt_calc_cyc_timestamp()
2022 timestamp += decoder->cycle_cnt * decoder->cbr_cyc_to_tsc; in intel_pt_calc_cyc_timestamp()
2026 if (timestamp < decoder->timestamp) in intel_pt_calc_cyc_timestamp()
2027 intel_pt_log("Suppressing CYC timestamp " x64_fmt " less than current timestamp " x64_fmt "\n", in intel_pt_calc_cyc_timestamp()
2028 timestamp, decoder->timestamp); in intel_pt_calc_cyc_timestamp()
2030 decoder->timestamp = timestamp; in intel_pt_calc_cyc_timestamp()
2034 intel_pt_log_to("Setting timestamp", decoder->timestamp); in intel_pt_calc_cyc_timestamp()
2631 ref_timestamp = decoder->timestamp ? decoder->timestamp : decoder->buf_timestamp; in intel_pt_vm_tm_corr_tsc()
2777 host_tsc = intel_pt_8b_tsc(host_tsc, decoder->timestamp); in intel_pt_vm_tm_corr_pebs_tsc()
2784 p_log("Timestamp out of range"); in intel_pt_vm_tm_corr_pebs_tsc()
2788 host_tsc = decoder->timestamp; in intel_pt_vm_tm_corr_pebs_tsc()
3338 /* Ensure that there is a timestamp */ in intel_pt_walk_trace()
3339 if (!decoder->timestamp) in intel_pt_walk_trace()
3920 if (!decoder->timestamp) in intel_pt_sync()
3921 decoder->timestamp = 1; in intel_pt_sync()
4058 /* Let PSB event always have TSC timestamp */ in intel_pt_decode()
4066 decoder->state.timestamp = decoder->sample_timestamp; in intel_pt_decode()
4387 * @timestamp: timestamp to fast forward towards
4388 * @buf_timestamp: buffer timestamp of last buffer with trace data earlier than
4389 * the fast forward timestamp.
4392 uint64_t timestamp; member
4401 * Determine if @buffer trace is past the fast forward timestamp.
4404 * timestamp, and 0 otherwise.
4423 intel_pt_log("Buffer 1st timestamp " x64_fmt " ref timestamp " x64_fmt "\n", in intel_pt_ff_cb()
4427 * If the buffer contains a timestamp earlier that the fast forward in intel_pt_ff_cb()
4428 * timestamp, then record it, else stop. in intel_pt_ff_cb()
4430 if (tsc < d->timestamp) in intel_pt_ff_cb()
4441 * @timestamp: timestamp to fast forward towards
4443 * Reposition decoder at the last PSB with a timestamp earlier than @timestamp.
4447 int intel_pt_fast_forward(struct intel_pt_decoder *decoder, uint64_t timestamp) in intel_pt_fast_forward() argument
4449 struct fast_forward_data d = { .timestamp = timestamp }; in intel_pt_fast_forward()
4454 intel_pt_log("Fast forward towards timestamp " x64_fmt "\n", timestamp); in intel_pt_fast_forward()
4456 /* Find buffer timestamp of buffer to fast forward to */ in intel_pt_fast_forward()
4461 /* Walk to buffer with same buffer timestamp */ in intel_pt_fast_forward()
4483 * Walk PSBs while the PSB timestamp is less than the fast forward in intel_pt_fast_forward()
4484 * timestamp. in intel_pt_fast_forward()
4495 * forward, decoding starts at the TSC timestamp. That means in intel_pt_fast_forward()
4499 if (tsc < timestamp) { in intel_pt_fast_forward()
4500 intel_pt_log("Fast forward to next PSB timestamp " x64_fmt "\n", tsc); in intel_pt_fast_forward()