Changed the chksum debug flag to deltasum.
authorWayne Davison <wayned@samba.org>
Mon, 21 Jul 2008 03:02:09 +0000 (20:02 -0700)
committerWayne Davison <wayned@samba.org>
Mon, 21 Jul 2008 03:02:09 +0000 (20:02 -0700)
generator.c
match.c
options.c
receiver.c
rsync.h
sender.c

index a0a95d9..7735e1e 100644 (file)
@@ -803,7 +803,7 @@ static void sum_sizes_sqroot(struct sum_struct *sum, int64 len)
        if ((int64)sum->count != l)
                sum->count = -1;
 
-       if (sum->count && DEBUG_GTE(CHKSUM, 2)) {
+       if (sum->count && DEBUG_GTE(DELTASUM, 2)) {
                rprintf(FINFO,
                        "count=%s rem=%ld blength=%ld s2length=%d flength=%s\n",
                        big_num(sum->count, 0), (long)sum->remainder, (long)sum->blength,
@@ -855,7 +855,7 @@ static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
                sum1 = get_checksum1(map, n1);
                get_checksum2(map, n1, sum2);
 
-               if (DEBUG_GTE(CHKSUM, 3)) {
+               if (DEBUG_GTE(DELTASUM, 3)) {
                        rprintf(FINFO,
                                "chunk[%s] offset=%s len=%ld sum1=%08lx\n",
                                big_num(i, 0), big_num(offset - n1, 0), (long)n1,
@@ -1903,12 +1903,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                fnamecmp_type = FNAMECMP_BACKUP;
        }
 
-       if (DEBUG_GTE(CHKSUM, 3)) {
+       if (DEBUG_GTE(DELTASUM, 3)) {
                rprintf(FINFO, "gen mapped %s of size %s\n",
                        fnamecmp, big_num(sx.st.st_size, 0));
        }
 
-       if (DEBUG_GTE(CHKSUM, 2))
+       if (DEBUG_GTE(DELTASUM, 2))
                rprintf(FINFO, "generating and sending sums for %d\n", ndx);
 
   notify_others:
diff --git a/match.c b/match.c
index 0d4cfeb..7e9b611 100644 (file)
--- a/match.c
+++ b/match.c
@@ -108,7 +108,7 @@ static void matched(int f, struct sum_struct *s, struct map_struct *buf,
        int32 n = (int32)(offset - last_match); /* max value: block_size (int32) */
        int32 j;
 
-       if (DEBUG_GTE(CHKSUM, 2) && i >= 0) {
+       if (DEBUG_GTE(DELTASUM, 2) && i >= 0) {
                rprintf(FINFO,
                        "match at %s last_match=%s j=%d len=%ld n=%ld\n",
                        big_num(offset, 0), big_num(last_match, 0), i,
@@ -152,7 +152,7 @@ static void hash_search(int f,struct sum_struct *s,
         * coding of the output to work more efficiently. */
        want_i = 0;
 
-       if (DEBUG_GTE(CHKSUM, 2)) {
+       if (DEBUG_GTE(DELTASUM, 2)) {
                rprintf(FINFO, "hash search b=%ld len=%s\n",
                        (long)s->blength, big_num(len, 0));
        }
@@ -164,14 +164,14 @@ static void hash_search(int f,struct sum_struct *s,
        sum = get_checksum1((char *)map, k);
        s1 = sum & 0xFFFF;
        s2 = sum >> 16;
-       if (DEBUG_GTE(CHKSUM, 3))
+       if (DEBUG_GTE(DELTASUM, 3))
                rprintf(FINFO, "sum=%.8x k=%ld\n", sum, (long)k);
 
        offset = 0;
 
        end = len + 1 - s->sums[s->count-1].len;
 
-       if (DEBUG_GTE(CHKSUM, 3)) {
+       if (DEBUG_GTE(DELTASUM, 3)) {
                rprintf(FINFO, "hash search s->blength=%ld len=%s count=%s\n",
                        (long)s->blength, big_num(len, 0), big_num(s->count, 0));
        }
@@ -180,7 +180,7 @@ static void hash_search(int f,struct sum_struct *s,
                int done_csum2 = 0;
                int32 i;
 
-               if (DEBUG_GTE(CHKSUM, 4)) {
+               if (DEBUG_GTE(DELTASUM, 4)) {
                        rprintf(FINFO, "offset=%s sum=%04x%04x\n",
                                big_num(offset, 0), s2 & 0xFFFF, s1 & 0xFFFF);
                }
@@ -213,7 +213,7 @@ static void hash_search(int f,struct sum_struct *s,
                            && !(s->sums[i].flags & SUMFLG_SAME_OFFSET))
                                continue;
 
-                       if (DEBUG_GTE(CHKSUM, 3)) {
+                       if (DEBUG_GTE(DELTASUM, 3)) {
                                rprintf(FINFO,
                                        "potential match at %s i=%ld sum=%08x\n",
                                        big_num(offset, 0), (long)i, sum);
@@ -361,12 +361,12 @@ void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len)
        if (len > 0 && s->count > 0) {
                build_hash_table(s);
 
-               if (DEBUG_GTE(CHKSUM, 2))
+               if (DEBUG_GTE(DELTASUM, 2))
                        rprintf(FINFO,"built hash table\n");
 
                hash_search(f, s, buf, len);
 
-               if (DEBUG_GTE(CHKSUM, 2))
+               if (DEBUG_GTE(DELTASUM, 2))
                        rprintf(FINFO,"done hash search\n");
        } else {
                OFF_T j;
@@ -390,11 +390,11 @@ void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len)
                        sender_file_sum[i-1]++;
        }
 
-       if (DEBUG_GTE(CHKSUM, 2))
+       if (DEBUG_GTE(DELTASUM, 2))
                rprintf(FINFO,"sending file_sum\n");
        write_buf(f, sender_file_sum, checksum_len);
 
-       if (DEBUG_GTE(CHKSUM, 2)) {
+       if (DEBUG_GTE(DELTASUM, 2)) {
                rprintf(FINFO, "false_alarms=%d hash_hits=%d matches=%d\n",
                        false_alarms, hash_hits, matches);
        }
@@ -407,7 +407,7 @@ void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len)
 
 void match_report(void)
 {
-       if (!DEBUG_GTE(CHKSUM, 1))
+       if (!DEBUG_GTE(DELTASUM, 1))
                return;
 
        rprintf(FINFO,
index 4f6b5e1..a93f465 100644 (file)
--- a/options.c
+++ b/options.c
@@ -199,10 +199,10 @@ struct chmod_mode_struct *chmod_modes = NULL;
 static const char *debug_verbosity[] = {
        /*0*/ NULL,
        /*1*/ NULL,
-       /*2*/ "bind,cmd,chksum,connect,del,dup,filter,flist",
-       /*3*/ "acl,backup,chksum2,del2,exit,filter2,flist2,fuzzy,genr,own,recv,send,time",
-       /*4*/ "cmd2,chksum3,del3,exit2,flist3,iconv,own2,proto,time2",
-       /*5*/ "chdir,chksum4,flist4,fuzzy2,hlink",
+       /*2*/ "bind,cmd,deltasum,connect,del,dup,filter,flist",
+       /*3*/ "acl,backup,deltasum2,del2,exit,filter2,flist2,fuzzy,genr,own,recv,send,time",
+       /*4*/ "cmd2,deltasum3,del3,exit2,flist3,iconv,own2,proto,time2",
+       /*5*/ "chdir,deltasum4,flist4,fuzzy2,hlink",
 };
 
 #define MAX_VERBOSITY ((int)(sizeof debug_verbosity / sizeof debug_verbosity[0]) - 1)
@@ -262,9 +262,9 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
        DEBUG_WORD(BIND, W_CLI, "Debug socket bind actions"),
        DEBUG_WORD(CHDIR, W_CLI|W_SRV, "Debug when the current directory changes"),
        DEBUG_WORD(CONNECT, W_CLI, "Debug connection events"),
-       DEBUG_WORD(CHKSUM, W_SND|W_REC, "Debug delta-transfer checksumming (levels 1-4)"),
        DEBUG_WORD(CMD, W_CLI, "Debug commands+options that are issued (levels 1-2)"),
        DEBUG_WORD(DEL, W_REC, "Debug delete actions (levels 1-3)"),
+       DEBUG_WORD(DELTASUM, W_SND|W_REC, "Debug delta-transfer checksumming (levels 1-4)"),
        DEBUG_WORD(DUP, W_REC, "Debug weeding of duplicate names"),
        DEBUG_WORD(EXIT, W_CLI|W_SRV, "Debug exit events (levels 1-2)"),
        DEBUG_WORD(FILTER, W_SND|W_REC, "Debug filter actions (levels 1-2)"),
index ffaf3e4..5beddd6 100644 (file)
@@ -179,7 +179,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
        if (fd_r >= 0 && size_r > 0) {
                int32 read_size = MAX(sum.blength * 2, 16*1024);
                mapbuf = map_file(fd_r, size_r, read_size, sum.blength);
-               if (DEBUG_GTE(CHKSUM, 2)) {
+               if (DEBUG_GTE(DELTASUM, 2)) {
                        rprintf(FINFO, "recv mapped %s of size %s\n",
                                fname_r, big_num(size_r, 0));
                }
@@ -221,7 +221,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
                        show_progress(offset, total_size);
 
                if (i > 0) {
-                       if (DEBUG_GTE(CHKSUM, 3)) {
+                       if (DEBUG_GTE(DELTASUM, 3)) {
                                rprintf(FINFO,"data recv %d at %s\n",
                                        i, big_num(offset, 0));
                        }
@@ -245,7 +245,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
 
                stats.matched_data += len;
 
-               if (DEBUG_GTE(CHKSUM, 3)) {
+               if (DEBUG_GTE(DELTASUM, 3)) {
                        rprintf(FINFO,
                                "chunk[%d] of size %ld at %s offset=%s\n",
                                i, (long)len, big_num(offset2, 0), big_num(offset, 0));
@@ -304,7 +304,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
                unmap_file(mapbuf);
 
        read_buf(f_in, sender_file_sum, checksum_len);
-       if (DEBUG_GTE(CHKSUM, 2))
+       if (DEBUG_GTE(DELTASUM, 2))
                rprintf(FINFO,"got file_sum\n");
        if (fd != -1 && memcmp(file_sum1, sender_file_sum, checksum_len) != 0)
                return 0;
diff --git a/rsync.h b/rsync.h
index c6a5899..6540257 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -1147,10 +1147,10 @@ extern short info_levels[], debug_levels[];
 #define DEBUG_BIND (DEBUG_BACKUP+1)
 #define DEBUG_CHDIR (DEBUG_BIND+1)
 #define DEBUG_CONNECT (DEBUG_CHDIR+1)
-#define DEBUG_CHKSUM (DEBUG_CONNECT+1)
-#define DEBUG_CMD (DEBUG_CHKSUM+1)
+#define DEBUG_CMD (DEBUG_CONNECT+1)
 #define DEBUG_DEL (DEBUG_CMD+1)
-#define DEBUG_DUP (DEBUG_DEL+1)
+#define DEBUG_DELTASUM (DEBUG_DEL+1)
+#define DEBUG_DUP (DEBUG_DELTASUM+1)
 #define DEBUG_EXIT (DEBUG_DUP+1)
 #define DEBUG_FILTER (DEBUG_EXIT+1)
 #define DEBUG_FLIST (DEBUG_FILTER+1)
index 6c03f1c..9c550e9 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -69,7 +69,7 @@ static struct sum_struct *receive_sums(int f)
 
        s->sums = NULL;
 
-       if (DEBUG_GTE(CHKSUM, 3)) {
+       if (DEBUG_GTE(DELTASUM, 3)) {
                rprintf(FINFO, "count=%s n=%ld rem=%ld\n",
                        big_num(s->count, 0), (long)s->blength, (long)s->remainder);
        }
@@ -103,7 +103,7 @@ static struct sum_struct *receive_sums(int f)
                if (allowed_lull && !(i % lull_mod))
                        maybe_send_keepalive();
 
-               if (DEBUG_GTE(CHKSUM, 3)) {
+               if (DEBUG_GTE(DELTASUM, 3)) {
                        rprintf(FINFO,
                                "chunk[%d] len=%d offset=%s sum1=%08x\n",
                                i, s->sums[i].len, big_num(s->sums[i].offset, 0),
@@ -323,7 +323,7 @@ void send_files(int f_in, int f_out)
                } else
                        mbuf = NULL;
 
-               if (DEBUG_GTE(CHKSUM, 2)) {
+               if (DEBUG_GTE(DELTASUM, 2)) {
                        rprintf(FINFO, "send_files mapped %s%s%s of size %s\n",
                                path,slash,fname, big_num(st.st_size, 0));
                }
@@ -332,7 +332,7 @@ void send_files(int f_in, int f_out)
                                    fnamecmp_type, xname, xlen);
                write_sum_head(f_xfer, s);
 
-               if (DEBUG_GTE(CHKSUM, 2))
+               if (DEBUG_GTE(DELTASUM, 2))
                        rprintf(FINFO, "calling match_sums %s%s%s\n", path,slash,fname);
 
                if (log_before_transfer)