[0/7] btrace: Intel PT event tracing support

Message ID 20240902114949.918485-1-felix.willgerodt@intel.com
Headers
Series btrace: Intel PT event tracing support |

Message

Felix Willgerodt Sept. 2, 2024, 11:49 a.m. UTC
  Newer Intel CPUs add support for recording certain asynchronous events - like
interrupts or vmentry/vmexit - with Intel PT.  This series adds support
for recording and showing such events in GDB.  The feature is guarded by the
setting "set record btrace pt event-tracing".  It is based on the same
auxiliary instructions infrastructure as the recently added PTWRITE support.
Therefore events will be displayed during "record instruction-history",
"record function-call-history", when stepping through a recording, and in
python.

Felix Willgerodt (7):
  btrace: Print "non-contiguous" for gaps.
  btrace: Add printing support for cfe and evd packets.
  btrace: Enable event tracing on Linux for Intel PT.
  btrace: Add support for interrupt events.
  btrace: Add support for IRET events.
  btrace: Add support for further events.
  btrace: Add support for UINTR and UIRET events.

 gdb/btrace.c                                  | 274 +++++++++++++++++-
 gdb/btrace.h                                  |   8 +-
 gdb/doc/gdb.texinfo                           |  41 ++-
 gdb/features/btrace-conf.dtd                  |   1 +
 gdb/nat/linux-btrace.c                        |  11 +
 gdb/record-btrace.c                           |  44 +++
 gdb/remote.c                                  |  50 +++-
 gdb/testsuite/gdb.btrace/event-tracing-gap.c  |  34 +++
 .../gdb.btrace/event-tracing-gap.exp          |  77 +++++
 gdb/testsuite/gdb.btrace/event-tracing.exp    |  57 ++++
 gdb/testsuite/gdb.btrace/null-deref.c         |  34 +++
 gdb/testsuite/gdb.btrace/uli.c                | 132 +++++++++
 gdb/testsuite/gdb.btrace/uli_events.exp       |  51 ++++
 gdb/testsuite/lib/gdb.exp                     |  55 ++++
 gdbserver/linux-low.cc                        |   2 +
 gdbserver/server.cc                           |  14 +
 gdbsupport/btrace-common.h                    |   3 +
 17 files changed, 874 insertions(+), 14 deletions(-)
 create mode 100644 gdb/testsuite/gdb.btrace/event-tracing-gap.c
 create mode 100644 gdb/testsuite/gdb.btrace/event-tracing-gap.exp
 create mode 100644 gdb/testsuite/gdb.btrace/event-tracing.exp
 create mode 100644 gdb/testsuite/gdb.btrace/null-deref.c
 create mode 100644 gdb/testsuite/gdb.btrace/uli.c
 create mode 100644 gdb/testsuite/gdb.btrace/uli_events.exp