TargetProfile: use SrcKey in public API to represent code position
Summary:
TargetProfile is taking an Offset, which can't properly represent prologues and
later function entries. Prologues currently use the Func's entry bytecode
position in TargetProfiles, which does not cause any issues, as TargetProfiles
are also keyed by TransIDs and prologues are in different translations, so they
have different TransIDs.
However, this won't work with function entries, as they will be in the same
translation as the first opcode. This could possibly cause a profiling clash.
So, use a special Offset for prologues (and later function entries) and take
SrcKey in all public APIs so that we can determine this situation. We can't use
SrcKey everywhere, as that would increase the size of the underlying RDS key
represented by the rds::Profile structure and also rds::Symbol, as rds::Profile
is its biggest component.
Reviewed By: paulbiss
Differential Revision:
D24245433
fbshipit-source-id:
fb956ae4813f2bd3096ac1123804bc996c630d00