This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Support for enabling/disabling tracepoints while a trace experiment is running


On 06/05/2011 11:32, Eli Zaretskii wrote:
> Btw, what if the target does not support this new feature?  Do we
> still disallow to start a trace experiment with no enabled
> tracepoints?  I think we should.
> 

I've now added 'EnableDisableTracepoints' to the list of features returned by
the qSupported packet from a patched gdbserver. GDB now checks whether this is
supported before trying to enable/disable a tracepoint on the target. If it is
not, then it silently reverts to the original behaviour.

Kwok

	gdb/
	* breakpoint.c (disable_breakpoint): Disable all locations
  	associated with a tracepoint on target if a trace experiment is
	running.
 	(disable_command): Disable a specific tracepoint location on target if
 	a trace	experiment is running.
 	(do_enable_breakpoint): Enable all locations associated with a
 	tracepoint on target if a trace experiment is running.
 	(enable_command) Enable a specific tracepoint location on target if a
 	trace experiment is running.
 	* target.c (update_current_target): Add INHERIT and de_fault clauses for
 	to_supports_enable_disable_tracepoint, to_enable_tracepoint and
	to_disable_tracepoint.
 	* target.h: Add declaration of struct bp_location.
 	(struct target_ops): Add new functions
	to_supports_enable_disable_tracepoint, to_enable_tracepoint and
 	to_disable_tracepoint to target operations.
	(target_supports_enable_disable_tracepoint): New macro.
 	(target_enable_tracepoint): New macro.
 	(target_disable_tracepoint): New macro.
 	* remote.c (struct remote_state): Add new field.
	(remote_enable_disable_tracepoint_feature): New.
	(remote_protocol_features): Add new entry.
	(remote_supports_enable_disable_tracepoint): New.
	(remote_enable_tracepoint): New.
 	(remote_disable_tracepoint): New.
 	(init_remote_ops): Add remote_enable_tracepoint,
	remote_disable_tracepoint and remote_supports_enable_disable_tracepoint
	to remote operations.
 	* tracepoint.c (start_tracing): Allow tracing to start without any
 	tracepoints enabled with just a warning if they can be re-enabled
	later.
 	* NEWS: Add news item for the new behaviour of the enable and disable
 	GDB commands when applied to tracepoints.
 	Add news items for the new remote packets QTEnable and QTDisable.

	gdb/doc/
	* gdb.texinfo: Document change in the behaviour of the enable and
	disable GDB commands when applied to tracepoints.
	Document the EnableDisableTracepoints remote stub feature.
	Document QTEnable and QTDisable in the list of tracepoint packets.

	gdb/gdbserver/
	* server.c (handle_query): Add EnableDisableTracepoints to the list
	of supported features.
	* tracepoint.c (clear_installed_tracepoints): Uninstall	disabled
	tracepoints.
 	(cmd_qtenable_disable): New.
 	(cmd_qtstart): Install tracepoints even if disabled.
 	(handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
 	receiving a QTEnable or QTDisable packet.
 	(gdb_collect): Skip data collection if fast tracepoint is disabled.
 	(ust_marker_to_static_tracepoint): Do not ignore disabled static
 	tracepoints.
 	(gdb_probe): Skip data collection if static tracepoint is disabled.

Index: gdb/NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.437
diff -u -p -r1.437 NEWS
--- gdb/NEWS	6 May 2011 18:46:31 -0000	1.437
+++ gdb/NEWS	9 May 2011 19:17:10 -0000
@@ -21,6 +21,23 @@ watch EXPRESSION mask MASK_VALUE
   The watch command now supports the mask argument which allows creation
   of masked watchpoints, if the current architecture supports this feature.

+* Tracepoints can now be enabled and disabled at any time after a trace
+  experiment has been started using the standard "enable" and "disable"
+  commands.  It is now possible to start a trace experiment with no enabled
+  tracepoints; GDB will display a warning, but will allow the experiment to
+  begin, assuming that tracepoints will be enabled as needed while the trace
+  is running.
+
+* New remote packets
+
+QTEnable
+
+  Dynamically enable a tracepoint in a started trace experiment.
+
+QTDisable
+
+  Dynamically disable a tracepoint in a started trace experiment.
+
 *** Changes in GDB 7.3

 * GDB has a new command: "thread find [REGEXP]".
Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.575
diff -u -p -r1.575 breakpoint.c
--- gdb/breakpoint.c	6 May 2011 18:46:31 -0000	1.575
+++ gdb/breakpoint.c	9 May 2011 19:17:11 -0000
@@ -11685,6 +11685,15 @@ disable_breakpoint (struct breakpoint *b

   bpt->enable_state = bp_disabled;

+  if (target_supports_enable_disable_tracepoint ()
+      && current_trace_status ()->running && is_tracepoint (bpt))
+    {
+      struct bp_location *location;
+
+      for (location = bpt->loc; location; location = location->next)
+	target_disable_tracepoint (location);
+    }
+
   update_global_location_list (0);

   observer_notify_breakpoint_modified (bpt);
@@ -11714,7 +11723,13 @@ disable_command (char *args, int from_tt
     {
       struct bp_location *loc = find_location_by_number (args);
       if (loc)
-	loc->enabled = 0;
+	{
+	  loc->enabled = 0;
+	  if (target_supports_enable_disable_tracepoint ()
+	      && current_trace_status ()->running && loc->owner
+	      && is_tracepoint (loc->owner))
+	    target_disable_tracepoint (loc);
+	}
       update_global_location_list (0);
     }
   else
@@ -11762,6 +11777,16 @@ do_enable_breakpoint (struct breakpoint

   if (bpt->enable_state != bp_permanent)
     bpt->enable_state = bp_enabled;
+
+  if (target_supports_enable_disable_tracepoint ()
+      && current_trace_status ()->running && is_tracepoint (bpt))
+    {
+      struct bp_location *location;
+
+      for (location = bpt->loc; location; location = location->next)
+	target_enable_tracepoint (location);
+    }
+
   bpt->disposition = disposition;
   update_global_location_list (1);
   breakpoints_changed ();
@@ -11804,7 +11829,13 @@ enable_command (char *args, int from_tty
     {
       struct bp_location *loc = find_location_by_number (args);
       if (loc)
-	loc->enabled = 1;
+	{
+	  loc->enabled = 1;
+	  if (target_supports_enable_disable_tracepoint ()
+	      && current_trace_status ()->running && loc->owner
+	      && is_tracepoint (loc->owner))
+	    target_enable_tracepoint (loc);
+	}
       update_global_location_list (1);
     }
   else
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.445
diff -u -p -r1.445 remote.c
--- gdb/remote.c	27 Apr 2011 13:29:14 -0000	1.445
+++ gdb/remote.c	9 May 2011 19:17:12 -0000
@@ -329,6 +329,10 @@ struct remote_state
      disconnected.  */
   int disconnected_tracing;

+  /* True if the stub reports support for enabling and disabling
+     tracepoints while a trace experiment is running.  */
+  int enable_disable_tracepoints;
+
   /* Nonzero if the user has pressed Ctrl-C, but the target hasn't
      responded to that.  */
   int ctrlc_pending_p;
@@ -3689,6 +3693,16 @@ remote_disconnected_tracing_feature (con
   rs->disconnected_tracing = (support == PACKET_ENABLE);
 }

+static void
+remote_enable_disable_tracepoint_feature (const struct protocol_feature *feature,
+					  enum packet_support support,
+					  const char *value)
+{
+  struct remote_state *rs = get_remote_state ();
+
+  rs->enable_disable_tracepoints = (support == PACKET_ENABLE);
+}
+
 static struct protocol_feature remote_protocol_features[] = {
   { "PacketSize", PACKET_DISABLE, remote_packet_size, -1 },
   { "qXfer:auxv:read", PACKET_DISABLE, remote_supported_packet,
@@ -3735,6 +3749,8 @@ static struct protocol_feature remote_pr
     PACKET_TracepointSource },
   { "QAllow", PACKET_DISABLE, remote_supported_packet,
     PACKET_QAllow },
+  { "EnableDisableTracepoints", PACKET_DISABLE,
+    remote_enable_disable_tracepoint_feature, -1 },
 };

 static char *remote_support_xml;
@@ -9648,6 +9664,14 @@ remote_supports_static_tracepoints (void
   return rs->static_tracepoints;
 }

+static int
+remote_supports_enable_disable_tracepoint (void)
+{
+  struct remote_state *rs = get_remote_state ();
+
+  return rs->enable_disable_tracepoints;
+}
+
 static void
 remote_trace_init (void)
 {
@@ -9919,6 +9943,38 @@ remote_download_trace_state_variable (st
 }

 static void
+remote_enable_tracepoint (struct bp_location *location)
+{
+  struct remote_state *rs = get_remote_state ();
+  char addr_buf[40];
+
+  sprintf_vma (addr_buf, location->address);
+  sprintf (rs->buf, "QTEnable:%x:%s", location->owner->number, addr_buf);
+  putpkt (rs->buf);
+  remote_get_noisy_reply (&rs->buf, &rs->buf_size);
+  if (*rs->buf == '\0')
+    error (_("Target does not support enabling tracepoints while a trace run is
ongoing."));
+  if (strcmp (rs->buf, "OK") != 0)
+    error (_("Error on target while enabling tracepoint."));
+}
+
+static void
+remote_disable_tracepoint (struct bp_location *location)
+{
+  struct remote_state *rs = get_remote_state ();
+  char addr_buf[40];
+
+  sprintf_vma (addr_buf, location->address);
+  sprintf (rs->buf, "QTDisable:%x:%s", location->owner->number, addr_buf);
+  putpkt (rs->buf);
+  remote_get_noisy_reply (&rs->buf, &rs->buf_size);
+  if (*rs->buf == '\0')
+    error (_("Target does not support disabling tracepoints while a trace run
is ongoing."));
+  if (strcmp (rs->buf, "OK") != 0)
+    error (_("Error on target while disabling tracepoint."));
+}
+
+static void
 remote_trace_set_readonly_regions (void)
 {
   asection *s;
@@ -10308,10 +10364,13 @@ Specify the serial device it is connecte
   remote_ops.to_terminal_ours = remote_terminal_ours;
   remote_ops.to_supports_non_stop = remote_supports_non_stop;
   remote_ops.to_supports_multi_process = remote_supports_multi_process;
+  remote_ops.to_supports_enable_disable_tracepoint =
remote_supports_enable_disable_tracepoint;
   remote_ops.to_trace_init = remote_trace_init;
   remote_ops.to_download_tracepoint = remote_download_tracepoint;
   remote_ops.to_download_trace_state_variable
     = remote_download_trace_state_variable;
+  remote_ops.to_enable_tracepoint = remote_enable_tracepoint;
+  remote_ops.to_disable_tracepoint = remote_disable_tracepoint;
   remote_ops.to_trace_set_readonly_regions = remote_trace_set_readonly_regions;
   remote_ops.to_trace_start = remote_trace_start;
   remote_ops.to_get_trace_status = remote_get_trace_status;
Index: gdb/target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.282
diff -u -p -r1.282 target.c
--- gdb/target.c	6 May 2011 18:46:31 -0000	1.282
+++ gdb/target.c	9 May 2011 19:17:12 -0000
@@ -659,9 +659,12 @@ update_current_target (void)
       INHERIT (to_get_ada_task_ptid, t);
       /* Do not inherit to_search_memory.  */
       INHERIT (to_supports_multi_process, t);
+      INHERIT (to_supports_enable_disable_tracepoint, t);
       INHERIT (to_trace_init, t);
       INHERIT (to_download_tracepoint, t);
       INHERIT (to_download_trace_state_variable, t);
+      INHERIT (to_enable_tracepoint, t);
+      INHERIT (to_disable_tracepoint, t);
       INHERIT (to_trace_set_readonly_regions, t);
       INHERIT (to_trace_start, t);
       INHERIT (to_get_trace_status, t);
@@ -825,6 +828,9 @@ update_current_target (void)
   de_fault (to_supports_multi_process,
 	    (int (*) (void))
 	    return_zero);
+  de_fault (to_supports_enable_disable_tracepoint,
+	    (int (*) (void))
+	    return_zero);
   de_fault (to_trace_init,
 	    (void (*) (void))
 	    tcomplain);
@@ -834,6 +840,12 @@ update_current_target (void)
   de_fault (to_download_trace_state_variable,
 	    (void (*) (struct trace_state_variable *))
 	    tcomplain);
+  de_fault (to_enable_tracepoint,
+	    (void (*) (struct bp_location *))
+	    tcomplain);
+  de_fault (to_disable_tracepoint,
+	    (void (*) (struct bp_location *))
+	    tcomplain);
   de_fault (to_trace_set_readonly_regions,
 	    (void (*) (void))
 	    tcomplain);
Index: gdb/target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.205
diff -u -p -r1.205 target.h
--- gdb/target.h	6 May 2011 18:46:32 -0000	1.205
+++ gdb/target.h	9 May 2011 19:17:12 -0000
@@ -28,6 +28,7 @@ struct objfile;
 struct ui_file;
 struct mem_attrib;
 struct target_ops;
+struct bp_location;
 struct bp_target_info;
 struct regcache;
 struct target_section_table;
@@ -644,6 +645,10 @@ struct target_ops
        simultaneously?  */
     int (*to_supports_multi_process) (void);

+    /* Does this target support enabling and disabling tracepoints while a trace
+       experiment is running?  */
+    int (*to_supports_enable_disable_tracepoint) (void);
+
     /* Determine current architecture of thread PTID.

        The target is supposed to determine the architecture of the code where
@@ -674,6 +679,12 @@ struct target_ops
     /* Send full details of a trace state variable to the target.  */
     void (*to_download_trace_state_variable) (struct trace_state_variable *tsv);

+    /* Enable a tracepoint on the target.  */
+    void (*to_enable_tracepoint) (struct bp_location *location);
+
+    /* Disable a tracepoint on the target.  */
+    void (*to_disable_tracepoint) (struct bp_location *location);
+
     /* Inform the target info of memory regions that are readonly
        (such as text sections), and so it should return data from
        those rather than look in the trace buffer.  */
@@ -873,6 +884,12 @@ struct address_space *target_thread_addr
 #define	target_supports_multi_process()	\
      (*current_target.to_supports_multi_process) ()

+/* Returns true if this target can enable and disable tracepoints
+   while a trace experiment is running.  */
+
+#define target_supports_enable_disable_tracepoint() \
+  (*current_target.to_supports_enable_disable_tracepoint) ()
+
 /* Invalidate all target dcaches.  */
 extern void target_dcache_invalidate (void);

@@ -1457,6 +1474,12 @@ extern int target_search_memory (CORE_AD
 #define target_download_trace_state_variable(tsv) \
   (*current_target.to_download_trace_state_variable) (tsv)

+#define target_enable_tracepoint(loc) \
+  (*current_target.to_enable_tracepoint) (loc)
+
+#define target_disable_tracepoint(loc) \
+  (*current_target.to_disable_tracepoint) (loc)
+
 #define target_trace_start() \
   (*current_target.to_trace_start) ()

Index: gdb/tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.222
diff -u -p -r1.222 tracepoint.c
--- gdb/tracepoint.c	19 Apr 2011 18:04:07 -0000	1.222
+++ gdb/tracepoint.c	9 May 2011 19:17:13 -0000
@@ -1583,11 +1583,17 @@ start_tracing (void)
 		 (t->type == bp_fast_tracepoint ? "fast " : ""), t->number);
     }

-  /* No point in tracing with only disabled tracepoints.  */
   if (!any_enabled)
     {
-      VEC_free (breakpoint_p, tp_vec);
-      error (_("No tracepoints enabled, not starting trace"));
+      if (target_supports_enable_disable_tracepoint ())
+	warning (_("No tracepoints enabled"));
+      else
+	{
+	  /* No point in tracing with only disabled tracepoints that
+	     cannot be re-enabled.  */
+	  VEC_free (breakpoint_p, tp_vec);
+	  error (_("No tracepoints enabled, not starting trace"));
+	}
     }

   if (num_to_download <= 0)
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.830
diff -u -p -r1.830 gdb.texinfo
--- gdb/doc/gdb.texinfo	6 May 2011 18:46:33 -0000	1.830
+++ gdb/doc/gdb.texinfo	9 May 2011 19:17:16 -0000
@@ -10026,14 +10026,20 @@ These commands are deprecated; they are
 @item disable tracepoint @r{[}@var{num}@r{]}
 Disable tracepoint @var{num}, or all tracepoints if no argument
 @var{num} is given.  A disabled tracepoint will have no effect during
-the next trace experiment, but it is not forgotten.  You can re-enable
+a trace experiment, but it is not forgotten.  You can re-enable
 a disabled tracepoint using the @code{enable tracepoint} command.
+If the command is issued during a trace experiment and the debug target
+has support for disabling tracepoints during a trace experiment, then the
+change will be effective immediately.  Otherwise, it will be applied to the
+next trace experiment.

 @kindex enable tracepoint
 @item enable tracepoint @r{[}@var{num}@r{]}
-Enable tracepoint @var{num}, or all tracepoints.  The enabled
-tracepoints will become effective the next time a trace experiment is
-run.
+Enable tracepoint @var{num}, or all tracepoints.  If this command is
+issued during a trace experiment and the debug target supports enabling
+tracepoints during a trace experiment, then the enabled tracepoints will
+become effective immediately.  Otherwise, they will become effective the
+next time a trace experiment is run.
 @end table

 @node Tracepoint Passcounts
@@ -33622,6 +33628,11 @@ These are the currently defined stub fea
 @tab @samp{-}
 @tab No

+@item @samp{EnableDisableTracepoints}
+@tab No
+@tab @samp{-}
+@tab No
+
 @end multitable

 These are the currently defined stub features, in more detail:
@@ -33734,6 +33745,11 @@ The remote stub understands the @samp{QA
 @cindex static tracepoints, in remote protocol
 The remote stub supports static tracepoints.

+@item EnableDisableTracepoints
+The remote stub supports the @samp{QTEnable} (@pxref{QTEnable}) and
+@samp{QTDisable} (@pxref{QTDisable}) packets that allow tracepoints
+to be enabled and disabled while a trace experiment is running.
+
 @end table

 @item qSymbol::
@@ -33814,6 +33830,8 @@ packets.)
 @item qTsV
 @itemx QTStart
 @itemx QTStop
+@itemx QTEnable
+@itemx QTDisable
 @itemx QTinit
 @itemx QTro
 @itemx qTStatus
@@ -34303,6 +34321,18 @@ instruction reply packet}).
 @item QTStop
 End the tracepoint experiment.  Stop collecting trace frames.

+@item QTEnable:@var{n}:@var{addr}
+@anchor{QTEnable}
+Enable tracepoint @var{n} at address @var{addr} in a started tracepoint
+experiment.  If the tracepoint was previously disabled, then collection
+of data from it will resume.
+
+@item QTDisable:@var{n}:@var{addr}
+@anchor{QTDisable}
+Disable tracepoint @var{n} at address @var{addr} in a started tracepoint
+experiment.  No more data will be collected from the tracepoint unless
+@samp{QTEnable:@var{n}:@var{addr}} is subsequently issued.
+
 @item QTinit
 Clear the table of tracepoints, and empty the trace frame buffer.

Index: gdb/gdbserver/server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.144
diff -u -p -r1.144 server.c
--- gdb/gdbserver/server.c	4 May 2011 20:20:12 -0000	1.144
+++ gdb/gdbserver/server.c	9 May 2011 19:17:17 -0000
@@ -1540,6 +1540,7 @@ handle_query (char *own_buf, int packet_
 	  strcat (own_buf, ";StaticTracepoints+");
 	  strcat (own_buf, ";qXfer:statictrace:read+");
 	  strcat (own_buf, ";qXfer:traceframe-info:read+");
+	  strcat (own_buf, ";EnableDisableTracepoints+");
 	}

       return;
Index: gdb/gdbserver/tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/tracepoint.c,v
retrieving revision 1.24
diff -u -p -r1.24 tracepoint.c
--- gdb/gdbserver/tracepoint.c	10 Mar 2011 20:21:14 -0000	1.24
+++ gdb/gdbserver/tracepoint.c	9 May 2011 19:17:17 -0000
@@ -2214,9 +2214,6 @@ clear_installed_tracepoints (void)
   /* Restore any bytes overwritten by tracepoints.  */
   for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
     {
-      if (!tpoint->enabled)
-	continue;
-
       /* Catch the case where we might try to remove a tracepoint that
 	 was never actually installed.  */
       if (tpoint->handle == NULL)
@@ -2455,6 +2452,73 @@ cmd_qtdv (char *own_buf)
 }

 static void
+cmd_qtenable_disable (char *own_buf, int enable)
+{
+  char *packet = own_buf;
+  ULONGEST num, addr;
+  struct tracepoint *tp;
+
+  packet += strlen (enable ? "QTEnable:" : "QTDisable:");
+  packet = unpack_varlen_hex (packet, &num);
+  ++packet; /* skip a colon */
+  packet = unpack_varlen_hex (packet, &addr);
+
+  tp = find_tracepoint (num, addr);
+
+  if (tp)
+    {
+      if ((enable && tp->enabled) || (!enable && !tp->enabled))
+	{
+	  trace_debug ("Tracepoint %d at 0x%s is already %s",
+		       (int) num, paddress (addr),
+		       enable ? "enabled" : "disabled");
+	  write_ok (own_buf);
+	  return;
+	}
+
+      trace_debug ("%s tracepoint %d at 0x%s",
+		   enable ? "Enabling" : "Disabling",
+		   (int) num, paddress (addr));
+
+      tp->enabled = enable;
+
+      if (tp->type == fast_tracepoint || tp->type == static_tracepoint)
+	{
+	  int ret;
+	  int offset = offsetof (struct tracepoint, enabled);
+	  CORE_ADDR obj_addr = tp->obj_addr_on_target + offset;
+
+	  ret = prepare_to_access_memory ();
+	  if (ret)
+	    {
+	      trace_debug ("Failed to temporarily stop inferior threads");
+	      write_enn (own_buf);
+	      return;
+	    }
+	
+	  ret = write_inferior_integer (obj_addr, enable);
+	  done_accessing_memory ();
+	
+	  if (ret)
+	    {
+	      trace_debug ("Cannot write enabled flag into "
+			   "inferior process memory");
+	      write_enn (own_buf);
+	      return;
+	    }
+	}
+
+      write_ok (own_buf);
+    }
+  else
+    {
+      trace_debug ("Tracepoint %d at 0x%s not found",
+		   (int) num, paddress (addr));
+      write_enn (own_buf);
+    }
+}
+
+static void
 cmd_qtv (char *own_buf)
 {
   ULONGEST num;
@@ -2719,9 +2783,6 @@ cmd_qtstart (char *packet)
       /* Ensure all the hit counts start at zero.  */
       tpoint->hit_count = 0;

-      if (!tpoint->enabled)
-	continue;
-
       if (tpoint->type == trap_tracepoint)
 	{
 	  ++slow_tracepoint_count;
@@ -3461,6 +3522,16 @@ handle_tracepoint_general_set (char *pac
       cmd_qtdpsrc (packet);
       return 1;
     }
+  else if (strncmp ("QTEnable:", packet, strlen ("QTEnable:")) == 0)
+    {
+      cmd_qtenable_disable (packet, 1);
+      return 1;
+    }
+  else if (strncmp ("QTDisable:", packet, strlen ("QTDisable:")) == 0)
+    {
+      cmd_qtenable_disable (packet, 0);
+      return 1;
+    }
   else if (strncmp ("QTDV:", packet, strlen ("QTDV:")) == 0)
     {
       cmd_qtdv (packet);
@@ -5340,6 +5411,9 @@ gdb_collect (struct tracepoint *tpoint,
   if (!tracing)
     return;

+  if (!tpoint->enabled)
+    return;
+
   ctx.base.type = fast_tracepoint;
   ctx.regs = regs;
   ctx.regcache_initted = 0;
@@ -6598,7 +6672,7 @@ ust_marker_to_static_tracepoint (const s

   for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
     {
-      if (!tpoint->enabled || tpoint->type != static_tracepoint)
+      if (tpoint->type != static_tracepoint)
 	continue;

       if (tpoint->address == (uintptr_t) mdata->location)
@@ -6653,6 +6727,12 @@ gdb_probe (const struct marker *mdata, v
       return;
     }

+  if (!tpoint->enabled)
+    {
+      trace_debug ("gdb_probe: tracepoint disabled");
+      return;
+    }
+
   ctx.tpoint = tpoint;

   trace_debug ("gdb_probe: collecting marker: "


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]