]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: fix incorrect assumption in TestMapping
authorHana Kim <hakim@google.com>
Mon, 18 Jun 2018 16:03:53 +0000 (12:03 -0400)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Mon, 18 Jun 2018 19:09:37 +0000 (19:09 +0000)
commit88b442f5c08a2984e6800e83a483a6c7f4b24cd1
tree8022a67788f75faa5b073c26be7e5b056ac43117
parent741dad28cb50b7cdbd4b6fd46114541aa73b15be
runtime/pprof: fix incorrect assumption in TestMapping

TestMapping assumed that there was only one mapping entry corresponding
to /exe/main, but that is not always true.
This CL changes the test logic to examine whether all referenced mappings
are symbolized. Based on the result, the test determines whether the
corresponding mapping entries' HasFunctions fields to be true or false.

I initially attempted to create two mappings for referenced locations
(one for symbolized and another for unsymbolized) as described in the
TODO in proto.go as part of fixing this bug. But that change requires
non-trivial modification in the upstream profile package so I decided
to just fix the test for now.

Fixes #25891

Change-Id: Id27a5b07bb5b59e133755a0f863bf56c0a4f7f2b
Reviewed-on: https://go-review.googlesource.com/119455
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/pprof/proto_test.go