github.com/varialus/godfly@v0.0.0-20130904042352-1934f9f095ab/src/cmd/prof/doc.go (about)

     1  // Copyright 2009 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build ignore
     6  
     7  /*
     8  
     9  Prof is a rudimentary real-time profiler.
    10  
    11  Given a command to run or the process id (pid) of a command already
    12  running, it samples the program's state at regular intervals and reports
    13  on its behavior.  With no options, it prints a histogram of the locations
    14  in the code that were sampled during execution.
    15  
    16  Since it is a real-time profiler, unlike a traditional profiler it samples
    17  the program's state even when it is not running, such as when it is
    18  asleep or waiting for I/O.  Each thread contributes equally to the
    19  statistics.
    20  
    21  Usage:
    22  	go tool prof -p pid [-t total_secs] [-d delta_msec] [6.out args ...]
    23  
    24  The output modes (default -h) are:
    25  
    26  	-P file.prof:
    27  		Write the profile information to file.prof, in the format used by pprof.
    28  		At the moment, this only works on Linux amd64 binaries and requires that the
    29  		binary be written using 6l -e to produce ELF debug info.
    30  		See http://code.google.com/p/google-perftools for details.
    31  	-h: histograms
    32  		How many times a sample occurred at each location.
    33  	-f: dynamic functions
    34  		At each sample period, print the name of the executing function.
    35  	-l: dynamic file and line numbers
    36  		At each sample period, print the file and line number of the executing instruction.
    37  	-r: dynamic registers
    38  		At each sample period, print the register contents.
    39  	-s: dynamic function stack traces
    40  		At each sample period, print the symbolic stack trace.
    41  
    42  Flag -t sets the maximum real time to sample, in seconds, and -d
    43  sets the sampling interval in milliseconds.  The default is to sample
    44  every 100ms until the program completes.
    45  
    46  It is installed as go tool prof and is architecture-independent.
    47  
    48  */
    49  package main