Skip to content

Commit 05f3f57

Browse files
ghemawataalexand
andauthored
Made non-D3 flamegraph view the default. (google#777) (google#781)
In preparation for removing the dependency on D3 make the new flamegraph view the default. The old view is still available under /flamegraphold for now. See issue google#777. Co-authored-by: Alexey Alexandrov <[email protected]>
1 parent b71a70e commit 05f3f57

File tree

5 files changed

+23
-25
lines changed

5 files changed

+23
-25
lines changed

doc/README.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -431,15 +431,10 @@ Graph
431431
: Displays a scrollable/zoomable graph view; each function (or profile entry)
432432
is represented by a node and edges connect callers to callees.
433433

434-
Flame Graph
435-
: Displays a [flame graph](https://www.brendangregg.com/flamegraphs.html).
436-
437-
[Flame Graph (new)](#flame-graph)
438-
: Displays a view similar to a flame graph that can show the selected node's
439-
callers and callees simultaneously.
440-
441-
NOTE: This view is currently experimental and may eventually replace the normal
442-
Flame Graph view.
434+
[Flame Graph](#flame-graph)
435+
: Displays a view similar to a
436+
[flame graph](https://www.brendangregg.com/flamegraphs.html)
437+
that can show the selected node's callers and callees simultaneously.
443438

444439
Peek
445440
: Shows callers / callees per function in a simple textual forma.
@@ -473,8 +468,8 @@ prompting the user to confirm).
473468

474469
## Flame graph
475470

476-
The `Flame graph (new)` view displays profile information as a
477-
[flame graph](https://www.brendangregg.com/flamegraphs.html).
471+
The `Flame graph` view displays profile information as a [flame
472+
graph](https://www.brendangregg.com/flamegraphs.html).
478473

479474
Boxes on this view correspond to stack frames in the profile. Caller boxes are
480475
directly above callee boxes. The width of each box is proportional to the sum of

internal/driver/html/common.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,9 @@ function viewer(baseUrl, nodes, options) {
682682
toptable.addEventListener('touchstart', handleTopClick);
683683
}
684684

685-
const ids = ['topbtn', 'graphbtn', 'flamegraph', 'flamegraph2', 'peek', 'list',
685+
const ids = ['topbtn', 'graphbtn',
686+
'flamegraph', 'flamegraph2', 'flamegraphold',
687+
'peek', 'list',
686688
'disasm', 'focus', 'ignore', 'hide', 'show', 'show-from'];
687689
ids.forEach(makeSearchLinkDynamic);
688690

internal/driver/html/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h1><a href="./">pprof</a></h1>
1212
<a title="{{.Help.top}}" href="./top" id="topbtn">Top</a>
1313
<a title="{{.Help.graph}}" href="./" id="graphbtn">Graph</a>
1414
<a title="{{.Help.flamegraph}}" href="./flamegraph" id="flamegraph">Flame Graph</a>
15-
<a title="{{.Help.flamegraph2}}" href="./flamegraph2" id="flamegraph2">Flame Graph (new)</a>
15+
<a title="{{.Help.flamegraphold}}" href="./flamegraphold" id="flamegraphold">Flame Graph (old)</a>
1616
<a title="{{.Help.peek}}" href="./peek" id="peek">Peek</a>
1717
<a title="{{.Help.list}}" href="./source" id="list">Source</a>
1818
<a title="{{.Help.disasm}}" href="./disasm" id="disasm">Disassemble</a>

internal/driver/webui.go

+11-10
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func serveWebInterface(hostport string, p *profile.Profile, o *plugin.Options, d
112112
ui.help["details"] = "Show information about the profile and this view"
113113
ui.help["graph"] = "Display profile as a directed graph"
114114
ui.help["flamegraph"] = "Display profile as a flame graph"
115-
ui.help["flamegraph2"] = "Display profile as a flame graph (experimental version that can display caller info on selection)"
115+
ui.help["flamegraphold"] = "Display profile as a flame graph (old version; slated for removal)"
116116
ui.help["reset"] = "Show the entire profile"
117117
ui.help["save_config"] = "Save current settings"
118118

@@ -125,15 +125,16 @@ func serveWebInterface(hostport string, p *profile.Profile, o *plugin.Options, d
125125
Host: host,
126126
Port: port,
127127
Handlers: map[string]http.Handler{
128-
"/": http.HandlerFunc(ui.dot),
129-
"/top": http.HandlerFunc(ui.top),
130-
"/disasm": http.HandlerFunc(ui.disasm),
131-
"/source": http.HandlerFunc(ui.source),
132-
"/peek": http.HandlerFunc(ui.peek),
133-
"/flamegraph": http.HandlerFunc(ui.flamegraph),
134-
"/flamegraph2": http.HandlerFunc(ui.stackView), // Experimental
135-
"/saveconfig": http.HandlerFunc(ui.saveConfig),
136-
"/deleteconfig": http.HandlerFunc(ui.deleteConfig),
128+
"/": http.HandlerFunc(ui.dot),
129+
"/top": http.HandlerFunc(ui.top),
130+
"/disasm": http.HandlerFunc(ui.disasm),
131+
"/source": http.HandlerFunc(ui.source),
132+
"/peek": http.HandlerFunc(ui.peek),
133+
"/flamegraphold": http.HandlerFunc(ui.flamegraph),
134+
"/flamegraph": http.HandlerFunc(ui.stackView),
135+
"/flamegraph2": http.HandlerFunc(ui.stackView), // Support older URL
136+
"/saveconfig": http.HandlerFunc(ui.saveConfig),
137+
"/deleteconfig": http.HandlerFunc(ui.deleteConfig),
137138
"/download": http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
138139
w.Header().Set("Content-Type", "application/vnd.google.protobuf+gzip")
139140
w.Header().Set("Content-Disposition", "attachment;filename=profile.pb.gz")

internal/driver/webui_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func TestWebInterface(t *testing.T) {
9191
[]string{"300ms.*F1", "200ms.*300ms.*F2"}, false},
9292
{"/disasm?f=" + url.QueryEscape("F[12]"),
9393
[]string{"f1:asm", "f2:asm"}, false},
94-
{"/flamegraph", []string{
94+
{"/flamegraphold", []string{
9595
"File: testbin",
9696
// Check profile frame JSON is included.
9797
`\\u0022n\\u0022:\\u0022root\\u0022`,
@@ -101,7 +101,7 @@ func TestWebInterface(t *testing.T) {
101101
// Check d3-flame-graph CSS is included.
102102
".d3-flame-graph rect {",
103103
}, false},
104-
{"/flamegraph2", []string{
104+
{"/flamegraph", []string{
105105
"File: testbin",
106106
// Check that interesting frames are included.
107107
`\bF1\b`,

0 commit comments

Comments
 (0)