[Patch] Require extra --stats to emit heap statistics
Wayne Davison
wayned at users.sourceforge.net
Fri Apr 18 02:37:17 EST 2003
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.
..wayne..
-------------- next part --------------
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)));
More information about the rsync
mailing list