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.133.124]) by sourceware.org (Postfix) with ESMTPS id D71653857C7A for ; Wed, 12 Jan 2022 22:20:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D71653857C7A Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-32-6kENkdfHNIaK-_yBQ0TJNQ-1; Wed, 12 Jan 2022 17:20:27 -0500 X-MC-Unique: 6kENkdfHNIaK-_yBQ0TJNQ-1 Received: by mail-qv1-f71.google.com with SMTP id kc15-20020a056214410f00b004152196c16eso4205920qvb.1 for ; Wed, 12 Jan 2022 14:20:27 -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=Vyfh5mGjzN+8mOGPpaOtaFGN9g/Ns28ecU883zP/wYQ=; b=a+ejmNXiB4lmDdvfLZwHLZ1mYMVI+Eip5X0Nmzt5YrsDer8+fFpVbZUZjVfzC/TJq6 XO1EQnKgr7UvNMzl4ZQSD1ela7hK3QPNJ1MyidNIW9bE8CDkCnc1FEhWFsXJ3CwQiOjn vRsCDfQT+gvlJVuOJFT3HBuqaD+9pFabN6+iB50l9USuBM4tJVf/1zg/p489K5Dj1f7U P8c1725nqIva1UhfsoXl4/FNYW8VGbqIbLfrTCXYmZ/swMHBqcIn6kWUnIeHa66f/3YR GPQN+XqQVgtGHnyosC6BPg6P6ojVThnJL6PYvRFRQdQufFvvPcOa2XYwQUqNXL0SBU6z tVhg== X-Gm-Message-State: AOAM531wJzEzruCquoShOEmfeuClyQOe0ySJIhOzgnLvdCFvZQ+DikRj B3F/tk/wwImc7y26TkaVouovuSTI015EOsG8ob8umA/ms2UpU5JQIyjdxV2cYKCl9hdN3yKnA46 0PsPqFaXC7e/Do4xcgy14s4yi4dA3XLY9zm8z X-Received: by 2002:a05:620a:2550:: with SMTP id s16mr1487832qko.232.1642026027357; Wed, 12 Jan 2022 14:20:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFuMj9z77O4UXEv3T1Xk47ZWZ7PjEiX6w9ORiNQNsiI0WuGiK6771zYjX2+EWjlMRITEe/KexBq/pOcBF55Vg= X-Received: by 2002:a05:620a:2550:: with SMTP id s16mr1487821qko.232.1642026027151; Wed, 12 Jan 2022 14:20:27 -0800 (PST) MIME-Version: 1.0 References: <20220112025404.433634-1-amerey@redhat.com> <501cf950-ad49-f435-9a35-9b37e5f5fa6d@monnerat.net> In-Reply-To: <501cf950-ad49-f435-9a35-9b37e5f5fa6d@monnerat.net> From: Aaron Merey Date: Wed, 12 Jan 2022 17:20:16 -0500 Message-ID: Subject: Re: [PATCH] gdb/debuginfod: Improve progress updates To: Patrick Monnerat Cc: gdb-patches@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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, 12 Jan 2022 22:20:32 -0000 Hi Patrick, On Tue, Jan 11, 2022 at 10:27 PM Patrick Monnerat via Gdb-patches wrote: > On 1/12/22 03:54, Aaron Merey via Gdb-patches wrote: > > Only print the size of the download if it is known. > > > > > > - current_uiout->progress ((double)cur / (double)total); > > + current_uiout->progress ((double)cur / (double)total); > > + } > > + else > > + { > > + static int spin = 0; > > + current_uiout->message (_("\rDownloading %s %s %c"), data->desc, > > + styled_filename.c_str (), "-/|\\"[spin++ % 4]); > > + current_uiout->flush (); > > + data->printed_spin = true; > > + } > > Plase can you still call current_uiout->progress() with the negative cur > value and move your spin process in it ?. I use ->progress() in insight > for a graphical progress/spinning bar and this negative value is a good > indicator that the total size is unknown. > > https://sourceware.org/git/?p=insight.git;a=blob;f=gdbtk/generic/gdbtk-interp.c;hb=HEAD#l71 > > Or maybe you have another solution for the GUI? I don't think I fully understand the purpose of calling progress() with a negative value since the progress bar is useful only if we know the percentage of the transfer that has completed. When it isn't known then we don't bother printing the download size or progress bar. Instead the throbber indicates that the transfer is ongoing. Let me know if I have misunderstood. Aaron