Sent timing stats to gdb_stdlog
This changes the time / space / symtab per-command statistics code to send its output to gdb_stdlog rather than gdb_stdout. This seems slightly more correct to me.
This commit is contained in:
parent
1475b18b77
commit
244ac24b51
1 changed files with 25 additions and 22 deletions
11
gdb/maint.c
11
gdb/maint.c
|
@ -990,7 +990,8 @@ scoped_command_stats::~scoped_command_stats ()
|
||||||
/* Subtract time spend in prompt_for_continue from walltime. */
|
/* Subtract time spend in prompt_for_continue from walltime. */
|
||||||
wall_time -= get_prompt_for_continue_wait_time ();
|
wall_time -= get_prompt_for_continue_wait_time ();
|
||||||
|
|
||||||
printf_unfiltered (!m_msg_type
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
|
!m_msg_type
|
||||||
? _("Startup time: %.6f (cpu), %.6f (wall)\n")
|
? _("Startup time: %.6f (cpu), %.6f (wall)\n")
|
||||||
: _("Command execution time: %.6f (cpu), %.6f (wall)\n"),
|
: _("Command execution time: %.6f (cpu), %.6f (wall)\n"),
|
||||||
duration<double> (cmd_time).count (),
|
duration<double> (cmd_time).count (),
|
||||||
|
@ -1005,7 +1006,8 @@ scoped_command_stats::~scoped_command_stats ()
|
||||||
long space_now = lim - lim_at_start;
|
long space_now = lim - lim_at_start;
|
||||||
long space_diff = space_now - m_start_space;
|
long space_diff = space_now - m_start_space;
|
||||||
|
|
||||||
printf_unfiltered (!m_msg_type
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
|
!m_msg_type
|
||||||
? _("Space used: %ld (%s%ld during startup)\n")
|
? _("Space used: %ld (%s%ld during startup)\n")
|
||||||
: _("Space used: %ld (%s%ld for this command)\n"),
|
: _("Space used: %ld (%s%ld for this command)\n"),
|
||||||
space_now,
|
space_now,
|
||||||
|
@ -1019,7 +1021,8 @@ scoped_command_stats::~scoped_command_stats ()
|
||||||
int nr_symtabs, nr_compunit_symtabs, nr_blocks;
|
int nr_symtabs, nr_compunit_symtabs, nr_blocks;
|
||||||
|
|
||||||
count_symtabs_and_blocks (&nr_symtabs, &nr_compunit_symtabs, &nr_blocks);
|
count_symtabs_and_blocks (&nr_symtabs, &nr_compunit_symtabs, &nr_blocks);
|
||||||
printf_unfiltered (_("#symtabs: %d (+%d),"
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
|
_("#symtabs: %d (+%d),"
|
||||||
" #compunits: %d (+%d),"
|
" #compunits: %d (+%d),"
|
||||||
" #blocks: %d (+%d)\n"),
|
" #blocks: %d (+%d)\n"),
|
||||||
nr_symtabs,
|
nr_symtabs,
|
||||||
|
@ -1095,7 +1098,7 @@ scoped_command_stats::print_time (const char *msg)
|
||||||
char out[100];
|
char out[100];
|
||||||
strftime (out, sizeof (out), "%F %H:%M:%S", &tm);
|
strftime (out, sizeof (out), "%F %H:%M:%S", &tm);
|
||||||
|
|
||||||
printf_unfiltered ("%s.%03d - %s\n", out, (int) millis, msg);
|
fprintf_unfiltered (gdb_stdlog, "%s.%03d - %s\n", out, (int) millis, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle unknown "mt set per-command" arguments.
|
/* Handle unknown "mt set per-command" arguments.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue