summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-04-10 15:10:07 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-04-10 15:10:06 -0700
commit55b4dd9721ab23d4197b102c3585a700854157f7 (patch)
tree61a4bb5818eba3baac424e4c39ea8ea2f6084cc7 /tools/perf
parent6a75b0f79e6d0f6383654169f5e3e97d987fd4a2 (diff)
parent43751312d7a183dc5df3f8d2a222991d22c5ceb3 (diff)
Merge "Merge android-4.4.178 (7af10f2) into msm-4.4"
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/intel-pt-decoder/intel-pt-decoder.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
index d01e2ce818f7..62b38f2ff60d 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -238,19 +238,15 @@ struct intel_pt_decoder *intel_pt_decoder_new(struct intel_pt_params *params)
if (!(decoder->tsc_ctc_ratio_n % decoder->tsc_ctc_ratio_d))
decoder->tsc_ctc_mult = decoder->tsc_ctc_ratio_n /
decoder->tsc_ctc_ratio_d;
-
- /*
- * Allow for timestamps appearing to backwards because a TSC
- * packet has slipped past a MTC packet, so allow 2 MTC ticks
- * or ...
- */
- decoder->tsc_slip = multdiv(2 << decoder->mtc_shift,
- decoder->tsc_ctc_ratio_n,
- decoder->tsc_ctc_ratio_d);
}
- /* ... or 0x100 paranoia */
- if (decoder->tsc_slip < 0x100)
- decoder->tsc_slip = 0x100;
+
+ /*
+ * A TSC packet can slip past MTC packets so that the timestamp appears
+ * to go backwards. One estimate is that can be up to about 40 CPU
+ * cycles, which is certainly less than 0x1000 TSC ticks, but accept
+ * slippage an order of magnitude more to be on the safe side.
+ */
+ decoder->tsc_slip = 0x10000;
intel_pt_log("timestamp: mtc_shift %u\n", decoder->mtc_shift);
intel_pt_log("timestamp: tsc_ctc_ratio_n %u\n", decoder->tsc_ctc_ratio_n);