From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6E0EA3858C1F for ; Wed, 16 Feb 2022 02:09:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E0EA3858C1F Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-387-aekuLQJQMKKXesq95HajlQ-1; Tue, 15 Feb 2022 21:09:52 -0500 X-MC-Unique: aekuLQJQMKKXesq95HajlQ-1 Received: by mail-yb1-f200.google.com with SMTP id g205-20020a2552d6000000b0061e1843b8edso1241199ybb.18 for ; Tue, 15 Feb 2022 18:09:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xRoBQRWLeaSk73DEXdNsiQZrqv8Xl4ZA/f3Jh1aZJcg=; b=LefJK3Ix7G1JrkvN2HAR7RQ5iY6HmReep661H1+aRqJ08fBBlVzB2wPybeE3Tf3mPt R/2oYPXBjseiKF1aTs/TM4G7TPmAvBnzL2A/eNaf26CWAAFWUqwQnKJeyuxDWJvSq1/q WSsGedTzSVBzDN9N7LtbK1MVilGRhtkXyfZKE7ndeXSlWqWr9MAwRzxVNMf0LhCpvJYE jkCynuuIafFe7yByO4GB/5YXd2NBgoMmkWLa77dnEOlSX1uooZczzJfzVPn23vkhd6Jx pae13VGMsUpZbFmjFkpsSEsgoEFgrUm4eCnLyB8lrvU/fjp/aI3cBs3nZH6Pvofikuxa nehg== X-Gm-Message-State: AOAM530Zhj2anzT51KTEX1Pt7w2pyHgOsfC14gCOusiVLK+GBvH5Ej3v aINkMoOibukWhVoSJn5gNbaVwgUQxi2nuf5DJ6HGcwcnZvnTnZIwM7fjXz2b3tGeGbpXWwTs0v+ nd78oBwYAcbGiOXSj346fZrpR4XNDwrZyUKuy X-Received: by 2002:a81:6646:0:b0:2ca:287c:6bdc with SMTP id a67-20020a816646000000b002ca287c6bdcmr602765ywc.129.1644977392043; Tue, 15 Feb 2022 18:09:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJymiuExECceqbm0tvbQPLjRykJ6tpObXQJaVFxk6ykPnDNHLuqh6SBRgu0uxIFCg4vh5ou7aKtaE52ptYLhDrk= X-Received: by 2002:a81:6646:0:b0:2ca:287c:6bdc with SMTP id a67-20020a816646000000b002ca287c6bdcmr602752ywc.129.1644977391752; Tue, 15 Feb 2022 18:09:51 -0800 (PST) MIME-Version: 1.0 References: <20220126005817.56356-1-amerey@redhat.com> <20220209022548.343785-1-amerey@redhat.com> In-Reply-To: From: Aaron Merey Date: Tue, 15 Feb 2022 21:09:40 -0500 Message-ID: Subject: Re: [PATCH v3] gdb: Improve debuginfod progress updates To: Patrick Monnerat Cc: gdb-patches@sourceware.org, Tom Tromey X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2022 02:09:56 -0000 Hi Patrick, Thanks for taking another look. On Sun, Feb 13, 2022 at 7:56 PM Patrick Monnerat 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