Commit 9bec28d
committed
runtime: add goroutine labels to traceback/debug=2 headers
This is a small, self-contained patch to include goroutine labels in the debug=2/
traceback/runtime.Stack format goroutine dumps, as labels are extremely useful in
correlating a given goroutine with some user-facing operation or behavior.
We cannot directly import or use the pprof.labelMap type in the traceback code,
but we can cast to an equivalent type and iterate over it to print the labels.
This adds them to the header, eg. goroutine 123 [select, 7m, "foobar:1", "barbaz:abc"]:1 parent 370d2fb commit 9bec28d
2 files changed
+28
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1264 | 1264 | | |
1265 | 1265 | | |
1266 | 1266 | | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
1267 | 1270 | | |
1268 | 1271 | | |
1269 | 1272 | | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
1270 | 1284 | | |
1271 | 1285 | | |
1272 | 1286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
867 | 869 | | |
868 | 870 | | |
869 | 871 | | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
0 commit comments