From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11101 invoked by alias); 10 Sep 2006 18:50:16 -0000 Received: (qmail 11084 invoked from network); 10 Sep 2006 18:50:07 -0000 Received: from unknown (80.67.18.15) by sourceware.org with QMTP; 10 Sep 2006 18:50:07 -0000 Received: (qmail 14882 invoked from network); 10 Sep 2006 18:50:07 -0000 Received: from unknown (HELO ibox.ronetix.at) (301615@[80.109.6.193]) (envelope-sender ) by smtprelay03.ispgateway.de (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 10 Sep 2006 18:50:07 -0000 Received: from [192.168.3.15] (ilkobox [192.168.3.15]) by ibox.ronetix.at (8.12.8/8.12.8) with ESMTP id k8AIo6kN014116; Sun, 10 Sep 2006 20:50:06 +0200 Message-ID: <45045E5E.6020602@ronetix.at> Date: Sun, 10 Sep 2006 18:50:00 -0000 From: Ilko Iliev User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Mark Kettenis CC: gdb-patches@sources.redhat.com Subject: Re: "Transfer rate" patch References: <44FD2640.7080605@ronetix.at> <45002AB3.7090402@ronetix.at> <200609071954.k87Js9sd022237@elgar.sibelius.xs4all.nl> In-Reply-To: <200609071954.k87Js9sd022237@elgar.sibelius.xs4all.nl> Content-Type: multipart/mixed; boundary="------------090604040206070805060408" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00047.txt.bz2 This is a multi-part message in MIME format. --------------090604040206070805060408 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 680 Mark Kettenis wrote: >> Date: Thu, 07 Sep 2006 16:20:35 +0200 >> From: Ilko Iliev >> >> The corrected patch again - the output is in "KBytes/sec" or "bytes/sec". >> The ChangeLog file is updated too. >> >> I changed to "KBytes/sec" because of our and other fast JTAG Emulators. >> > > Well 9600 Bps is still pretty much standard for serial lines. > > Mark > Even of 9600 Bps it is more comfortable to see the download sped in KBytes/s. If the download speed is less than 1 KByte/s, the print is in bytes/s. In the attachment is the corrected version of the patch. regards, Ilko Iliev Ronetix - JTAG Emulators and Flash Programmers www.ronetix.at --------------090604040206070805060408 Content-Type: text/plain; name="gdb_download_speed.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb_download_speed.patch" Content-length: 2004 --- ChangeLog.orig 2006-09-07 15:23:19.000000000 +0200 +++ ChangeLog 2006-09-07 15:27:46.000000000 +0200 @@ -1,3 +1,8 @@ +2006-09-07 Ilko Iliev + + * symfile.c (print_transfer_performance): Fix overflow problem + and change bits/sec to KBytes/sec or bytes/sec + 2006-08-28 DJ Delorie * m32c-tdep.c (m32c_decode_srcdest4): Initialize fields in sd --- symfile.c.orig 2006-08-31 15:29:12.000000000 +0200 +++ symfile.c 2006-09-07 17:23:48.000000000 +0200 @@ -1758,27 +1758,36 @@ print_transfer_performance (struct ui_fi unsigned long write_count, const struct timeval *start_time, const struct timeval *end_time) { unsigned long time_count; + unsigned long rr; /* Compute the elapsed time in milliseconds, as a tradeoff between accuracy and overflow. */ time_count = (end_time->tv_sec - start_time->tv_sec) * 1000; time_count += (end_time->tv_usec - start_time->tv_usec) / 1000; ui_out_text (uiout, "Transfer rate: "); if (time_count > 0) { - ui_out_field_fmt (uiout, "transfer-rate", "%lu", - 1000 * (data_count * 8) / time_count); - ui_out_text (uiout, " bits/sec"); + rr = (unsigned long)((unsigned long long)data_count * 1000 / time_count); + if ( rr < 1024 ) + { + ui_out_field_fmt (uiout, "transfer-rate", "%lu", rr ); + ui_out_text (uiout, " bytes/sec"); + } + else + { + ui_out_field_fmt (uiout, "transfer-rate", "%lu", rr / 1024 ); + ui_out_text (uiout, " Kbytes/sec"); + } } else { - ui_out_field_fmt (uiout, "transferred-bits", "%lu", (data_count * 8)); - ui_out_text (uiout, " bits in <1 sec"); + ui_out_field_fmt (uiout, "transferred-bytes", "%lu", data_count); + ui_out_text (uiout, " bytes in <1 sec"); } if (write_count > 0) { ui_out_text (uiout, ", "); ui_out_field_fmt (uiout, "write-rate", "%lu", data_count / write_count); --------------090604040206070805060408--