Lines Matching refs:timestamp

129 	uint64_t timestamp;
292 * A TSC packet can slip past MTC packets so that the timestamp appears
299 intel_pt_log("timestamp: mtc_shift %u\n", decoder->mtc_shift);
300 intel_pt_log("timestamp: tsc_ctc_ratio_n %u\n", decoder->tsc_ctc_ratio_n);
301 intel_pt_log("timestamp: tsc_ctc_ratio_d %u\n", decoder->tsc_ctc_ratio_d);
302 intel_pt_log("timestamp: tsc_ctc_mult %u\n", decoder->tsc_ctc_mult);
303 intel_pt_log("timestamp: tsc_slip %#x\n", decoder->tsc_slip);
520 decoder->sample_timestamp = decoder->timestamp;
528 decoder->timestamp = 0;
554 intel_pt_log("Reference timestamp 0x%" PRIx64 "\n",
677 uint64_t timestamp;
708 uint64_t timestamp;
752 timestamp = data->ctc_timestamp +
755 timestamp = data->ctc_timestamp +
761 if (timestamp < data->timestamp)
765 data->timestamp = timestamp;
778 timestamp = pkt_info->packet.payload |
779 (data->timestamp & (0xffULL << 56));
780 if (data->from_mtc && timestamp < data->timestamp &&
781 data->timestamp - timestamp < decoder->tsc_slip)
783 if (timestamp < data->timestamp)
784 timestamp += (1ULL << 56);
788 data->tsc_timestamp = timestamp;
789 data->timestamp = timestamp;
855 cyc_to_tsc = (double)(timestamp - decoder->timestamp) / data->cycle_cnt;
888 .timestamp = decoder->timestamp,
945 uint64_t timestamp, masked_timestamp;
947 timestamp = decoder->timestamp + decoder->timestamp_insn_cnt;
948 masked_timestamp = timestamp & decoder->period_mask;
953 timestamp += 1;
954 masked_timestamp = timestamp & decoder->period_mask;
964 return decoder->period_ticks - (timestamp - masked_timestamp);
983 uint64_t timestamp, masked_timestamp;
990 timestamp = decoder->timestamp + decoder->timestamp_insn_cnt;
991 masked_timestamp = timestamp & decoder->period_mask;
1435 static uint64_t intel_pt_8b_tsc(uint64_t timestamp, uint64_t ref_timestamp)
1437 timestamp |= (ref_timestamp & (0xffULL << 56));
1439 if (timestamp < ref_timestamp) {
1440 if (ref_timestamp - timestamp > (1ULL << 55))
1441 timestamp += (1ULL << 56);
1443 if (timestamp - ref_timestamp > (1ULL << 55))
1444 timestamp -= (1ULL << 56);
1447 return timestamp;
1452 uint64_t timestamp;
1457 timestamp = intel_pt_8b_tsc(decoder->packet.payload,
1459 decoder->tsc_timestamp = timestamp;
1460 decoder->timestamp = timestamp;
1463 } else if (decoder->timestamp) {
1464 timestamp = decoder->packet.payload |
1465 (decoder->timestamp & (0xffULL << 56));
1466 decoder->tsc_timestamp = timestamp;
1467 if (timestamp < decoder->timestamp &&
1468 decoder->timestamp - timestamp < decoder->tsc_slip) {
1469 intel_pt_log_to("Suppressing backwards timestamp",
1470 timestamp);
1471 timestamp = decoder->timestamp;
1473 if (timestamp < decoder->timestamp) {
1474 intel_pt_log_to("Wraparound timestamp", timestamp);
1475 timestamp += (1ULL << 56);
1476 decoder->tsc_timestamp = timestamp;
1478 decoder->timestamp = timestamp;
1483 decoder->cyc_ref_timestamp = decoder->timestamp;
1489 intel_pt_log_to("Setting timestamp", decoder->timestamp);
1516 decoder->cyc_cnt_timestamp = decoder->timestamp;
1537 if (!decoder->pge || decoder->timestamp <= decoder->cyc_cnt_timestamp)
1540 tsc_delta = decoder->timestamp - decoder->cyc_cnt_timestamp;
1573 intel_pt_log("CTC timestamp " x64_fmt " last MTC %#x CTC rem %#x\n",
1579 uint64_t timestamp;
1601 timestamp = decoder->ctc_timestamp +
1604 timestamp = decoder->ctc_timestamp +
1610 if (timestamp < decoder->timestamp)
1611 intel_pt_log("Suppressing MTC timestamp " x64_fmt " less than current timestamp " x64_fmt "\n",
1612 timestamp, decoder->timestamp);
1614 decoder->timestamp = timestamp;
1622 decoder->cyc_ref_timestamp = decoder->timestamp;
1628 intel_pt_log_to("Setting timestamp", decoder->timestamp);
1642 decoder->cyc_ref_timestamp = decoder->timestamp;
1650 uint64_t timestamp = decoder->cyc_ref_timestamp;
1663 timestamp += decoder->cycle_cnt * decoder->calc_cyc_to_tsc;
1665 timestamp += decoder->cycle_cnt * decoder->cbr_cyc_to_tsc;
1669 if (timestamp < decoder->timestamp)
1670 intel_pt_log("Suppressing CYC timestamp " x64_fmt " less than current timestamp " x64_fmt "\n",
1671 timestamp, decoder->timestamp);
1673 decoder->timestamp = timestamp;
1677 intel_pt_log_to("Setting timestamp", decoder->timestamp);
2218 /* Ensure that there is a timestamp */
2219 if (!decoder->timestamp)
2889 decoder->state.timestamp = decoder->sample_timestamp;
3207 * @timestamp: timestamp to fast forward towards
3208 * @buf_timestamp: buffer timestamp of last buffer with trace data earlier than
3209 * the fast forward timestamp.
3212 uint64_t timestamp;
3221 * Determine if @buffer trace is past the fast forward timestamp.
3224 * timestamp, and 0 otherwise.
3243 intel_pt_log("Buffer 1st timestamp " x64_fmt " ref timestamp " x64_fmt "\n",
3247 * If the buffer contains a timestamp earlier that the fast forward
3248 * timestamp, then record it, else stop.
3250 if (tsc < d->timestamp)
3261 * @timestamp: timestamp to fast forward towards
3263 * Reposition decoder at the last PSB with a timestamp earlier than @timestamp.
3267 int intel_pt_fast_forward(struct intel_pt_decoder *decoder, uint64_t timestamp)
3269 struct fast_forward_data d = { .timestamp = timestamp };
3274 intel_pt_log("Fast forward towards timestamp " x64_fmt "\n", timestamp);
3276 /* Find buffer timestamp of buffer to fast forward to */
3281 /* Walk to buffer with same buffer timestamp */
3303 * Walk PSBs while the PSB timestamp is less than the fast forward
3304 * timestamp.
3315 * forward, decoding starts at the TSC timestamp. That means
3319 if (tsc < timestamp) {
3320 intel_pt_log("Fast forward to next PSB timestamp " x64_fmt "\n", tsc);