From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from jupiter.monnerat.net (jupiter.monnerat.net [46.226.111.226]) by sourceware.org (Postfix) with ESMTPS id 45BE53858D3C for ; Wed, 16 Feb 2022 10:38:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 45BE53858D3C Received: from [192.168.0.128] ([192.168.0.128]) by jupiter.monnerat.net (8.14.8/8.14.8) with ESMTP id 21GAcZI8025949 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Feb 2022 11:38:41 +0100 DKIM-Filter: OpenDKIM Filter v2.10.3 jupiter.monnerat.net 21GAcZI8025949 Message-ID: <5e6194e4-3a83-e169-0c9a-5858c993bf59@monnerat.net> Date: Wed, 16 Feb 2022 11:38:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3] gdb: Improve debuginfod progress updates Content-Language: en-US To: Aaron Merey Cc: gdb-patches@sourceware.org, Tom Tromey References: <20220126005817.56356-1-amerey@redhat.com> <20220209022548.343785-1-amerey@redhat.com> From: Patrick Monnerat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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 10:38:47 -0000 Hi Aaron, On 2/16/22 03:09, Aaron Merey wrote: > Thanks for taking another look. You're welcome. >>> + /* 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. Good choice. >>> + 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. Very strange! TCP is supposed to guarantee no duplicate data reception. If this really occurs, debuginfo data are probably corrupted too! > + 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. Thanks for this precision. Maybe put it in a comment? Cheers, Patrick