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:

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()` < `ProcessSamplingProbability` ×
|
||||
`ProcessSamplingBoost2`
|
||||
|
||||
where
|
||||
|
||||
* 0.0 ≤ `ProcessSamplingProbability` ≤ 1.0,
|
||||
|
||||
* `ProcessSamplingBoost2` ≥ 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` × (`AllocationSamplingRange`
|
||||
∗∗ `base::RandDouble()`)
|
||||
|
||||
where
|
||||
|
||||
* `AllocationSamplingMultiplier` ≥ 1,
|
||||
|
||||
* `AllocationSamplingRange` ≥ 1, and
|
||||
|
||||
* the final expression is < `max(size_t)`.
|
||||
|
||||
As an example, on Linux, using the default parameters and
|
||||
`base::RandDouble() == 0.5`, we get
|
||||
|
||||
1500 × (16 ∗∗ 0.5) = 6000
|
||||
|
Reference in New Issue
Block a user