From dc62c66c73d097340803fd3dc4627746385ca9e7 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 3 Nov 2009 17:46:35 -0800 Subject: [PATCH] more command documentation, including nm and prof R=rsc http://go/go-review/1017022 --- src/cmd/5l/doc.go | 2 +- src/cmd/6l/doc.go | 2 +- src/cmd/8l/doc.go | 2 +- src/cmd/cc/doc.go | 11 +++++++++++ src/cmd/ld/doc.go | 11 +++++++++++ src/cmd/nm/doc.go | 18 ++++++++++++++++++ src/cmd/prof/doc.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 src/cmd/cc/doc.go create mode 100644 src/cmd/ld/doc.go create mode 100644 src/cmd/nm/doc.go create mode 100644 src/cmd/prof/doc.go diff --git a/src/cmd/5l/doc.go b/src/cmd/5l/doc.go index 1d22e3907f4..17200d57cd1 100644 --- a/src/cmd/5l/doc.go +++ b/src/cmd/5l/doc.go @@ -4,7 +4,7 @@ /* -5l is a modified version of the Plan 9 loader documented at +5l is a modified version of the Plan 9 linker documented at http://plan9.bell-labs.com/magic/man2html/1/2l diff --git a/src/cmd/6l/doc.go b/src/cmd/6l/doc.go index 331d0c1d99b..8d87f820ef5 100644 --- a/src/cmd/6l/doc.go +++ b/src/cmd/6l/doc.go @@ -4,7 +4,7 @@ /* -6l is a modified version of the Plan 9 loader documented at +6l is a modified version of the Plan 9 linker documented at http://plan9.bell-labs.com/magic/man2html/1/2l diff --git a/src/cmd/8l/doc.go b/src/cmd/8l/doc.go index 82796d26fc5..36628045c5b 100644 --- a/src/cmd/8l/doc.go +++ b/src/cmd/8l/doc.go @@ -4,7 +4,7 @@ /* -8l is a modified version of the Plan 9 loader documented at +8l is a modified version of the Plan 9 linker documented at http://plan9.bell-labs.com/magic/man2html/1/2l diff --git a/src/cmd/cc/doc.go b/src/cmd/cc/doc.go new file mode 100644 index 00000000000..c9244959187 --- /dev/null +++ b/src/cmd/cc/doc.go @@ -0,0 +1,11 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + +This directory contains the portable section of the Plan 9 C compilers as +represented here. See ../6c, ../8c, and ../5c for more information. + +*/ +package documentation diff --git a/src/cmd/ld/doc.go b/src/cmd/ld/doc.go new file mode 100644 index 00000000000..efdba719fee --- /dev/null +++ b/src/cmd/ld/doc.go @@ -0,0 +1,11 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + +This directory contains the portable section of the Plan 9 C linkers as +represented here. See ../6l, ../8l, and ../5l for more information. + +*/ +package documentation diff --git a/src/cmd/nm/doc.go b/src/cmd/nm/doc.go new file mode 100644 index 00000000000..5c171797b08 --- /dev/null +++ b/src/cmd/nm/doc.go @@ -0,0 +1,18 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + +nm is a version of the Plan 9 nm command documented at + + http://plan9.bell-labs.com/magic/man2html/1/nm + +It prints the name list (symbol table) for programs compiled by gc as well as the +Plan 9 C compiler. + +For reasons of disambiguation it is installed as 6nm although it also serves +as an 8nm and a 5nm. + +*/ +package documentation diff --git a/src/cmd/prof/doc.go b/src/cmd/prof/doc.go new file mode 100644 index 00000000000..8b2732ab3c0 --- /dev/null +++ b/src/cmd/prof/doc.go @@ -0,0 +1,43 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + +prof is a rudimentary real-time profiler. + +Given a command to run or the process id (pid) of a command already +running, it samples the program's state at regular intervals and reports +on its behavior. With no options, it prints a histogram of the locations +in the code that were sampled during execution. + +Since it is a real-time profiler, unlike a traditional profiler it samples +the program's state even when it is not running, such as when it is +asleep or waiting for I/O. Each thread contributes equally to the +statistics. + + +Usage: prof -p pid [-t total_secs] [-d delta_msec] [6.out args ...] + +The formats (default -h) are: + + -h: histograms + How many times a sample occurred at each location + -f: dynamic functions + At each sample period, print the name of the executing function. + -l: dynamic file and line numbers + At each sample period, print the file and line number of the executing instruction. + -r: dynamic registers + At each sample period, print the register contents. + -s: dynamic function stack traces + At each sample period, print the symbolic stack trace. + +Flag -t sets the maximum real time to sample, in seconds, and -d +sets the sampling interval in milliseconds. The default is to sample +every 100ms until the program completes. + +For reasons of disambiguation it is installed as 6prof although it also serves +as an 8prof and a 5prof. + +*/ +package documentation