]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: generate histogram of choose tries
authorSage Weil <sage@inktank.com>
Fri, 8 Jun 2012 02:21:36 +0000 (19:21 -0700)
committerSage Weil <sage@inktank.com>
Fri, 8 Jun 2012 17:58:12 +0000 (10:58 -0700)
Optionally populate a histogram of choose descent attempts.

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

index 83bbbd0dcad9c5b495a0b0ee1412b422dbb3544b..7f800b3404b043d667620ffd22fce7ddecd4654c 100644 (file)
@@ -120,6 +120,7 @@ void crush_destroy(struct crush_map *map)
                kfree(map->rules);
        }
 
+       kfree(map->choose_tries);
        kfree(map);
 }
 
index ed56cce002239605351111a1fecefcb23b4f8a18..084c4a97869571f535ef826a3d678895bbdee150 100644 (file)
@@ -167,6 +167,8 @@ struct crush_map {
        __u32 choose_local_fallback_tries;
        /* choose attempts before giving up */ 
        __u32 choose_total_tries;
+
+       __u32 *choose_tries;
 };
 
 
index 8ca87d794d0804c660d0a97f797186fefc29f4ab..e38b76e492d96570040786a77540ae1c811090ab 100644 (file)
@@ -452,6 +452,9 @@ reject:
                dprintk("CHOOSE got %d\n", item);
                out[outpos] = item;
                outpos++;
+
+               if (map->choose_tries)
+                       map->choose_tries[ftotal]++;
        }
 
        dprintk("CHOOSE returns %d\n", outpos);