[Patch] Require extra --stats to emit heap statistics

jw schultz jw at pegasys.ws
Fri Apr 18 08:05:52 EST 2003


On Thu, Apr 17, 2003 at 09:37:17AM -0700, Wayne Davison wrote:
> On Thu, Apr 10, 2003 at 05:38:08AM -0500, John Van Essen wrote:
> > If you don't want to use^H^H^Habuse the --stats argument, then how
> > about just requiring more than one -v to emit the heap statistics?
> 
> I think it's a good idea for the current code.  Perhaps jw's suggestion
> for selective logging would supersede this?  But in the meantime, a
> simple patch like the one appended seems nice.

Yes, the selective logging would supersede.  But this
clarifies the backwards compatible state.  I also can't know
when i'll get to the selectable logging.

This is a sensible patch.  I prefer (verbose >= 2) over
(verbose > 1) because it is very slightly clearer (no mental
increment) which verbose level applies but either is fine.

> 
> ..wayne..

> Index: main.c
> --- main.c	30 Mar 2003 23:00:33 -0000	1.164
> +++ main.c	17 Apr 2003 16:20:10 -0000
> @@ -87,7 +87,8 @@
>  
>  	if (do_stats) {
>  		/* These come out from every process */
> -		show_malloc_stats();
> +		if (verbose > 1)
> +			show_malloc_stats();
>  		show_flist_stats();
>  	}
>  
> @@ -142,12 +143,12 @@
>  		rprintf(FINFO,"File list size: %d\n", stats.flist_size);
>  		rprintf(FINFO,"Total bytes written: %.0f\n",
>  			(double)stats.total_written);
> -		rprintf(FINFO,"Total bytes read: %.0f\n\n",
> +		rprintf(FINFO,"Total bytes read: %.0f\n",
>  			(double)stats.total_read);
>  	}
>  
>  	if (verbose || do_stats) {
> -		rprintf(FINFO,"wrote %.0f bytes  read %.0f bytes  %.2f bytes/sec\n",
> +		rprintf(FINFO,"\nwrote %.0f bytes  read %.0f bytes  %.2f bytes/sec\n",
>  			(double)stats.total_written,
>  			(double)stats.total_read,
>  			(stats.total_written+stats.total_read)/(0.5 + (t-starttime)));

> -- 
> To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt


More information about the rsync mailing list