From: Tom Tromey <tromey@redhat.com>
To: Paul Hilfinger <Hilfinger@adacore.com>
Cc: gdb-patches@sourceware.org, brobecker@adacore.com,
Paul Hilfinger <Hilfinger@cs.berkeley.edu>
Subject: Re: [RFA] Refactor 'maint time' command statistics.
Date: Thu, 24 Jun 2010 16:21:00 -0000 [thread overview]
Message-ID: <m37hlo9zbj.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1277281366-548-1-git-send-email-Hilfinger@adacore.com> (Paul Hilfinger's message of "Wed, 23 Jun 2010 01:22:46 -0700")
>>>>> "Paul" == Paul Hilfinger <Hilfinger@adacore.com> writes:
Paul> Refactor 'maint time' code and make it work for errors, too.
Paul> Consolidate code for displaying per-command time and space
Paul> statistics to avoid duplication. Piggyback on cleanups so that
Paul> statistics get printed even when commands terminate as a result of
Paul> an error.
This looks pretty good. A couple nits...
Paul> + printf_unfiltered (msg_type == 0 ?
Paul> + _("Startup time: %ld.%06ld\n") :
Paul> + _("Command execution time: %ld.%06ld\n"),
In the GNU style the "?" and ":" should appear at the start of lines,
not the end.
Paul> + printf_unfiltered (msg_type == 0 ?
Paul> + _("Space used: %ld (%c%ld during startup)\n") :
Paul> + _("Space used: %ld (%c%ld for this command)\n"),
Likewise.
Paul> + struct cmd_stats *new_stat = XMALLOC (struct cmd_stats);
[...]
Paul> + return make_cleanup (report_command_stats, new_stat);
It is more future-proof to use make_cleanup_dtor, so that the allocated
closure is freed even if the cleanup is discarded. (Then I think you
also need to remove the xfree from report_command_stats.)
This is ok with those changes.
thanks,
Tom
next prev parent reply other threads:[~2010-06-24 16:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-23 8:23 Paul Hilfinger
2010-06-24 16:21 ` Tom Tromey [this message]
2010-06-25 20:19 ` Paul Hilfinger
2010-06-25 20:43 ` Tom Tromey
2010-06-26 7:19 ` [commit] " Paul Hilfinger
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=m37hlo9zbj.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=Hilfinger@adacore.com \
--cc=Hilfinger@cs.berkeley.edu \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).