public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Merey <amerey@redhat.com>
To: Patrick Monnerat <patrick@monnerat.net>
Cc: gdb-patches@sourceware.org, Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH v3] gdb: Improve debuginfod progress updates
Date: Tue, 15 Feb 2022 21:09:40 -0500	[thread overview]
Message-ID: <CAJDtP-Qa=q6x6qTc3-7rknJgtE89RTTtp58-b7yeYAyn1fEHFg@mail.gmail.com> (raw)
In-Reply-To: <d3dd77a7-6328-8398-0879-e34d0e905876@monnerat.net>

Hi Patrick,

Thanks for taking another look.

On Sun, Feb 13, 2022 at 7:56 PM Patrick Monnerat <patrick@monnerat.net> wrote:
> > +      /* Transfer size is known.  */
> > +      double percent = (double)cur / (double)total;
> The variable name is confusing as it is <= 1.0.

update_progress_percent uses the name "howmuch" for this.  It would be
better if "howmuch" was used here too.

> > +
> > +      if (percent >= 0.0 && percent <= 1.0)
> I don't think this test is needed: cur and total are obtained
> (indirectly) from curl and IMHO you can trust it.

I've experienced at least one case where percent was > 1.0.  I haven't
been able to reproduce it because it seemed to coincide with a network
hiccup.  If percent isn't between 0 and 1 then we default to the spinner
to avoid printing a message with a nonsensical completion percentage.

> > +     progress_update object.  */
> > +  void update_progress_bar (double howmuch)
>
> This is never called! why do you provide both PERCENT and (unused) BAR?
> This is a bit confusing.

The progress update message originally included the bar but I now want to
only print messages that fit entirely on one line.  This makes it possible
to rewrite an entire message with transfer size information once it becomes
available.  Because the progress bar was already implemented I figured I'd
leave it in case it ends up serving a purpose in the future.

Aaron


  reply	other threads:[~2022-02-16  2:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  0:58 [PATCH v2] gdb/debuginfod: Rework " Aaron Merey
2022-02-09  2:25 ` [PATCH v3] gdb: Improve debuginfod " Aaron Merey
2022-02-14  0:56   ` Patrick Monnerat
2022-02-16  2:09     ` Aaron Merey [this message]
2022-02-16 10:38       ` Patrick Monnerat
2022-02-17 16:06         ` Aaron Merey
2022-03-04 18:15   ` Tom Tromey
2022-03-09  1:26     ` Aaron Merey
2022-03-18 19:23       ` Tom Tromey
2022-03-22  0:27         ` Aaron Merey
2022-04-07 14:54           ` Tom Tromey

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='CAJDtP-Qa=q6x6qTc3-7rknJgtE89RTTtp58-b7yeYAyn1fEHFg@mail.gmail.com' \
    --to=amerey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=patrick@monnerat.net \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).