]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: simplify CPU profiling code
authorMatthew Dempsky <mdempsky@google.com>
Wed, 25 Feb 2015 05:41:21 +0000 (14:41 +0900)
committerDmitry Vyukov <dvyukov@google.com>
Thu, 26 Feb 2015 08:59:24 +0000 (08:59 +0000)
commit3c8a89daf3a05a1dd98075a733db7a20bef2dc5c
treedb477dc0bc924ff94ea7b334c5a9233df9c65a17
parenta32dd832530a176b5b45f06c3a97f52383227480
runtime: simplify CPU profiling code

This makes Go's CPU profiling code somewhat more idiomatic; e.g.,
using := instead of forward declaring variables, using "int" for
element counts instead of "uintptr", and slices instead of C-style
pointer+length.  This makes the code easier to read and eliminates a
lot of type conversion clutter.

Additionally, in sigprof we can collect just maxCPUProfStack stack
frames, as cpuprof won't use more than that anyway.

Change-Id: I0235b5ae552191bcbb453b14add6d8c01381bd06
Reviewed-on: https://go-review.googlesource.com/6072
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
src/runtime/cpuprof.go
src/runtime/extern.go
src/runtime/mprof.go
src/runtime/os1_windows.go
src/runtime/proc1.go
src/runtime/signal_386.go
src/runtime/signal_amd64x.go
src/runtime/signal_arm.go
src/runtime/signal_ppc64x.go
src/runtime/trace.go
src/runtime/traceback.go