]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/mapper: dump indep partial progression for debugging
authorSage Weil <sage@inktank.com>
Wed, 4 Dec 2013 00:46:49 +0000 (16:46 -0800)
committerSage Weil <sage@inktank.com>
Fri, 6 Dec 2013 22:24:03 +0000 (14:24 -0800)
...if DEBUG_INDEP is #defined.

Signed-off-by: Sage Weil <sage@inktank.com>
src/crush/mapper.c

index 684ada6288aa8da1b6fa34397e7b61920604c8c8..3ae3724a98df5ce8ac8832c2fae6eff834429019 100644 (file)
@@ -16,6 +16,7 @@
 # define dprintk(args...) /* printf(args) */
 # define kmalloc(x, f) malloc(x)
 # define kfree(x) free(x)
+/*# define DEBUG_INDEP*/
 #endif
 
 #include "crush.h"
@@ -486,6 +487,20 @@ static void crush_choose_indep(const struct crush_map *map,
        }
 
        for (ftotal = 0; left > 0 && ftotal < attempts; ftotal++) {
+#ifdef DEBUG_INDEP
+               if (out2 && ftotal) {
+                       printf("%d %d a: ", ftotal, left);
+                       for (rep = outpos; rep < endpos; rep++) {
+                               printf(" %d", out[rep]);
+                       }
+                       printf("\n");
+                       printf("%d %d b: ", ftotal, left);
+                       for (rep = outpos; rep < endpos; rep++) {
+                               printf(" %d", out2[rep]);
+                       }
+                       printf("\n");
+               }
+#endif
                for (rep = outpos; rep < endpos; rep++) {
                        if (out[rep] != CRUSH_ITEM_UNDEF)
                                continue;
@@ -602,6 +617,20 @@ static void crush_choose_indep(const struct crush_map *map,
                        out2[rep] = CRUSH_ITEM_NONE;
                }
        }
+#ifdef DEBUG_INDEP
+       if (out2) {
+               printf("%d %d a: ", ftotal, left);
+               for (rep = outpos; rep < endpos; rep++) {
+                       printf(" %d", out[rep]);
+               }
+               printf("\n");
+               printf("%d %d b: ", ftotal, left);
+               for (rep = outpos; rep < endpos; rep++) {
+                       printf(" %d", out2[rep]);
+               }
+               printf("\n");
+       }
+#endif
 }
 
 /**