* [PATCH v3] gdb, btrace: support libipt v2.2 events
@ 2026-05-04 14:08 Markus Metzger
0 siblings, 0 replies; only message in thread
From: Markus Metzger @ 2026-05-04 14:08 UTC (permalink / raw)
To: gdb-patches; +Cc: Keith Seitz, Eli Zaretskii
Add support for printing new events added in libipt v2.2 originating from
Event Tracing in combination with Flexible Return and Event Delivery
(FRED) and from Trigger Tracing.
Reviewed-By: Keith Seitz <keiths@redhat.com>
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
---
gdb/NEWS | 3 +++
gdb/btrace.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 70 insertions(+)
diff --git a/gdb/NEWS b/gdb/NEWS
index e233906153a..4464135ef71 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -75,6 +75,9 @@
* The Windows native target now supports scheduler-locking. E.g.,
"set scheduler-locking on" now works. Previously it gave an error.
+* GDB now supports libipt v2.2 events originating from Event Tracing on a
+ FRED-enabled system and from Trigger Tracing.
+
* New targets
GNU/Linux/MicroBlaze (gdbserver) microblazeel-*linux*
diff --git a/gdb/btrace.c b/gdb/btrace.c
index 965e2654c7d..73b7fc313b7 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -1597,6 +1597,59 @@ handle_pt_insn_events (struct btrace_thread_info *btinfo,
break;
}
#endif /* (LIBIPT_VERSION >= 0x201) */
+
+#if (LIBIPT_VERSION >= 0x202)
+ case ptev_trig:
+ {
+ std::string aux_string = std::string (_("trig: trbv = "))
+ + hex_string (event.variant.trig.trbv);
+
+ if (event.variant.trig.mult != 0)
+ aux_string += std::string (", mult");
+
+ if (event.ip_suppressed == 0)
+ {
+ pc = event.variant.trig.ip;
+ aux_string += std::string (", ip = ") + hex_string (*pc);
+ }
+
+ if (event.variant.trig.icnt != 0)
+ aux_string += std::string (", icnt = ")
+ + hex_string (event.variant.trig.icnt);
+
+ handle_pt_aux_insn (btinfo, aux_string, pc);
+ break;
+ }
+
+ case ptev_swintr:
+ {
+ std::string aux_string = std::string (_("swintr: vector = "))
+ + hex_string (event.variant.swintr.vector);
+
+ if (event.ip_suppressed == 0)
+ {
+ pc = event.variant.swintr.ip;
+ aux_string += std::string (", ip = ") + hex_string (*pc);
+ }
+
+ handle_pt_aux_insn (btinfo, aux_string, pc);
+ break;
+ }
+
+ case ptev_syscall:
+ {
+ std::string aux_string = std::string (_("syscall"));
+
+ if (event.ip_suppressed == 0)
+ {
+ pc = event.variant.syscall.ip;
+ aux_string += std::string (": ip = ") + hex_string (*pc);
+ }
+
+ handle_pt_aux_insn (btinfo, aux_string, pc);
+ break;
+ }
+#endif /* (LIBIPT_VERSION >= 0x202) */
}
}
#endif /* defined (HAVE_PT_INSN_EVENT) */
@@ -3025,6 +3078,20 @@ pt_print_packet (const struct pt_packet *packet)
packet->payload.evd.payload);
break;
#endif /* (LIBIPT_VERSION >= 0x201) */
+
+#if (LIBIPT_VERSION >= 0x202)
+ case ppt_trig:
+ if (packet->payload.trig.icntv == 0)
+ gdb_printf ("trig 0x%x%s%s", packet->payload.trig.trbv,
+ packet->payload.trig.ip ? " ip" : "",
+ packet->payload.trig.mult ? " mult" : "");
+ else
+ gdb_printf ("trig 0x%x%s%s icnt: %u", packet->payload.trig.trbv,
+ packet->payload.trig.ip ? " ip" : "",
+ packet->payload.trig.mult ? " mult" : "",
+ packet->payload.trig.icnt);
+ break;
+#endif /* (LIBIPT_VERSION >= 0x202) */
}
}
--
2.34.1
Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-04 14:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-04 14:08 [PATCH v3] gdb, btrace: support libipt v2.2 events Markus Metzger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox