Libepid provides an LLVM library for identifying execution points at runtime. Different abstractions like calling contexts and execution indices allow for a balance between efficiency and precision.
Libepid on Google Code