Add Semaphore support for folly's Static Tracepoint
Summary: This Diff adds new `FOLLY_SDT_WITH_SEMAPHORE` Macro that allows the (potentially expensive) Static Tracepoints be gated with Semaphore and be enabled on-demand. The Semaphores are compatible with SystemTap's Tracepoint Semaphores, with the following difference: - Instead of having build Process generate a header file containing the Semaphore variable and check function, and to be included, this Diff uses the approach that users need to explicitly define the semaphore using `FOLLY_SDT_SEMAPHORE_DEFINE` before using `FOLLY_SDT_WITH_SEMAPHORE`. Then the check function could be used in the same file, or in any other linked module with doing `FOLLY_SDT_SEMAPHORE_DECLARE` first. This is inspired from GFlag's defining and declaring. - We keep allowing original `FOLLY_SDT` with no Semaphore for flexibility. Differential Revision: D6814268 fbshipit-source-id: e1e4463c71539b4d2071b21880d4ee7689fedce8
Showing
Please register or sign in to comment