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

* Re: [PATCH 2 OF 2] extend tsave to write start and stop time into a trace file
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Hui Zhu @ 2013-06-10 13:11 UTC (permalink / raw)
  To: Dmitry Kozlov; +Cc: gdb-patches, Pedro Alves, Vladimir Prus

On Mon, Jun 10, 2013 at 8:47 PM, Dmitry Kozlov <dmitry_kozlov@mentor.com> wrote:
> 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
>
This patch gdb_1_of_2_tstatus.diff is not the right one?

Thanks,
Hui


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

* Re: [PATCH 2 OF 2] extend tsave to write start and stop time into a trace file
  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
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Kozlov @ 2013-06-10 14:21 UTC (permalink / raw)
  To: Hui Zhu; +Cc: gdb-patches, Pedro Alves, Vladimir Prus

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

On 06/10/2013 05:08 PM, Hui Zhu wrote:
> On Mon, Jun 10, 2013 at 8:47 PM, Dmitry Kozlov <dmitry_kozlov@mentor.com> wrote:
>> 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
>>
> This patch gdb_1_of_2_tstatus.diff is not the right one?
Sure, proper attached. Thank you!
> Thanks,
> Hui


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

commit 47fa5083c22982ea135156ac8c2e67d222190781
Author: Dmitry Kozlov <dmitry_kozlov@mentor.com>
Date:   Mon Jun 10 16:30:49 2013 +0400

    	Extend tsave to save starttime, stoptime.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 561d93b..c775e34 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
 
+	* tracepoint.c (trace_save): Extend tsave to save starttime, stoptime.
+
+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.
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 38362b4..6af88f5 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -3138,6 +3138,16 @@ tfile_write_status (struct trace_file_writer *self,
     fprintf (writer->fp, ";disconn:%x", ts->disconnected_tracing);
   if (ts->circular_buffer)
     fprintf (writer->fp, ";circular:%x", ts->circular_buffer);
+  if (ts->start_time)
+    {
+      fprintf (writer->fp, ";starttime:%s",
+      phex_nz (ts->start_time, sizeof (ts->start_time)));
+    }
+  if (ts->stop_time)
+    {
+      fprintf (writer->fp, ";stoptime:%s",
+      phex_nz (ts->stop_time, sizeof (ts->stop_time)));
+    }
   if (ts->notes != NULL)
     {
       char *buf = (char *) alloca (strlen (ts->notes) * 2 + 1);

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

* Re: [PATCH 2 OF 2] extend tsave to write start and stop time into a trace file
  2013-06-10 14:21   ` Dmitry Kozlov
@ 2013-06-20  0:41     ` Stan Shebs
  2013-06-20 15:18     ` Pedro Alves
  1 sibling, 0 replies; 5+ messages in thread
From: Stan Shebs @ 2013-06-20  0:41 UTC (permalink / raw)
  To: gdb-patches

On 6/10/13 6:11 AM, Dmitry Kozlov wrote:
> On 06/10/2013 05:08 PM, Hui Zhu wrote:
>> On Mon, Jun 10, 2013 at 8:47 PM, Dmitry Kozlov
>> <dmitry_kozlov@mentor.com> wrote:
>>> 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.


+      fprintf (writer->fp, ";starttime:%s",
+      phex_nz (ts->start_time, sizeof (ts->start_time)));

Please doublechecking the indent before committing, it doesn't look
right in the patch.

Otherwise, it's fine to commit, and thanks!

Stan
stan@codesourcery.com


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

* Re: [PATCH 2 OF 2] extend tsave to write start and stop time into a trace file
  2013-06-10 14:21   ` Dmitry Kozlov
  2013-06-20  0:41     ` Stan Shebs
@ 2013-06-20 15:18     ` Pedro Alves
  1 sibling, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2013-06-20 15:18 UTC (permalink / raw)
  To: Dmitry Kozlov; +Cc: Hui Zhu, gdb-patches, Vladimir Prus

On 06/10/2013 02:11 PM, Dmitry Kozlov wrote:
> On 06/10/2013 05:08 PM, Hui Zhu wrote:
>> On Mon, Jun 10, 2013 at 8:47 PM, Dmitry Kozlov <dmitry_kozlov@mentor.com> wrote:
>>> Hi Pedro,
>>> some time ago we already discussed these patches, could you please review
>>> them again.

FWIW, this is fine with me as well.

I notice the "Trace File Format" node in the manual doesn't
document the "status", "tp" and "tsv" lines/blocks... :-/

-- 
Pedro Alves


^ 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