From: Sage Weil Date: Wed, 4 Dec 2013 00:46:49 +0000 (-0800) Subject: crush/mapper: dump indep partial progression for debugging X-Git-Tag: v0.74~16^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=384f01dfd3726df47363d623adfbf84c154f6aab;p=ceph.git crush/mapper: dump indep partial progression for debugging ...if DEBUG_INDEP is #defined. Signed-off-by: Sage Weil --- diff --git a/src/crush/mapper.c b/src/crush/mapper.c index 684ada6288aa..3ae3724a98df 100644 --- a/src/crush/mapper.c +++ b/src/crush/mapper.c @@ -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 } /**