libipt, time: fix TMA handling for low MTC frequencies

When the MTC frequency is low, TMA does not provide the full CTC value.  We
estimate a CTC value based on the TMA's CTC field size.

The current version assumes that TMA does not provide any bits in the MTC range.
This is wrong.  The TMA may provide some but not all bits that an MTC would
provide.

Generalize it by filling in the missing bits when processing the next MTC.  This
assumes that we're not dropping MTC packets around TMA.  At least not more than
TMA provides bits for.

Change-Id: I0ee8c83b674fb12a9e10cb5736c8daab3c9f6870
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
4 files changed