Improve concurrency for logging arrays
Summary:
Improves concurrency for creation of logging arrays. Changes:
1) Create a `LoggingProfile` struct that is shared among all LoggingArrays created at the same SrcKey. This profile contains the SrcKey and a sampling counter used to determine whether a logging array should be emitted when a new array is created at that location.
2) In `maybeEnableLogging`, take a lock only when we are at a SrcKey that has not yet been encountered. The read path takes no locks thanks to ConcurrentHashMap.
3) In `makeFromStatic`, a lock is taken only when we are at a SrcKey that has not been previously encountered.
4) Migrate `makeFromStatic` and `makeFromVanilla` to be helpers in the unnamed namespace and accept a `LoggingProfile` instead of a SrcKey.
Differential Revision:
D23053339
fbshipit-source-id:
b43e0d4f7ee2c9c3f4e4c063abf9c92d4ee1fa91