| 1 |
<!DOCTYPE html> |
| 2 |
|
| 3 |
{{- /* Join a list */ -}} |
| 4 |
{{- define "Join" -}} |
| 5 |
{{- if . -}} |
| 6 |
{{- $l := len . -}} |
| 7 |
{{- $last := minus $l 1 -}} |
| 8 |
{{- range $i, $e := . -}} |
| 9 |
{{- $e -}} |
| 10 |
{{- $isNotLast := ne $i $last -}} |
| 11 |
{{- if $isNotLast}}, {{end -}} |
| 12 |
{{- end -}} |
| 13 |
{{- end -}} |
| 14 |
{{- end -}} |
| 15 |
|
| 16 |
{{- /* Accepts a Args */ -}} |
| 17 |
{{- define "RenderArgs" -}} |
| 18 |
<span class="args"><span> |
| 19 |
{{- $elided := .Elided -}} |
| 20 |
{{- if .Processed -}} |
| 21 |
{{- $l := len .Processed -}} |
| 22 |
{{- $last := minus $l 1 -}} |
| 23 |
{{- range $i, $e := .Processed -}} |
| 24 |
{{- $e -}} |
| 25 |
{{- $isNotLast := ne $i $last -}} |
| 26 |
{{- if or $elided $isNotLast}}, {{end -}} |
| 27 |
{{- end -}} |
| 28 |
{{- else -}} |
| 29 |
{{- $l := len .Values -}} |
| 30 |
{{- $last := minus $l 1 -}} |
| 31 |
{{- range $i, $e := .Values -}} |
| 32 |
{{- $e.String -}} |
| 33 |
{{- $isNotLast := ne $i $last -}} |
| 34 |
{{- if or $elided $isNotLast}}, {{end -}} |
| 35 |
{{- end -}} |
| 36 |
{{- end -}} |
| 37 |
{{- if $elided}}…{{end -}} |
| 38 |
</span></span> |
| 39 |
{{- end -}} |
| 40 |
|
| 41 |
{{- /* Accepts a Call */ -}} |
| 42 |
{{- define "RenderCreatedBy" -}} |
| 43 |
<span class="call hastooltip"><span class="tooltip"> |
| 44 |
{{- if and .LocalSrcPath (ne .RemoteSrcPath .LocalSrcPath) -}} |
| 45 |
RemoteSrcPath: {{.RemoteSrcPath}} |
| 46 |
<br>LocalSrcPath: {{.LocalSrcPath}} |
| 47 |
{{- else -}} |
| 48 |
SrcPath: {{.RemoteSrcPath}} |
| 49 |
{{- end -}} |
| 50 |
<br>Func: {{.Func.Complete}} |
| 51 |
<br>Location: {{.Location}} |
| 52 |
</span><a href="{{srcURL .}}">{{.SrcName}}:{{.Line}}</a> <span class="{{funcClass .}}"> |
| 53 |
<a href="{{pkgURL .}}">{{.Func.DirName}}.{{.Func.Name}}</a></span>() |
| 54 |
</span> |
| 55 |
{{- end -}} |
| 56 |
|
| 57 |
{{- /* Accepts a Stack */ -}} |
| 58 |
{{- define "RenderCalls" -}} |
| 59 |
<table class="stack"> |
| 60 |
{{- range $i, $e := .Calls -}} |
| 61 |
<tr> |
| 62 |
<td>{{$i}}</td> |
| 63 |
<td> |
| 64 |
<a href="{{pkgURL $e}}">{{$e.Func.DirName}}</a> |
| 65 |
</td> |
| 66 |
<td class="hastooltip"> |
| 67 |
<span class="tooltip"> |
| 68 |
{{- if and $e.LocalSrcPath (ne $e.RemoteSrcPath $e.LocalSrcPath) -}} |
| 69 |
RemoteSrcPath: {{$e.RemoteSrcPath}} |
| 70 |
<br>LocalSrcPath: {{$e.LocalSrcPath}} |
| 71 |
{{- else -}} |
| 72 |
SrcPath: {{$e.RemoteSrcPath}} |
| 73 |
{{- end -}} |
| 74 |
<br>Func: {{$e.Func.Complete}} |
| 75 |
<br>Location: {{$e.Location}} |
| 76 |
</span> |
| 77 |
<a href="{{srcURL $e}}">{{$e.SrcName}}:{{$e.Line}}</a> |
| 78 |
</td> |
| 79 |
<td> |
| 80 |
<span class="{{funcClass $e}}"><a href="{{pkgURL $e}}">{{$e.Func.Name}}</a></span>({{template "RenderArgs" $e.Args}}) |
| 81 |
</td> |
| 82 |
</tr> |
| 83 |
{{- end -}} |
| 84 |
{{- if .Elided}}<tr><td>(…)</td><tr>{{end -}} |
| 85 |
</table> |
| 86 |
{{- end -}} |
| 87 |
|
| 88 |
<meta charset="UTF-8"> |
| 89 |
<meta name="author" content="Marc-Antoine Ruel" > |
| 90 |
<meta name="generator" content="https://github.com/maruel/panicparse" > |
| 91 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 92 |
<title>PanicParse</title> |
| 93 |
<link rel="shortcut icon" type="image/gif" href="data:image/gif;base64,{{.Favicon}}"/> |
| 94 |
<style> |
| 95 |
{{- /* Minimal CSS reset */ -}} |
| 96 |
* { |
| 97 |
font-family: inherit; |
| 98 |
font-size: 1em; |
| 99 |
margin: 0; |
| 100 |
padding: 0; |
| 101 |
} |
| 102 |
html { |
| 103 |
box-sizing: border-box; |
| 104 |
font-size: 62.5%; |
| 105 |
} |
| 106 |
*, *:before, *:after { |
| 107 |
box-sizing: inherit; |
| 108 |
} |
| 109 |
h1, h2 { |
| 110 |
margin-bottom: 0.2em; |
| 111 |
margin-top: 0.8em; |
| 112 |
} |
| 113 |
h1 { |
| 114 |
font-size: 1.4em; |
| 115 |
} |
| 116 |
h2 { |
| 117 |
font-size: 1.2em; |
| 118 |
} |
| 119 |
body { |
| 120 |
font-size: 1.6em; |
| 121 |
margin: 2px; |
| 122 |
} |
| 123 |
li { |
| 124 |
margin-left: 2.5em; |
| 125 |
} |
| 126 |
a { |
| 127 |
color: inherit; |
| 128 |
text-decoration: inherit; |
| 129 |
} |
| 130 |
ol, ul { |
| 131 |
margin-bottom: 0.5em; |
| 132 |
margin-top: 0.5em; |
| 133 |
} |
| 134 |
p { |
| 135 |
margin-bottom: 2em; |
| 136 |
} |
| 137 |
table { |
| 138 |
margin: 0.6em; |
| 139 |
} |
| 140 |
table tr:nth-child(odd) { |
| 141 |
background-color: #F0F0F0; |
| 142 |
} |
| 143 |
table tr:hover { |
| 144 |
background-color: #DDD !important; |
| 145 |
} |
| 146 |
table td { |
| 147 |
font-family: monospace; |
| 148 |
padding: 0.2em 0.4em 0.2em; |
| 149 |
} |
| 150 |
.call { |
| 151 |
font-family: monospace; |
| 152 |
} |
| 153 |
@media screen and (max-width: 500px) { |
| 154 |
h1 { |
| 155 |
font-size: 1.3em; |
| 156 |
} |
| 157 |
} |
| 158 |
@media screen and (max-width: 500px) and (orientation: portrait) { |
| 159 |
.args span { |
| 160 |
display: none; |
| 161 |
} |
| 162 |
.args::after { |
| 163 |
content: '…'; |
| 164 |
} |
| 165 |
} |
| 166 |
.created { |
| 167 |
white-space: nowrap; |
| 168 |
} |
| 169 |
.race { |
| 170 |
font-weight: 700; |
| 171 |
color: #600; |
| 172 |
} |
| 173 |
#content { |
| 174 |
width: 100%; |
| 175 |
} |
| 176 |
.hastooltip:hover .tooltip { |
| 177 |
background: #fffAF0; |
| 178 |
border: 1px solid #DCA; |
| 179 |
border-radius: 6px; |
| 180 |
box-shadow: 5px 5px 8px #CCC; |
| 181 |
color: #111; |
| 182 |
display: inline; |
| 183 |
position: absolute; |
| 184 |
} |
| 185 |
.tooltip { |
| 186 |
display: none; |
| 187 |
line-height: 16px; |
| 188 |
margin-left: 1rem; |
| 189 |
margin-top: 2.5rem; |
| 190 |
padding: 1rem; |
| 191 |
z-index: 10; |
| 192 |
} |
| 193 |
.bottom-padding { |
| 194 |
margin-top: 5em; |
| 195 |
} |
| 196 |
|
| 197 |
{{- /* Highlights based on stack.Location value. */ -}} |
| 198 |
.FuncMain { |
| 199 |
color: #880; |
| 200 |
} |
| 201 |
.FuncLocationUnknown { |
| 202 |
color: #888; |
| 203 |
} |
| 204 |
.FuncGoMod { |
| 205 |
color: #800; |
| 206 |
} |
| 207 |
.FuncGOPATH { |
| 208 |
color: #109090; |
| 209 |
} |
| 210 |
.FuncGoPkg { |
| 211 |
color: #008; |
| 212 |
} |
| 213 |
.FuncStdlib { |
| 214 |
color: #080; |
| 215 |
} |
| 216 |
.Exported { |
| 217 |
font-weight: 700; |
| 218 |
} |
| 219 |
</style> |
| 220 |
<div id="content"> |
| 221 |
{{- if .Aggregated -}} |
| 222 |
{{- range $i, $e := .Aggregated.Buckets -}} |
| 223 |
{{$l := len $e.IDs}} |
| 224 |
<h1>Signature #{{$i}}: {{$l}} routine{{if ne 1 $l}}s{{end}}: <span class="state">{{$e.State}}</span> |
| 225 |
{{- if $e.SleepMax -}} |
| 226 |
{{- if ne $e.SleepMin $e.SleepMax}} <span class="sleep">[{{$e.SleepMin}}~{{$e.SleepMax}} mins]</span> |
| 227 |
{{- else}} <span class="sleep">[{{$e.SleepMax}} mins]</span> |
| 228 |
{{- end -}} |
| 229 |
{{- end -}} |
| 230 |
</h1> |
| 231 |
{{if $e.Locked}} <span class="locked">[locked]</span> |
| 232 |
{{- end -}} |
| 233 |
{{- if $e.CreatedBy.Calls}} <span class="created">Created by: {{template "RenderCreatedBy" index $e.CreatedBy.Calls 0}}</span> |
| 234 |
{{- end -}} |
| 235 |
{{template "RenderCalls" $e.Signature.Stack}} |
| 236 |
{{- end -}} |
| 237 |
{{- else -}} |
| 238 |
{{- range $i, $e := .Snapshot.Goroutines -}} |
| 239 |
<h1>Routine {{$e.ID}}: <span class="state">{{$e.State}}</span> |
| 240 |
{{- if $e.SleepMax -}} |
| 241 |
{{- if ne $e.SleepMin $e.SleepMax}} <span class="sleep">[{{$e.SleepMin}}~{{$e.SleepMax}} mins]</span> |
| 242 |
{{- else}} <span class="sleep">[{{$e.SleepMax}} mins]</span> |
| 243 |
{{- end -}} |
| 244 |
{{- end -}} |
| 245 |
</h1> |
| 246 |
{{if $e.Locked}} <span class="locked">[locked]</span> |
| 247 |
{{- end -}} |
| 248 |
{{if $e.RaceAddr}} <span class="race">Race {{if $e.RaceWrite}}write{{else}}read{{end}} @ {{printf "0x%08X" $e.RaceAddr}}</span><br> |
| 249 |
{{- end -}} |
| 250 |
{{- if $e.CreatedBy.Calls}} <span class="created">Created by: {{template "RenderCreatedBy" index $e.CreatedBy.Calls 0}}</span> |
| 251 |
{{- end -}} |
| 252 |
{{template "RenderCalls" $e.Signature.Stack}} |
| 253 |
{{- end -}} |
| 254 |
{{- end -}} |
| 255 |
</div> |
| 256 |
<h2>Metadata</h2> |
| 257 |
<ul> |
| 258 |
<li>Created on {{.Now.String}}</li> |
| 259 |
<li>{{.Version}}</li> |
| 260 |
{{- if and .Snapshot.LocalGOROOT (ne .Snapshot.RemoteGOROOT .Snapshot.LocalGOROOT) -}} |
| 261 |
<li>GOROOT (remote): {{.Snapshot.RemoteGOROOT}}</li> |
| 262 |
<li>GOROOT (local): {{.Snapshot.LocalGOROOT}}</li> |
| 263 |
{{- else -}} |
| 264 |
<li>GOROOT: {{.Snapshot.RemoteGOROOT}}</li> |
| 265 |
{{- end -}} |
| 266 |
<li>GOPATH: {{template "Join" .Snapshot.LocalGOPATHs}}</li> |
| 267 |
{{- if .Snapshot.LocalGomods -}} |
| 268 |
<li>go modules (local): |
| 269 |
<ul> |
| 270 |
{{- range $path, $import := .Snapshot.LocalGomods -}} |
| 271 |
<li>{{$path}}: {{$import}}</li> |
| 272 |
{{- end -}} |
| 273 |
</ul> |
| 274 |
</li> |
| 275 |
{{- end -}} |
| 276 |
<li>GOMAXPROCS: {{.GOMAXPROCS}}</li> |
| 277 |
</ul> |
| 278 |
<h2>Legend</h2> |
| 279 |
<table class="legend"> |
| 280 |
<thead> |
| 281 |
<th>Type</th> |
| 282 |
<th>Exported</th> |
| 283 |
<th>Private</th> |
| 284 |
</thead> |
| 285 |
<tr class="call hastooltip"> |
| 286 |
<td> |
| 287 |
Package main |
| 288 |
<span class="tooltip">Sources that are in the main package.</span> |
| 289 |
</td> |
| 290 |
<td class="FuncMain">main.Foo()</td> |
| 291 |
<td class="FuncMain">main.foo()</td> |
| 292 |
</tr> |
| 293 |
<tr class="call hastooltip"> |
| 294 |
<td> |
| 295 |
Go module |
| 296 |
<span class="tooltip">Sources located inside a directory containing a |
| 297 |
<strong>go.mod</strong> file but outside $GOPATH.</span> |
| 298 |
</td> |
| 299 |
<td class="FuncGoMod Exported">pkg.Foo()</td> |
| 300 |
<td class="FuncGoMod">pkg.foo()</td> |
| 301 |
</tr> |
| 302 |
<tr class="call hastooltip"> |
| 303 |
<td> |
| 304 |
$GOPATH/src/... |
| 305 |
<span class="tooltip">Sources located inside the traditional $GOPATH/src |
| 306 |
directory.</span> |
| 307 |
</td> |
| 308 |
<td class="FuncGOPATH Exported">pkg.Foo()</td> |
| 309 |
<td class="FuncGOPATH">pkg.foo()</td> |
| 310 |
</tr> |
| 311 |
<tr class="call hastooltip"> |
| 312 |
<td> |
| 313 |
$GOPATH/pkg/mod/... |
| 314 |
<span class="tooltip">Sources located inside the go module dependency |
| 315 |
cache under $GOPATH/pkg/mod. These files are unmodified third parties.</span> |
| 316 |
</td> |
| 317 |
<td class="FuncGoPkg Exported">pkg.Foo()</td> |
| 318 |
<td class="FuncGoPkg">pkg.foo()</td> |
| 319 |
</tr> |
| 320 |
<tr class="call hastooltip"> |
| 321 |
<td> |
| 322 |
Standard library |
| 323 |
<span class="tooltip">Sources from the Go standard library under |
| 324 |
$GOROOT/src/.</span> |
| 325 |
</td> |
| 326 |
<td class="FuncStdlib Exported">pkg.Foo()</td> |
| 327 |
<td class="FuncStdlib">pkg.foo()</td> |
| 328 |
</tr> |
| 329 |
<tr class="call hastooltip"> |
| 330 |
<td> |
| 331 |
Unknown source location |
| 332 |
<span class="tooltip">Sources which location was not successfully |
| 333 |
determined.</span> |
| 334 |
</td> |
| 335 |
<td class="FuncLocationUnknown Exported">pkg.Foo()</td> |
| 336 |
<td class="FuncLocationUnknown">pkg.foo()</td> |
| 337 |
</tr> |
| 338 |
</table> |
| 339 |
{{- .Footer -}} |
| 340 |
{{- /* Add unnecessary bottom spacing so the last tooltip from the legend is visible. */ -}} |
| 341 |
<div class="bottom-padding"></div> |