From: Simon Marchi <simon.marchi@polymtl.ca>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH] gdb: fix nan in scoped_time_it output
Date: Mon, 28 Sep 2026 21:09:16 -0400 [thread overview]
Message-ID: <4e70f12a-fa79-4268-85fd-eacfefad4c16@polymtl.ca> (raw)
In-Reply-To: <878q4l11hy.fsf@redhat.com>
On 2026-09-28 17:59, Andrew Burgess wrote:
> simon.marchi@polymtl.ca writes:
>
>> From: Simon Marchi <simon.marchi@efficios.com>
>>
>> With "maintenance set per-command time on", a scope that takes less
>> than a millisecond prints:
>>
>> Time for "...": wall 0.000, user 0.000, sys 0.000, user+sys 0.000, -nan % CPU
>>
>> The durations are converted to an integer millisecond count before the
>> CPU usage is computed, so a sub-millisecond scope truncates the wall
>> time to zero, and the division produces a NaN (or an infinity, if the
>> CPU time is not zero). We don't really care about sub-millisecond
>> durations for the purpose of this tool, so just add a check for
>> `wall_ms == 0`, and report the CPU usage as 0% if true. This is purely
>> cosmetic.
>
> LGTM.
>
> Approved-By: Andrew Burgess <aburgess@redhat.com>
Thanks, pushed.
Simon
prev parent reply other threads:[~2026-09-29 1:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 18:18 simon.marchi
2026-09-28 21:59 ` Andrew Burgess
2026-09-29 1:09 ` Simon Marchi [this message]
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=4e70f12a-fa79-4268-85fd-eacfefad4c16@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.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