]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: better documentation about profiling
authorRob Pike <r@golang.org>
Wed, 13 Mar 2013 20:56:51 +0000 (13:56 -0700)
committerRob Pike <r@golang.org>
Wed, 13 Mar 2013 20:56:51 +0000 (13:56 -0700)
Point the user to "go tool pprof" and mention some
important flags.

Fixes #4990.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7657045

src/cmd/go/doc.go
src/cmd/go/test.go

index bf5be6ad029ccf621bdf13b2aca9cccf4342bf29..eab54abe62812a91c5895c6780e82b148702abf8 100644 (file)
@@ -685,6 +685,11 @@ Description of testing flags
 The 'go test' command takes both flags that apply to 'go test' itself
 and flags that apply to the resulting test binary.
 
+Several of the flags control profiling and write an execution profile
+suitable for "go tool pprof"; run "go tool pprof help" for more
+information.  The --alloc_space, --alloc_objects, and --show_bytes
+options of pprof control how the information is presented.
+
 The following flags are recognized by the 'go test' command and
 control the execution of any test:
 
@@ -722,8 +727,8 @@ control the execution of any test:
            Write a CPU profile to the specified file before exiting.
 
        -memprofile mem.out
-           Write a memory profile to the specified file when all tests
-           are complete.
+           Write a memory profile to the specified file after all tests
+           have passed.
 
        -memprofilerate n
            Enable more precise (and expensive) memory profiles by setting
index 3132ab2100f1acb6c7c39159aebf02a478fd2bde..de69efe8f26641ca16ef116410db182b28d969d3 100644 (file)
@@ -81,6 +81,11 @@ var helpTestflag = &Command{
 The 'go test' command takes both flags that apply to 'go test' itself
 and flags that apply to the resulting test binary.
 
+Several of the flags control profiling and write an execution profile
+suitable for "go tool pprof"; run "go tool pprof help" for more
+information.  The --alloc_space, --alloc_objects, and --show_bytes
+options of pprof control how the information is presented.
+
 The following flags are recognized by the 'go test' command and
 control the execution of any test:
 
@@ -118,8 +123,8 @@ control the execution of any test:
            Write a CPU profile to the specified file before exiting.
 
        -memprofile mem.out
-           Write a memory profile to the specified file when all tests
-           are complete.
+           Write a memory profile to the specified file after all tests
+           have passed.
 
        -memprofilerate n
            Enable more precise (and expensive) memory profiles by setting