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:45:55 +0000 (14:45 -0700)
commit0c5e05bf515ceb5e3e4f7f01834054bb34519752
tree0b0a1e73611c57cfd54c2c02d9141455318d995a
parentbab3c0b820111eaf50878863f82e479fea4fa8a3
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