Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 2 OF 2] extend tsave to write start and stop time into a trace file
@ 2013-06-10 13:08 Dmitry Kozlov
  2013-06-10 13:11 ` Hui Zhu
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Kozlov @ 2013-06-10 13:08 UTC (permalink / raw)
  To: gdb-patches, Pedro Alves; +Cc: Vladimir Prus

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

Hi Pedro,
some time ago we already discussed these patches, could you please 
review them again.

And this one extends tsave command to write start and stop time into a 
tracefile.


Thank you,
Dmitry


[-- Attachment #2: gdb_1_of_2_tstatus.diff --]
[-- Type: text/x-patch, Size: 3720 bytes --]

commit 1182d791b8f8fcfd1098b1c9c1375c68fe86ffaf
Author: Dmitry Kozlov <dmitry_kozlov@mentor.com>
Date:   Fri Jun 7 18:22:29 2013 +0400

    	Fix trace-status to output proper start-time and stop-time.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 493da1d..561d93b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
+
+	Fix trace-status to output proper start-time and stop-time.
+	* tracepoint.c (trace_status_command): Fix type of printf arg to
+	prevent improper type conversion.
+	(trace_status_mi): Likewise.
+
 2013-06-08  Pedro Alves  <pedro@codesourcery.com>
 	    Yao Qi  <yao@codesourcery.com>
 
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 604a414..772bdb8 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
+
+	Fix trace-status to output proper start-time and stop-time.
+	* gdbserver/tracepoint.c (cmd_qtstatus): Modify trace-status output to
+	output start time and stop time in hex as gdb expects.
+
 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	Fix compatibility with Android Bionic.
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index d237e7f..43f77bf 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -3663,7 +3663,8 @@ cmd_qtstatus (char *packet)
 	   free_space (), phex_nz (trace_buffer_hi - trace_buffer_lo, 0),
 	   circular_trace_buffer,
 	   disconnected_tracing,
-	   plongest (tracing_start_time), plongest (tracing_stop_time),
+	   phex_nz (tracing_start_time, sizeof (tracing_start_time)),
+	   phex_nz (tracing_stop_time, sizeof (tracing_stop_time)),
 	   buf1, buf2);
 }
 
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 5bad3e8..38362b4 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2049,20 +2049,20 @@ trace_status_command (char *args, int from_tty)
 
 	  /* Reporting a run time is more readable than two long numbers.  */
 	  printf_filtered (_("Trace started at %ld.%06ld secs, stopped %ld.%06ld secs later.\n"),
-			   (long int) ts->start_time / 1000000,
-			   (long int) ts->start_time % 1000000,
-			   (long int) run_time / 1000000,
-			   (long int) run_time % 1000000);
+			   (long int) (ts->start_time / 1000000),
+			   (long int) (ts->start_time % 1000000),
+			   (long int) (run_time / 1000000),
+			   (long int) (run_time % 1000000));
 	}
       else
 	printf_filtered (_("Trace started at %ld.%06ld secs.\n"),
-			 (long int) ts->start_time / 1000000,
-			 (long int) ts->start_time % 1000000);
+			 (long int) (ts->start_time / 1000000),
+			 (long int) (ts->start_time % 1000000));
     }
   else if (ts->stop_time)
     printf_filtered (_("Trace stopped at %ld.%06ld secs.\n"),
-		     (long int) ts->stop_time / 1000000,
-		     (long int) ts->stop_time % 1000000);
+		     (long int) (ts->stop_time / 1000000),
+		     (long int) (ts->stop_time % 1000000));
 
   /* Now report any per-tracepoint status available.  */
   tp_vec = all_tracepoints ();
@@ -2180,12 +2180,12 @@ trace_status_mi (int on_stop)
     char buf[100];
 
     xsnprintf (buf, sizeof buf, "%ld.%06ld",
-	       (long int) ts->start_time / 1000000,
-	       (long int) ts->start_time % 1000000);
+	       (long int) (ts->start_time / 1000000),
+	       (long int) (ts->start_time % 1000000));
     ui_out_field_string (uiout, "start-time", buf);
     xsnprintf (buf, sizeof buf, "%ld.%06ld",
-	       (long int) ts->stop_time / 1000000,
-	       (long int) ts->stop_time % 1000000);
+	       (long int) (ts->stop_time / 1000000),
+	       (long int) (ts->stop_time % 1000000));
     ui_out_field_string (uiout, "stop-time", buf);
   }
 }


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-20 14:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10 13:08 [PATCH 2 OF 2] extend tsave to write start and stop time into a trace file Dmitry Kozlov
2013-06-10 13:11 ` Hui Zhu
2013-06-10 14:21   ` Dmitry Kozlov
2013-06-20  0:41     ` Stan Shebs
2013-06-20 15:18     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox