* [PATCH v5] gdb, btrace: support libipt v2.2 events
@ 2026-05-06 7:26 Markus Metzger
2026-05-18 14:53 ` Metzger, Markus T
0 siblings, 1 reply; 2+ messages in thread
From: Markus Metzger @ 2026-05-06 7:26 UTC (permalink / raw)
To: gdb-patches; +Cc: Keith Seitz, Eli Zaretskii, Tom Tromey
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>
CC: Tom Tromey <tom@tromey.com>
---
gdb/NEWS | 4 +++
gdb/btrace.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+)
diff --git a/gdb/NEWS b/gdb/NEWS
index 480e1854002..573f285a73d 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -78,6 +78,10 @@
* The Windows native target now supports non-stop mode. This feature
requires Windows 10 or later.
+* GDB now supports libipt v2.2 events originating from Event Tracing (set
+ record btrace pt event-tracing on) 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..5349a89001a 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -1597,6 +1597,61 @@ 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 +3080,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 != 0) ? " ip" : "",
+ (packet->payload.trig.mult != 0) ? " mult" : "");
+ else
+ gdb_printf ("trig 0x%x%s%s icnt: %u", packet->payload.trig.trbv,
+ (packet->payload.trig.ip != 0) ? " ip" : "",
+ (packet->payload.trig.mult != 0) ? " 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] 2+ messages in thread
* RE: [PATCH v5] gdb, btrace: support libipt v2.2 events
2026-05-06 7:26 [PATCH v5] gdb, btrace: support libipt v2.2 events Markus Metzger
@ 2026-05-18 14:53 ` Metzger, Markus T
0 siblings, 0 replies; 2+ messages in thread
From: Metzger, Markus T @ 2026-05-18 14:53 UTC (permalink / raw)
To: gdb-patches; +Cc: Keith Seitz, Eli Zaretskii, Tom Tromey
Hello,
>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>
>CC: Tom Tromey <tom@tromey.com>
I plan to push this later this week if there is no further review feedback.
Regards,
Markus.
>---
> gdb/NEWS | 4 +++
> gdb/btrace.c | 69
>++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 73 insertions(+)
>
>diff --git a/gdb/NEWS b/gdb/NEWS
>index 480e1854002..573f285a73d 100644
>--- a/gdb/NEWS
>+++ b/gdb/NEWS
>@@ -78,6 +78,10 @@
> * The Windows native target now supports non-stop mode. This feature
> requires Windows 10 or later.
>
>+* GDB now supports libipt v2.2 events originating from Event Tracing (set
>+ record btrace pt event-tracing on) 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..5349a89001a 100644
>--- a/gdb/btrace.c
>+++ b/gdb/btrace.c
>@@ -1597,6 +1597,61 @@ 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 +3080,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 != 0) ? " ip" : "",
>+ (packet->payload.trig.mult != 0) ? " mult" : "");
>+ else
>+ gdb_printf ("trig 0x%x%s%s icnt: %u", packet->payload.trig.trbv,
>+ (packet->payload.trig.ip != 0) ? " ip" : "",
>+ (packet->payload.trig.mult != 0) ? " 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] 2+ messages in thread
end of thread, other threads:[~2026-05-18 14:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-06 7:26 [PATCH v5] gdb, btrace: support libipt v2.2 events Markus Metzger
2026-05-18 14:53 ` Metzger, Markus T
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox