Experimental Xenon PerRequest Mode
commit51451ff01e4963f376c54abc8dca8b9edcbcab3e
authorShai Duvdevani <duv@fb.com>
Wed, 12 Sep 2018 21:25:33 +0000 (12 14:25 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 12 Sep 2018 21:27:42 +0000 (12 14:27 -0700)
tree61bcde490669a35601da8fe0d3ba93bd795ae8d3
parent441cfaecddb9257eece74f3f5e2b024502d3d388
Experimental Xenon PerRequest Mode

Summary:
In some cases, having a per-request sampling gives us the benefit of knowingly changing the behavior of the request despite the fact we know we are skewing the measurement.
The new option of RequestFreq allows us to do by extending Xenon's current behavior (while not altering it).
A frequency of 0 will disable Xenon logging and a frequency of 1 is practically the current state (always process xenon interrupts).

A frequency higher than 1 will allow us to turn Xenon once per many requests with a highly granular period.
Requests will be able to query whether Xenon is on and behave differently.
This will benefit cases in which extra contextful stack information (e.g. registration stacks of action delegates) can be collected during the request that is Xenon profiled.

Reviewed By: jano

Differential Revision: D9757668

fbshipit-source-id: 93925113085401ca3e6cb2ca1262f4ef56ab395c
hphp/hack/hhi/stdlib/builtins_xenon.hhi
hphp/runtime/base/runtime-option.cpp
hphp/runtime/base/runtime-option.h
hphp/runtime/ext/xenon/ext_xenon.cpp
hphp/runtime/ext/xenon/ext_xenon.h
hphp/runtime/ext/xenon/ext_xenon.php