From: Philippe E. <ph...@us...> - 2003-11-13 05:32:28
|
Update of /cvsroot/oprofile/oprofile/libdb In directory sc8-pr-cvs1:/tmp/cvs-serv31962/libdb Modified Files: Tag: BRANCH_CALLGRAPH odb_hash.h Log Message: since hash coding change the file format I prefer to add now a sensible hash for cg, we will change it later only if it cause real problem Index: odb_hash.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/libdb/odb_hash.h,v retrieving revision 1.3.2.4 retrieving revision 1.3.2.5 diff -u -p -d -r1.3.2.4 -r1.3.2.5 --- odb_hash.h 13 Nov 2003 03:27:24 -0000 1.3.2.4 +++ odb_hash.h 13 Nov 2003 05:32:25 -0000 1.3.2.5 @@ -167,17 +167,15 @@ odb_node_t * odb_get_iterator(samples_od static __inline unsigned int odb_do_hash(samples_odb_t const * hash, odb_key_t value) { - /* FIXME FIXME: fix hash for 64 bit keys */ /* FIXME: better hash for eip value, needs to instrument code * and do a lot of tests ... */ /* trying to combine high order bits his a no-op: inside a binary image * high order bits don't vary a lot, hash table start with 7 bits mask - * so this hash coding use 15 low order bits of eip, then add one hash - * bits at each grow. Hash table is stored in files avoiding to rebuild - * ing them at profiling re-start so on changing do_hash() change the - * file format + * so this hash coding use bits 3-9 of eip. Hash table is stored in + * files avoiding to rebuilding them at profiling re-start so + * on changing do_hash() change the file format! */ - return ((value << 0) ^ (value >> 8)) & hash->hash_mask; + return (((value >> 32) ^ (value)) >> 3) & hash->hash_mask; } #ifdef __cplusplus |