Lines Matching refs:timestamp
155 uint64_t timestamp;
362 * A TSC packet can slip past MTC packets so that the timestamp appears
369 intel_pt_log("timestamp: mtc_shift %u\n", decoder->mtc_shift);
370 intel_pt_log("timestamp: tsc_ctc_ratio_n %u\n", decoder->tsc_ctc_ratio_n);
371 intel_pt_log("timestamp: tsc_ctc_ratio_d %u\n", decoder->tsc_ctc_ratio_d);
372 intel_pt_log("timestamp: tsc_ctc_mult %u\n", decoder->tsc_ctc_mult);
373 intel_pt_log("timestamp: tsc_slip %#x\n", decoder->tsc_slip);
621 decoder->sample_timestamp = decoder->timestamp;
630 decoder->timestamp = 0;
657 intel_pt_log("Reference timestamp 0x%" PRIx64 "\n",
780 uint64_t timestamp;
811 uint64_t timestamp;
858 timestamp = data->ctc_timestamp +
861 timestamp = data->ctc_timestamp +
867 if (timestamp < data->timestamp)
871 data->timestamp = timestamp;
884 timestamp = pkt_info->packet.payload |
885 (data->timestamp & (0xffULL << 56));
886 if (data->from_mtc && timestamp < data->timestamp &&
887 data->timestamp - timestamp < decoder->tsc_slip)
889 if (timestamp < data->timestamp)
890 timestamp += (1ULL << 56);
894 data->tsc_timestamp = timestamp;
895 data->timestamp = timestamp;
961 cyc_to_tsc = (double)(timestamp - decoder->timestamp) / data->cycle_cnt;
994 .timestamp = decoder->timestamp,
1051 uint64_t timestamp, masked_timestamp;
1053 timestamp = decoder->timestamp + decoder->timestamp_insn_cnt;
1054 masked_timestamp = timestamp & decoder->period_mask;
1059 timestamp += 1;
1060 masked_timestamp = timestamp & decoder->period_mask;
1070 return decoder->period_ticks - (timestamp - masked_timestamp);
1089 uint64_t timestamp, masked_timestamp;
1096 timestamp = decoder->timestamp + decoder->timestamp_insn_cnt;
1097 masked_timestamp = timestamp & decoder->period_mask;
1773 static uint64_t intel_pt_8b_tsc(uint64_t timestamp, uint64_t ref_timestamp)
1775 timestamp |= (ref_timestamp & (0xffULL << 56));
1777 if (timestamp < ref_timestamp) {
1778 if (ref_timestamp - timestamp > (1ULL << 55))
1779 timestamp += (1ULL << 56);
1781 if (timestamp - ref_timestamp > (1ULL << 55))
1782 timestamp -= (1ULL << 56);
1785 return timestamp;
1790 uint64_t timestamp)
1798 return timestamp >= decoder->last_reliable_timestamp &&
1799 timestamp < decoder->buf_timestamp;
1804 uint64_t timestamp;
1810 timestamp = intel_pt_8b_tsc(decoder->packet.payload,
1812 decoder->tsc_timestamp = timestamp;
1813 decoder->timestamp = timestamp;
1816 } else if (decoder->timestamp) {
1817 timestamp = decoder->packet.payload |
1818 (decoder->timestamp & (0xffULL << 56));
1819 decoder->tsc_timestamp = timestamp;
1820 if (timestamp < decoder->timestamp &&
1821 decoder->timestamp - timestamp < decoder->tsc_slip) {
1822 intel_pt_log_to("Suppressing backwards timestamp",
1823 timestamp);
1824 timestamp = decoder->timestamp;
1826 if (timestamp < decoder->timestamp) {
1828 (timestamp + (1ULL << 56) < decoder->buf_timestamp)) {
1829 intel_pt_log_to("Wraparound timestamp", timestamp);
1830 timestamp += (1ULL << 56);
1831 decoder->tsc_timestamp = timestamp;
1833 intel_pt_log_to("Suppressing bad timestamp", timestamp);
1834 timestamp = decoder->timestamp;
1839 (bad || !intel_pt_time_in_range(decoder, timestamp)) &&
1842 decoder->timestamp = timestamp;
1847 decoder->cyc_ref_timestamp = decoder->timestamp;
1853 intel_pt_log_to("Setting timestamp", decoder->timestamp);
1876 decoder->cyc_cnt_timestamp = decoder->timestamp;
1897 if (!decoder->pge || decoder->timestamp <= decoder->cyc_cnt_timestamp)
1900 tsc_delta = decoder->timestamp - decoder->cyc_cnt_timestamp;
1934 intel_pt_log("CTC timestamp " x64_fmt " last MTC %#x CTC rem %#x\n",
1940 uint64_t timestamp;
1962 timestamp = decoder->ctc_timestamp +
1965 timestamp = decoder->ctc_timestamp +
1971 if (timestamp < decoder->timestamp)
1972 intel_pt_log("Suppressing MTC timestamp " x64_fmt " less than current timestamp " x64_fmt "\n",
1973 timestamp, decoder->timestamp);
1975 decoder->timestamp = timestamp;
1983 decoder->cyc_ref_timestamp = decoder->timestamp;
1989 intel_pt_log_to("Setting timestamp", decoder->timestamp);
2003 decoder->cyc_ref_timestamp = decoder->timestamp;
2011 uint64_t timestamp = decoder->cyc_ref_timestamp;
2024 timestamp += decoder->cycle_cnt * decoder->calc_cyc_to_tsc;
2026 timestamp += decoder->cycle_cnt * decoder->cbr_cyc_to_tsc;
2030 if (timestamp < decoder->timestamp)
2031 intel_pt_log("Suppressing CYC timestamp " x64_fmt " less than current timestamp " x64_fmt "\n",
2032 timestamp, decoder->timestamp);
2034 decoder->timestamp = timestamp;
2038 intel_pt_log_to("Setting timestamp", decoder->timestamp);
2635 ref_timestamp = decoder->timestamp ? decoder->timestamp : decoder->buf_timestamp;
2781 host_tsc = intel_pt_8b_tsc(host_tsc, decoder->timestamp);
2792 host_tsc = decoder->timestamp;
3342 /* Ensure that there is a timestamp */
3343 if (!decoder->timestamp)
3924 if (!decoder->timestamp)
3925 decoder->timestamp = 1;
4062 /* Let PSB event always have TSC timestamp */
4070 decoder->state.timestamp = decoder->sample_timestamp;
4391 * @timestamp: timestamp to fast forward towards
4392 * @buf_timestamp: buffer timestamp of last buffer with trace data earlier than
4393 * the fast forward timestamp.
4396 uint64_t timestamp;
4405 * Determine if @buffer trace is past the fast forward timestamp.
4408 * timestamp, and 0 otherwise.
4427 intel_pt_log("Buffer 1st timestamp " x64_fmt " ref timestamp " x64_fmt "\n",
4431 * If the buffer contains a timestamp earlier that the fast forward
4432 * timestamp, then record it, else stop.
4434 if (tsc < d->timestamp)
4445 * @timestamp: timestamp to fast forward towards
4447 * Reposition decoder at the last PSB with a timestamp earlier than @timestamp.
4451 int intel_pt_fast_forward(struct intel_pt_decoder *decoder, uint64_t timestamp)
4453 struct fast_forward_data d = { .timestamp = timestamp };
4458 intel_pt_log("Fast forward towards timestamp " x64_fmt "\n", timestamp);
4460 /* Find buffer timestamp of buffer to fast forward to */
4465 /* Walk to buffer with same buffer timestamp */
4487 * Walk PSBs while the PSB timestamp is less than the fast forward
4488 * timestamp.
4499 * forward, decoding starts at the TSC timestamp. That means
4503 if (tsc < timestamp) {
4504 intel_pt_log("Fast forward to next PSB timestamp " x64_fmt "\n", tsc);