1
0
mirror of https://github.com/golang/go synced 2024-09-30 10:28:33 -06:00
The Go programming language
Go to file
Russ Cox 6969d9bf03 runtime/pprof: sort counted profiles by count
This is especially helpful in programs with very large numbers of goroutines:
the bulk of the goroutines will show up at the top.

Before:
	1 @ 0x86ab8 0x86893 0x82164 0x8e7ce 0x7b798 0x5b871
	#	0x86ab8	runtime/pprof.writeRuntimeProfile+0xb8		/Users/rsc/go/src/runtime/pprof/pprof.go:545
	#	0x86893	runtime/pprof.writeGoroutine+0x93		/Users/rsc/go/src/runtime/pprof/pprof.go:507
	#	0x82164	runtime/pprof.(*Profile).WriteTo+0xd4		/Users/rsc/go/src/runtime/pprof/pprof.go:236
	#	0x8e7ce	runtime/pprof_test.TestGoroutineCounts+0x15e	/Users/rsc/go/src/runtime/pprof/pprof_test.go:603
	#	0x7b798	testing.tRunner+0x98				/Users/rsc/go/src/testing/testing.go:473

	1 @ 0x2d373 0x2d434 0x560f 0x516b 0x7cd42 0x7b861 0x2297 0x2cf90 0x5b871
	#	0x7cd42	testing.RunTests+0x8d2	/Users/rsc/go/src/testing/testing.go:583
	#	0x7b861	testing.(*M).Run+0x81	/Users/rsc/go/src/testing/testing.go:515
	#	0x2297	main.main+0x117		runtime/pprof/_test/_testmain.go:72
	#	0x2cf90	runtime.main+0x2b0	/Users/rsc/go/src/runtime/proc.go:188

	10 @ 0x2d373 0x2d434 0x560f 0x516b 0x8e5b6 0x5b871
	#	0x8e5b6	runtime/pprof_test.func1+0x36	/Users/rsc/go/src/runtime/pprof/pprof_test.go:582

	50 @ 0x2d373 0x2d434 0x560f 0x516b 0x8e656 0x5b871
	#	0x8e656	runtime/pprof_test.func3+0x36	/Users/rsc/go/src/runtime/pprof/pprof_test.go:584

	40 @ 0x2d373 0x2d434 0x560f 0x516b 0x8e606 0x5b871
	#	0x8e606	runtime/pprof_test.func2+0x36	/Users/rsc/go/src/runtime/pprof/pprof_test.go:583

After:

	50 @ 0x2d373 0x2d434 0x560f 0x516b 0x8ecc6 0x5b871
	#	0x8ecc6	runtime/pprof_test.func3+0x36	/Users/rsc/go/src/runtime/pprof/pprof_test.go:584

	40 @ 0x2d373 0x2d434 0x560f 0x516b 0x8ec76 0x5b871
	#	0x8ec76	runtime/pprof_test.func2+0x36	/Users/rsc/go/src/runtime/pprof/pprof_test.go:583

	10 @ 0x2d373 0x2d434 0x560f 0x516b 0x8ec26 0x5b871
	#	0x8ec26	runtime/pprof_test.func1+0x36	/Users/rsc/go/src/runtime/pprof/pprof_test.go:582

	1 @ 0x2d373 0x2d434 0x560f 0x516b 0x7cd42 0x7b861 0x2297 0x2cf90 0x5b871
	#	0x7cd42	testing.RunTests+0x8d2	/Users/rsc/go/src/testing/testing.go:583
	#	0x7b861	testing.(*M).Run+0x81	/Users/rsc/go/src/testing/testing.go:515
	#	0x2297	main.main+0x117		runtime/pprof/_test/_testmain.go:72
	#	0x2cf90	runtime.main+0x2b0	/Users/rsc/go/src/runtime/proc.go:188

	1 @ 0x87128 0x86f03 0x82164 0x8ee30 0x7b798 0x5b871
	#	0x87128	runtime/pprof.writeRuntimeProfile+0xb8		/Users/rsc/go/src/runtime/pprof/pprof.go:566
	#	0x86f03	runtime/pprof.writeGoroutine+0x93		/Users/rsc/go/src/runtime/pprof/pprof.go:528
	#	0x82164	runtime/pprof.(*Profile).WriteTo+0xd4		/Users/rsc/go/src/runtime/pprof/pprof.go:236
	#	0x8ee30	runtime/pprof_test.TestGoroutineCounts+0x150	/Users/rsc/go/src/runtime/pprof/pprof_test.go:603
	#	0x7b798	testing.tRunner+0x98				/Users/rsc/go/src/testing/testing.go:473

Change-Id: I43de9eee2d96f9c46f7b0fbe099a0571164324f5
Reviewed-on: https://go-review.googlesource.com/20107
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-03-02 20:04:29 +00:00
.github doc: add issue and pull request templates 2016-02-26 03:16:55 +00:00
api go/types: rename Importer2 to ImporterFrom 2016-01-13 23:40:13 +00:00
doc doc: update release tag in source directions to go1.6 2016-03-01 02:02:10 +00:00
lib/time misc: update timezone database to IANA 2016a 2016-02-03 03:14:59 +00:00
misc misc/cgo/testsanitizers: don't run tsan tests on old clang 2016-03-01 00:56:14 +00:00
src runtime/pprof: sort counted profiles by count 2016-03-02 20:04:29 +00:00
test Merge branch 'dev.ssa' into mergebranch 2016-03-01 12:50:17 -08:00
.gitattributes .gitattributes: prevent all magic line ending changes 2014-12-12 23:14:54 +00:00
.gitignore .gitignore: ignore src/go/build/zcgo.go 2016-02-24 04:25:46 +00:00
AUTHORS A+C: manual updates 2016-01-08 06:02:39 +00:00
CONTRIBUTING.md doc: suggest security@golang.org for reporting security issues 2015-06-26 09:53:36 +00:00
CONTRIBUTORS A+C: manual updates 2016-01-08 06:02:39 +00:00
favicon.ico godoc: update favicon 2012-10-11 17:02:36 +11:00
LICENSE doc: update licensing text one more time 2012-03-27 15:09:13 +11:00
PATENTS
README.md readme: emphasize issue tracker is for bugs/proposals 2015-10-02 18:44:14 +00:00
robots.txt

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image

For documentation about how to install and use Go, visit https://golang.org/ or load doc/install-source.html in your web browser.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Go is the work of hundreds of contributors. We appreciate your help!

To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html

Note that we do not accept pull requests and that we use the issue tracker for bug reports and proposals only. Please ask questions on https://forum.golangbridge.org or https://groups.google.com/forum/#!forum/golang-nuts.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

--

Binary Distribution Notes

If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this file). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install-source.html). You should also add the Go binary directory $GOROOT/bin to your shell's path.

For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile:

export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin

See https://golang.org/doc/install or doc/install.html for more details.