hmap: Make bad hash functions easier to find.
authorBen Pfaff <blp@nicira.com>
Tue, 24 Sep 2013 21:42:35 +0000 (14:42 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 24 Sep 2013 21:49:23 +0000 (14:49 -0700)
commit402ca8d25eb23d10b3611c57500f76aec518a2c2
tree022088cab0b6b3ff62fd75c1f936e525881616b8
parenta92f2b524e7ef8878bc0c590fc272da8e8b5338f
hmap: Make bad hash functions easier to find.

The hmap code has for a long time incremented a counter when a hash bucket
grew to have many entries.  This can let a developer know that some hash
function is performing poorly, but doesn't give any hint as to which one.
This commit improves the situation by adding rate-limited debug logging
that points out a particular line of code as the source of the poor hash
behavior.  It should make issues easier to track down.

Bug #19926.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Lauded-by: Keith Amidon <keith@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
lib/hmap.c
lib/hmap.h