Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0413e16
)
Better mallinfo() output in --stats
author
Martin Pool
<mbp@samba.org>
Fri, 11 Jan 2002 07:26:39 +0000
(07:26 +0000)
committer
Martin Pool
<mbp@samba.org>
Fri, 11 Jan 2002 07:26:39 +0000
(07:26 +0000)
main.c
patch
|
blob
|
blame
|
history
diff --git
a/main.c
b/main.c
index
8938837
..
37ab2fb
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-57,6
+57,11
@@
static void report(int f)
extern int remote_version;
int send_stats;
extern int remote_version;
int send_stats;
+ if (do_stats) {
+ /* These come out from every process */
+ show_malloc_stats();
+ }
+
if (am_daemon) {
log_exit(0, __FILE__, __LINE__);
if (f == -1 || !am_sender) return;
if (am_daemon) {
log_exit(0, __FILE__, __LINE__);
if (f == -1 || !am_sender) return;
@@
-120,7
+125,6
@@
static void report(int f)
rprintf(FINFO,"total size is %.0f speedup is %.2f\n",
(double)stats.total_size,
(1.0*stats.total_size)/(stats.total_written+stats.total_read));
rprintf(FINFO,"total size is %.0f speedup is %.2f\n",
(double)stats.total_size,
(1.0*stats.total_size)/(stats.total_written+stats.total_read));
- show_malloc_stats();
}
fflush(stdout);
}
fflush(stdout);
@@
-135,10
+139,17
@@
static void show_malloc_stats(void)
{
#ifdef HAVE_MALLINFO
struct mallinfo mi;
{
#ifdef HAVE_MALLINFO
struct mallinfo mi;
+ extern int am_server;
+ extern int am_sender;
+ extern int am_daemon;
mi = mallinfo();
mi = mallinfo();
- rprintf(FINFO, RSYNC_NAME " heap statistics:\n");
+ rprintf(FINFO, RSYNC_NAME "[%d] (%s%s%s) heap statistics:\n",
+ getpid(),
+ am_server ? "server " : "",
+ am_daemon ? "daemon " : "",
+ am_sender ? "sender" : "receiver");
rprintf(FINFO, " arena: %10d (bytes from sbrk)\n", mi.arena);
rprintf(FINFO, " ordblks: %10d (chunks not in use)\n", mi.ordblks);
rprintf(FINFO, " smblks: %10d\n", mi.smblks);
rprintf(FINFO, " arena: %10d (bytes from sbrk)\n", mi.arena);
rprintf(FINFO, " ordblks: %10d (chunks not in use)\n", mi.ordblks);
rprintf(FINFO, " smblks: %10d\n", mi.smblks);