hwpmc has been utterly broken for userspace binaries, and has been labeling all samples from userspace binaries as dubious frames.
The issues are that:
- the check for ph.p_offset & (-ph.p_align) == 0 seemed entirely bogus, and was preventing any binary's exec. section from being considred. Replace this with a check for the current vaddr == 0 (meaning we're only taking the 1st exec. section in a binary)
- due to how map-ins are recorded, we were double-counting the offsets for shared libraries. Jessica came up with a brilliant workaround, which is to simply not set the vaddr for relocatable objects.
Thanks so much to Jessica for all the help in making hwpmc work correctly. This is mostly her work.