A method and apparatus for determining a stack distance histogram for
running software. The method may include receiving a plurality of memory
references each including a corresponding address. The method may also
include performing a first hash function and a second hash function on
each received address. In addition, the method may include selectively
storing an indication representative of each corresponding address in a
hash table dependent upon results of the first hash function and the
second hash function. A stack distance may then be determined based upon
contents of the hash table.