runtime: add execution tracing functionality

This is first patch of series of patches that implement tracing functionality.
Design doc:
https://docs.google.com/document/u/1/d/1FP5apqzBgr7ahCCgFO-yoVhk4YZrNIDNf9RybngBc14/pub
Full change:
https://codereview.appspot.com/146920043

Change-Id: I84588348bb05a6f6a102c230f3bca6380a3419fe
Reviewed-on: https://go-review.googlesource.com/1450
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Dmitry Vyukov 2014-12-12 18:11:27 +01:00
parent fd85a6c640
commit f30a2b9ca7
2 changed files with 793 additions and 0 deletions

View file

@ -213,6 +213,7 @@ type g struct {
sigcode1 uintptr
sigpc uintptr
gopc uintptr // pc of go statement that created this goroutine
startpc uintptr // pc of goroutine function
racectx uintptr
waiting *sudog // sudog structures this g is waiting on (that have a valid elem ptr)
}
@ -324,6 +325,8 @@ type p struct {
gfree *g
gfreecnt int32
tracebuf *traceBuf
pad [64]byte
}