]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
perf intel-pt: Fix MTC timestamp calculation for large MTC periods
authorAdrian Hunter <adrian.hunter@intel.com>
Wed, 28 Sep 2016 11:41:36 +0000 (14:41 +0300)
committerIshan Mittal <imittal@nvidia.com>
Fri, 6 Jan 2017 10:15:21 +0000 (15:45 +0530)
commit09f54427044070175c399adf3395fc95be84ee57
treed6a8f5396522f2cfeea5554019d55237e338209c
parent0b5b044d1c75ca5a4ffc21a15137057918a8dd1a
perf intel-pt: Fix MTC timestamp calculation for large MTC periods

commit 3bccbe20f6d188ce7b00326e776b745cfd35b10a upstream.

The MTC packet provides a 8-bit slice of CTC which is related to TSC by
the TMA packet, however the TMA packet only provides the lower 16 bits
of CTC.  If mtc_shift > 8 then some of the MTC bits are not in the CTC
provided by the TMA packet. Fix-up the last_mtc calculated from the TMA
packet by copying the missing bits from the current MTC assuming the
least difference between the two, and that the current MTC comes after
last_mtc.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1475062896-22274-2-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c