From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id LjWCGwhdDGIcHwAAWB0awg (envelope-from ) for ; Tue, 15 Feb 2022 21:10:16 -0500 Received: by simark.ca (Postfix, from userid 112) id 5F3E01F3C9; Tue, 15 Feb 2022 21:10:16 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C3CD11EDF0 for ; Tue, 15 Feb 2022 21:10:15 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1D90A385800B for ; Wed, 16 Feb 2022 02:10:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D90A385800B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644977414; bh=xRoBQRWLeaSk73DEXdNsiQZrqv8Xl4ZA/f3Jh1aZJcg=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=p8Zda48Ks/LFNdihnlNmWklW/PB44Mcls+jMKZRrrWTTMSHgsAZrLkftsy2TWeKUf RdIm+tYCBS/6mRkey1lKas+VYThk+HsqdtVpoLBp5yzZJufBAn2ce0Y5rvDg+G+uel wJ1OqE9FaaJz8SGEKp4q5Jkz9kJCRvwiWH5XpmzA= 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: Date: Tue, 15 Feb 2022 21:09:40 -0500 Message-ID: Subject: Re: [PATCH v3] gdb: Improve debuginfod progress updates To: Patrick Monnerat X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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: , From: Aaron Merey via Gdb-patches Reply-To: Aaron Merey Cc: Tom Tromey , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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