Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Extend tsave: save start time, stop time, user and notes
@ 2012-10-03 14:09 Dmitry Kozlov
  2012-10-08 12:48 ` Yao Qi
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Kozlov @ 2012-10-03 14:09 UTC (permalink / raw)
  To: gdb-patches; +Cc: 'Stan_Shebs@mentor.com', Vladimir Prus

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

Hi,
This patch extends tsave command to save some extra trace status 
information: start time, stop time, user and notes.
Please consider applying it.

Thank you,
Dmitry

[-- Attachment #2: gdb_tsave.txt --]
[-- Type: text/plain, Size: 1219 bytes --]

2012-10-03  Dmitry Kozlov  <ddk@mentor.com>
 
	* tracepoint.c (trace_save): Add saving starttime, stoptime, user and notes.
 
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 0f94150..f7e96eb 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -3036,6 +3036,24 @@ trace_save (const char *filename, int target_does_save)
     fprintf (fp, ";disconn:%x", ts->disconnected_tracing);
   if (ts->circular_buffer)
     fprintf (fp, ";circular:%x", ts->circular_buffer);
+  if (ts->start_time)
+    fprintf (fp, ";starttime:%ld%06ld", (long int) (ts->start_time / 1000000), (long int) (ts->start_time % 1000000));
+  if (ts->stop_time)
+    fprintf (fp, ";stoptime:%ld%06ld", (long int) (ts->stop_time / 1000000), (long int) (ts->stop_time % 1000000));
+  if (ts->notes)
+  {
+    char *buf = (char *) alloca (strlen (ts->notes) * 2 + 1);
+    bin2hex ((gdb_byte *) ts->notes, buf, 0);
+    fprintf (fp, ";notes:%s", buf);
+
+  }
+  if (ts->user_name)
+  {
+    char *buf = (char *) alloca (strlen (ts->user_name) * 2 + 1);
+    bin2hex ((gdb_byte *) ts->user_name, buf, 0);
+    fprintf (fp, ";username:%s", buf);
+
+  }
   fprintf (fp, "\n");
 
   /* Note that we want to upload tracepoints and save those, rather

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

end of thread, other threads:[~2012-10-16 16:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-03 14:09 [PATCH] Extend tsave: save start time, stop time, user and notes Dmitry Kozlov
2012-10-08 12:48 ` Yao Qi
2012-10-08 19:14   ` Dmitry Kozlov
2012-10-11 15:53   ` Dmitry Kozlov
2012-10-11 17:10     ` Pedro Alves
2012-10-12  8:44       ` Dmitry Kozlov
2012-10-12  8:46       ` Dmitry Kozlov
2012-10-16 16:36         ` Pedro Alves

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