Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add callgraph examples to README.md #528

Merged
merged 24 commits into from
Apr 29, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 36 additions & 5 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ in a browser to see the interface.

The objective of pprof is to generate a report for a profile. The report is
generated from a location hierarchy, which is reconstructed from the profile
samples. Each location contains two values: *flat* is the value of the location
itself, while *cum* is the value of the location plus all its
descendants. Samples that include a location multiple times (eg for recursive
functions) are counted only once per location.
samples. Each location contains two values:

* *flat*: the value of the location itself.
* *cum*: the value of the location plus all its descendants.

Samples that include a location multiple times (eg for recursive functions)
wyk9787 marked this conversation as resolved.
Show resolved Hide resolved
are counted only once per location.

## Options

Expand Down Expand Up @@ -189,7 +192,35 @@ paths with the highest cum weight.
* **-svg:** Generates a report in SVG format.
* **-web:** Generates a report in SVG format on a temp file, and starts a web
browser to view it.
* **-png, -jpg, -gif, -pdf:** Generates a report in these formats,
* **-png, -jpg, -gif, -pdf:** Generates a report in these formats.

### Interpreting the Nodes

![callgraph1](images/callgraph_nodes.svg)
wyk9787 marked this conversation as resolved.
Show resolved Hide resolved

* _cum_ value is indiated by the nodes' color.
wyk9787 marked this conversation as resolved.
Show resolved Hide resolved
wyk9787 marked this conversation as resolved.
Show resolved Hide resolved

* Redder nodes have larger total values.
wyk9787 marked this conversation as resolved.
Show resolved Hide resolved
* Greyer nodes have smaller total values.

* _flat_ value is indicated by the font size.

* Nodes with larger text have larger self values.
* Nodes with smaller text have smaller self values.


### Interpreting the Edges

![callgraph2](images/callgraph_edges.svg)

* **Dashed Edges**: some locations between two connected locations were
wyk9787 marked this conversation as resolved.
Show resolved Hide resolved
removed.

wyk9787 marked this conversation as resolved.
Show resolved Hide resolved
* **Solid Edges**: one location directly calls the other.

* **Thicker & Redder Edges**: more resources were along that path.
wyk9787 marked this conversation as resolved.
Show resolved Hide resolved

* **Thinner & Greyer Edges**: less resources were along that path.

## Annotated code

Expand Down