diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2012-11-30 10:29:41 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2012-11-30 10:29:41 +0400 |
| commit | 0ce96f9ef4533430634fe4329b640176074ef9c4 (patch) | |
| tree | fbb5d8af81e28fea273b39c772987b790e0e666b /src/pkg/runtime/chan.c | |
| parent | c3c107f67c86e9e0bf03f831be4f9417c75463a4 (diff) | |
| download | go-0ce96f9ef4533430634fe4329b640176074ef9c4.tar.xz | |
runtime: better stack traces in race reports
When a race happens inside of runtime (chan, slice, etc),
currently reports contain only user file:line.
If the line contains a complex expression,
it's difficult to figure out where the race exactly.
This change adds one more top frame with exact
runtime function (e.g. runtime.chansend, runtime.mapaccess).
R=golang-dev
CC=golang-dev
https://golang.org/cl/6851125
Diffstat (limited to 'src/pkg/runtime/chan.c')
| -rw-r--r-- | src/pkg/runtime/chan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/runtime/chan.c b/src/pkg/runtime/chan.c index 0aa0b43c56..9b915cef01 100644 --- a/src/pkg/runtime/chan.c +++ b/src/pkg/runtime/chan.c @@ -188,7 +188,7 @@ runtime·chansend(ChanType *t, Hchan *c, byte *ep, bool *pres, void *pc) runtime·lock(c); // TODO(dvyukov): add similar instrumentation to select. if(raceenabled) - runtime·racereadpc(c, pc); + runtime·racereadpc(c, pc, runtime·chansend); if(c->closed) goto closed; @@ -1193,7 +1193,7 @@ runtime·closechan(Hchan *c) } if(raceenabled) { - runtime·racewritepc(c, runtime·getcallerpc(&c)); + runtime·racewritepc(c, runtime·getcallerpc(&c), runtime·closechan); runtime·racerelease(c); } |
