• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..02-Nov-2018-

doc/H02-Nov-2018-374288

driver/H02-Nov-2018-282158

internal/H02-Nov-2018-12,3099,535

profile/H02-Nov-2018-7,4316,317

proto/H02-Nov-2018-184168

third_party/svg/H02-Nov-2018-372174

AUTHORSH A D26-Oct-2018305 77

CONTRIBUTINGH A D26-Oct-20181.4 KiB2824

CONTRIBUTORSH A D26-Oct-2018543 1513

LICENSEH A D26-Oct-201811.1 KiB203169

README.mdH A D26-Oct-20182.9 KiB8758

pprof.goH A D26-Oct-2018912 3212

README.md

1# Introduction
2
3pprof is a tool for visualization and analysis of profiling data.
4
5pprof reads a collection of profiling samples in profile.proto format and
6generates reports to visualize and help analyze the data. It can generate both
7text and graphical reports (through the use of the dot visualization package).
8
9profile.proto is a protocol buffer that describes a set of callstacks
10and symbolization information. A common usage is to represent a set of
11sampled callstacks from statistical profiling. The format is
12described on the [proto/profile.proto](./proto/profile.proto) file. For details on protocol
13buffers, see https://developers.google.com/protocol-buffers
14
15Profiles can be read from a local file, or over http. Multiple
16profiles of the same type can be aggregated or compared.
17
18If the profile samples contain machine addresses, pprof can symbolize
19them through the use of the native binutils tools (addr2line and nm).
20
21**This is not an official Google product.**
22
23# Building pprof
24
25Prerequisites:
26
27- Go development kit. Known to work with Go 1.5.
28  Follow [these instructions](http://golang.org/doc/code.html) to install the
29  go tool and set up GOPATH.
30
31- Graphviz: http://www.graphviz.org/
32  Optional, used to generate graphic visualizations of profiles
33
34To build and install it, use the `go get` tool.
35
36    go get github.com/google/pprof
37
38# Basic usage
39
40pprof can read a profile from a file or directly from a server via http.
41Specify the profile input(s) in the command line, and use options to
42indicate how to format the report.
43
44## Generate a text report of the profile, sorted by hotness:
45
46```
47% pprof -top [main_binary] profile.pb.gz
48Where
49    main_binary:  Local path to the main program binary, to enable symbolization
50    profile.pb.gz: Local path to the profile in a compressed protobuf, or
51                   URL to the http service that serves a profile.
52```
53
54## Generate a graph in an SVG file, and open it with a web browser:
55
56```
57pprof -web [main_binary] profile.pb.gz
58```
59
60## Run pprof on interactive mode:
61
62If no output formatting option is specified, pprof runs on interactive mode,
63where reads the profile and accepts interactive commands for visualization and
64refinement of the profile.
65
66```
67pprof [main_binary] profile.pb.gz
68
69This will open a simple shell that takes pprof commands to generate reports.
70Type 'help' for available commands/options.
71```
72
73## Using pprof with Linux Perf
74
75pprof can read `perf.data` files generated by the
76[Linux perf](https://perf.wiki.kernel.org/index.php) tool by using the
77`perf_to_profile` program from the
78[perf_data_converter](http://github.com/google/perf_data_converter) package.
79
80## Further documentation
81
82See [doc/pprof.md](doc/pprof.md) for more detailed end-user documentation.
83
84See [doc/developer/pprof.dev.md](doc/developer/pprof.dev.md) for developer documentation.
85
86See [doc/developer/profile.proto.md](doc/developer/profile.proto.md) for a description of the profile.proto format.
87