0

docs: Surface GWP-ASan probabilities

Change-Id: I4ec4c9c8f5a96ed59e30f3acb388e1ff970dc383
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4751364
Commit-Queue: Kalvin Lee <kdlee@chromium.org>
Reviewed-by: Sergei Glazunov <glazunov@google.com>
Cr-Commit-Position: refs/heads/main@{#1180677}
This commit is contained in:
Kalvin Lee
2023-08-08 04:14:51 +00:00
committed by Chromium LUCI CQ
parent 304dc186d5
commit d1ab7ea97a

@ -97,3 +97,38 @@ GWP-ASan exception.
There is [not yet](https://crbug.com/910749) a way to inspect GWP-ASan data in
a minidump (crash report) without access to Google's crash service.
## Appendix: Probabilities
The question "shall we enable GWP-ASan at all in this process?" is
answered by
`base::RandDouble()` &lt; `ProcessSamplingProbability` &times;
`ProcessSamplingBoost2`
where
* 0.0 &le; `ProcessSamplingProbability` &le; 1.0,
* `ProcessSamplingBoost2` &ge; 1, and
* `base::RandDouble()` has range [0, 1).
The question "on average, how many allocations shall occur before
GWP-ASan takes a sample?" is answered by
`AllocationSamplingMultiplier` &times; (`AllocationSamplingRange`
&lowast;&lowast; `base::RandDouble()`)
where
* `AllocationSamplingMultiplier` &ge; 1,
* `AllocationSamplingRange` &ge; 1, and
* the final expression is &lt; `max(size_t)`.
As an example, on Linux, using the default parameters and
`base::RandDouble() == 0.5`, we get
1500 &times; (16 &lowast;&lowast; 0.5) = 6000