"Transfer rate" patch

Vladimir Prus ghost@cs.msu.su
Thu Sep 7 14:58:00 GMT 2006


Ilko Iliev wrote:

[snip quoted entire previous patch]

>   --- 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 <iliev@ronetix.at>
> +
> +       * symfile.c (print_transfer_performance): Fix overflow problem
> +        and change bits/sec to KBytes/sec or bytes/sec
> +
> 2006-08-28  DJ Delorie  <dj@redhat.com>
> 
> * 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 15:19:45.000000000 +0200
> @@ -1769,14 +1769,23 @@
> 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");
> +      if ( data_count < 1024 )
> +        {
> +          ui_out_field_fmt (uiout, "transfer-rate", "%lu",
> +            (unsigned long)((((unsigned long long)data_count) * 1000) /
> time_count)); 

I think the above line is longer than 80 characters, and that's probably not
OK.

Also, I think this branch should be taken if download speed is smaller that
1024 bytes *per second*, not when total download size is less than 1024
bytes.

- Volodya




More information about the Gdb-patches mailing list