From: Dmitry Kozlov <dmitry_kozlov@mentor.com>
To: <gdb-patches@sourceware.org>, Pedro Alves <palves@redhat.com>
Cc: Vladimir Prus <vladimir@codesourcery.com>
Subject: [PATCH 2 OF 2] extend tsave to write start and stop time into a trace file
Date: Mon, 10 Jun 2013 13:08:00 -0000 [thread overview]
Message-ID: <51B5CAF5.3090101@mentor.com> (raw)
[-- 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);
}
}
next reply other threads:[~2013-06-10 12:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-10 13:08 Dmitry Kozlov [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51B5CAF5.3090101@mentor.com \
--to=dmitry_kozlov@mentor.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=vladimir@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox