]> Cypherpunks repositories - gostls13.git/commit
runtime/trace: iterate over frames instead of PCs
authorDavid Lazar <lazard@golang.org>
Thu, 13 Apr 2017 13:40:49 +0000 (09:40 -0400)
committerDavid Lazar <lazard@golang.org>
Fri, 14 Apr 2017 12:21:21 +0000 (12:21 +0000)
commit3249cb0ab465c5310e09868236405ba6c40929a4
tree4022eab699c41c8e0ecef793000485ea652cd75c
parenta7276742e69a9d9a34834d13fcf5867051bea3f1
runtime/trace: iterate over frames instead of PCs

Now the runtime/trace tests pass with -l=4.

This also gets rid of the frames cache for multiple reasons:

1) The frames cache was used to avoid repeated calls to funcname and
funcline. Now these calls happen inside the CallersFrames iterator.

2) Maintaining a frames cache is harder: map[uintptr]traceFrame
doesn't work since each PC can map to multiple traceFrames.

3) It's not clear that the cache is important.

Change-Id: I2914ac0b3ba08e39b60149d99a98f9f532b35bbb
Reviewed-on: https://go-review.googlesource.com/40591
Run-TryBot: David Lazar <lazard@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/trace.go