[v2,1/6] btrace: Print "non-contiguous" for gaps.

Message ID 20240913125722.2145486-2-felix.willgerodt@intel.com
State New
Headers
Series btrace: Intel PT event tracing support |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Felix Willgerodt Sept. 13, 2024, 12:57 p.m. UTC
  So far we printed "disabled" for gaps, when we saw a ptev_enabled event that
doesn't have the resumed flag set.  This is wrong, as the actual disabling
happens with ptev_disabled.  So far this didn't matter, but once we have event
tracing, there can be events between a ptev_disabled and a ptev_enabled.
This patch is in preparation for that, and removes the disabled reason in
favour of a more accurate non-contiguous reason, and adjusts the string we
print accordingly.
---
 gdb/btrace.c | 8 ++++----
 gdb/btrace.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gdb/btrace.c b/gdb/btrace.c
index ff9612dd664..9dc0c5cc930 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -1255,7 +1255,7 @@  handle_pt_insn_events (struct btrace_thread_info *btinfo,
 		&& !btinfo->functions.empty ())
 	      {
 		struct btrace_function *bfun
-		  = ftrace_new_gap (btinfo, BDE_PT_DISABLED, gaps);
+		  = ftrace_new_gap (btinfo, BDE_PT_NON_CONTIGUOUS, gaps);
 
 		pt_insn_get_offset (decoder, &offset);
 
@@ -1359,7 +1359,7 @@  handle_pt_insn_event_flags (struct btrace_thread_info *btinfo,
       struct btrace_function *bfun;
       uint64_t offset;
 
-      bfun = ftrace_new_gap (btinfo, BDE_PT_DISABLED, gaps);
+      bfun = ftrace_new_gap (btinfo, BDE_PT_NON_CONTIGUOUS, gaps);
 
       pt_insn_get_offset (decoder, &offset);
 
@@ -1966,8 +1966,8 @@  btrace_decode_error (enum btrace_format format, int errcode)
 	case BDE_PT_USER_QUIT:
 	  return _("trace decode cancelled");
 
-	case BDE_PT_DISABLED:
-	  return _("disabled");
+	case BDE_PT_NON_CONTIGUOUS:
+	  return _("non-contiguous");
 
 	case BDE_PT_OVERFLOW:
 	  return _("overflow");
diff --git a/gdb/btrace.h b/gdb/btrace.h
index 75bc4f81ee4..8a81426b082 100644
--- a/gdb/btrace.h
+++ b/gdb/btrace.h
@@ -131,7 +131,7 @@  enum btrace_pt_error
   BDE_PT_USER_QUIT = 1,
 
   /* Tracing was temporarily disabled.  */
-  BDE_PT_DISABLED,
+  BDE_PT_NON_CONTIGUOUS,
 
   /* Trace recording overflowed.  */
   BDE_PT_OVERFLOW