Add optional Tracepoint for RequestContext switch
[folly.git] / folly / io / async / Request.cpp
index 3babeea69bad670f7e8597e23ba3aeff733377a3..1c9e071cac593e4aff63630a4d75818a8517934f 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <folly/io/async/Request.h>
+#include <folly/tracing/StaticTracepoint.h>
 
 #include <glog/logging.h>
 
@@ -94,6 +95,7 @@ std::shared_ptr<RequestContext> RequestContext::setContext(
     std::shared_ptr<RequestContext> ctx) {
   auto& curCtx = getStaticContext();
   if (ctx != curCtx) {
+    FOLLY_SDT(folly, request_context_switch_before, curCtx.get(), ctx.get());
     using std::swap;
     if (curCtx) {
       curCtx->onUnset();