]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: scale mutex profile with sampling rate
authorHana Kim <hakim@google.com>
Tue, 23 Jan 2018 20:02:45 +0000 (15:02 -0500)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Wed, 24 Jan 2018 14:06:59 +0000 (14:06 +0000)
commite89d08e02180b72b541bcda0def3caf754704e25
treedb7948deb8ce08c9efc77e095bf8ed7304916821
parent157d8cfbc13fbc4c849075e905b0001fb248b5e6
runtime/pprof: scale mutex profile with sampling rate

pprof expects the samples are scaled and reflects unsampled numbers.
The legacy profile parser uses the sampling period in the output
and multiplies all values with the period.

https://github.com/google/pprof/blob/0138a3cd6dad6f94495ba0b5c3a5c124f04ae011/profile/legacy_profile.go#L815

Apply the same scaling when we output the mutex profile
in the pprof proto format.

Block profile shares the same code, but how to infer unsampled
values is unclear. Legacy profile parser doesn't do anything special
so we do nothing for block profile here.

Tested by checking the profiles reported with debug=0 (proto format)
are similar to the profiles computed from legacy format profile
when the profile rate is a non-trivial number (e.g. 2) manually.

Change-Id: Iaa33f92051deed67d8be43ddffc7c1016db566ca
Reviewed-on: https://go-review.googlesource.com/89295
Reviewed-by: Peter Weinberger <pjw@google.com>
src/runtime/pprof/pprof.go