Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3685)

Issue 44820047: code review 44820047: runtime: fix and improve CPU profiling (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by dvyukov
Modified:
10 years, 3 months ago
Reviewers:
brainman, rsc
CC:
rsc, golang-codereviews
Visibility:
Public.

Description

runtime: fix and improve CPU profiling - do not lose profiling signals when we have no mcache (possible for syscalls/cgo) - do not lose any profiling signals on windows - fix profiling of cgo programs on windows (they had no m->thread setup) - properly setup tls in cgo programs on windows - check _beginthread return value Fixes issue 6417. Fixes issue 6986.

Patch Set 1 #

Patch Set 2 : diff -r 042402c60017 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 042402c60017 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 4 : diff -r 042402c60017 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r 042402c60017 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 3

Patch Set 6 : diff -r 176779a4ebed https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 7 : diff -r 176779a4ebed https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 8 : diff -r ae7c26f57619 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 9 : diff -r 43646547a09c https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -55 lines) Patch
M src/pkg/runtime/cgo/gcc_windows_386.c View 1 3 chunks +10 lines, -6 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_windows_amd64.c View 1 3 chunks +10 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/libcgo.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/os_windows.c View 1 2 5 chunks +14 lines, -13 lines 0 comments Download
M src/pkg/runtime/os_windows_386.c View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/os_windows_amd64.c View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/pprof/pprof_test.go View 1 2 3 4 5 6 7 3 chunks +0 lines, -11 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 2 3 4 5 6 7 8 5 chunks +20 lines, -13 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/signal_386.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/signal_amd64.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/signal_arm.c View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9
dvyukov
Hello alex.brainman@gmail.com, rsc@golang.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
10 years, 4 months ago (2013-12-23 18:11:21 UTC) #1
dvyukov
https://codereview.appspot.com/44820047/diff/80001/src/pkg/runtime/os_windows.c File src/pkg/runtime/os_windows.c (right): https://codereview.appspot.com/44820047/diff/80001/src/pkg/runtime/os_windows.c#newcode249 src/pkg/runtime/os_windows.c:249: runtimeĀ·atomicstorep(&m->thread, thandle); this location works for main thread, normal ...
10 years, 4 months ago (2013-12-23 18:13:38 UTC) #2
brainman
LGTM but what do I know about this. So please wait for rsc. Thank you. ...
10 years, 4 months ago (2013-12-24 03:15:45 UTC) #3
dvyukov
https://codereview.appspot.com/44820047/diff/80001/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (left): https://codereview.appspot.com/44820047/diff/80001/src/pkg/runtime/proc.c#oldcode2051 src/pkg/runtime/proc.c:2051: if(!Windows && (m == nil || m->mcache == nil)) ...
10 years, 4 months ago (2013-12-26 09:38:22 UTC) #4
dvyukov
Russ, please take a look at this as well.
10 years, 3 months ago (2014-01-21 06:58:58 UTC) #5
rsc
LGTM Thanks.
10 years, 3 months ago (2014-01-22 02:02:01 UTC) #6
dvyukov
*** Submitted as https://code.google.com/p/go/source/detail?r=72c0dfd50949 *** runtime: fix and improve CPU profiling - do not lose ...
10 years, 3 months ago (2014-01-22 06:30:20 UTC) #7
brainman
Dmitriy, windows-race builder is still broken: ... BenchmarkReaderCopyOptimal-4 *** Test killed: ran too long (10m0s). ...
10 years, 3 months ago (2014-01-23 00:38:56 UTC) #8
dvyukov
10 years, 3 months ago (2014-01-23 10:10:16 UTC) #9
mailed
https://codereview.appspot.com/51360046/

for me it hangs even w/o -race, but with -cpu=4


On Thu, Jan 23, 2014 at 4:38 AM,  <alex.brainman@gmail.com> wrote:
> Dmitriy,
>
> windows-race builder is still broken:
>
> ...
> BenchmarkReaderCopyOptimal-4    *** Test killed: ran too long (10m0s).
> FAIL    bufio   600.010s
> ...
>
> Somehow it is getting wedged. I cannot reproduce it here on a small pc:
>
> c:\go\root\src\pkg\bufio>go test -race -run=nothingplease -bench=.*
> -benchtime=.1s -cpu=4
> PASS
> BenchmarkReaderCopyOptimal-4       10000             23347 ns/op
> BenchmarkReaderCopyUnoptimal-4      5000             45132 ns/op
> BenchmarkReaderCopyNoWriteTo-4      2000             87432 ns/op
> BenchmarkWriterCopyOptimal-4        2000             69359 ns/op
> BenchmarkWriterCopyUnoptimal-4     10000             43472 ns/op
> BenchmarkWriterCopyNoReadFrom-4     2000             69848 ns/op
> BenchmarkReaderEmpty-4     20000              8401 ns/op            4225
> B/op       3 allocs/op
> BenchmarkWriterEmpty-4     10000             12015 ns/op            4160
> B/op       2 allocs/op
> BenchmarkWriterFlush-4    200000               825 ns/op               0
> B/op       0 allocs/op
> ok      bufio   3.943s
>
> Alex
>
> https://codereview.appspot.com/44820047/
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b