libipt: add a call/return stack abstraction

Add a struct pt_retstack to model the call/return stack used for
return compression.

Change-Id: Iad102dc84f39b96017e02cb4d593dbc0fd44c058
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
libipt: add a section abstraction

Add struct pt_section to represent a contiguous chunk of memory loaded
as-is from a file.

Change-Id: I5c282aa513d944136c1b1e36d6dd36b28847835c
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
libipt: add an image abstraction

Add struct pt_image to represent a process image as a collection of
sections.

Change-Id: I775482d91b41f3dccdbd5045f6ed175868c0f028
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
libipt: add a light-weight instruction decoder

Add the initial version of an instruction length decoder (ild) and a
mini-instruction-decoder.

Both have been written by Mark Charney <mark.charney@intel.com>.

Change-Id: I73febd12d19dda8781976e707a3bfbc6268441bc
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
libipt: instruction flow reconstruction

Add support for reconstructing the execution flow.

This is still work-in-progress since we do not yet support paging or
side-band information.  We provide roughly the same functionality that
we provided in ptxed now within libipt.

There had been some improvements with respect to tracing disable.

Change-Id: I1c8e680137274ab9af45f9da60a8e2ee72e0dd3e
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
ptxed: use libipt for execution flow reconstruction

This is essentially a re-write of ptxed using the new interface for
execution flow reconstruction.

Adjust tests to account for the differences in event reporting.

Add tests in areas where the new ptxed improved.

Change-Id: I61059cf8a2d206db017a10e6b842fd18f0d1765b
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
version: bump minor version number

Changes:
  - libipt can now be used from C++ source files
  - support for reconstructing the execution flow has been moved from
    ptxed into libipt
  - ptxed has been re-written
  - ptxed now accepts multiple --raw and --elf options
  - ptxed now requires --pt before any --raw or --elf options
  - new ptxed options:
    --quiet   do not print anything (except errors)
    --stat    print statistics (even when quiet)
  - ptxed option changes:
    --pt now takes an optional offset argument
    --elf now takes an optional base argument
    --raw now has file and base encoded in a single argument
  - bug-fixes

Change-Id: Ia7b28dae30cf868afb03bd4109f423da5d5d1e93
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>