diff --git a/goroutine-stack.excalidraw b/goroutine-stack.excalidraw new file mode 100644 index 0000000..3762939 --- /dev/null +++ b/goroutine-stack.excalidraw @@ -0,0 +1,1513 @@ +{ + "type": "excalidraw", + "version": 2, + "source": "https://excalidraw.com", + "elements": [ + { + "id": "-tilwVFl0bVKjP-ujOovv", + "type": "text", + "x": 899.1015625, + "y": 309.6796875, + "width": 193, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1357565986, + "version": 129, + "versionNonce": 1798956222, + "isDeleted": false, + "boundElementIds": null, + "text": "return address (pc)", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "OrQSZbLpX0DY32TPfeE1s", + "type": "text", + "x": 899.05859375, + "y": 351.2578125, + "width": 131, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 2099280866, + "version": 157, + "versionNonce": 1767001634, + "isDeleted": false, + "boundElementIds": null, + "text": "frame pointer", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "f1L2s-8bZHGsy3hAVIZMM", + "type": "line", + "x": 880.2578125, + "y": 342.58203125, + "width": 290.51953125, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 891989922, + "version": 79, + "versionNonce": 1180343550, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 290.51953125, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "VhliGF34bi79EFIeNSpcq", + "type": "line", + "x": 880.11328125, + "y": 381.1328125, + "width": 290.6328125, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 490236770, + "version": 98, + "versionNonce": 1474836962, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 290.6328125, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "jvQsJ2lSKwWYlzRfdy3Wh", + "type": "text", + "x": 897.51953125, + "y": 418.8125, + "width": 141, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 2073603874, + "version": 140, + "versionNonce": 624577854, + "isDeleted": false, + "boundElementIds": null, + "text": "local variables", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "1tdq4_bIX8CKQ6f05JzPZ", + "type": "line", + "x": 879.328125, + "y": 486.81640625, + "width": 289.609375, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 1958378210, + "version": 178, + "versionNonce": 624555390, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 289.609375, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "t4afkyHqhkgGJgEhjZ_JQ", + "type": "text", + "x": 900.26953125, + "y": 522.0625, + "width": 97, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1194118818, + "version": 308, + "versionNonce": 1537780066, + "isDeleted": false, + "boundElementIds": null, + "text": "arguments", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "Qd8i6oVI_mlM_YYGCP7BM", + "type": "line", + "x": 879.328125, + "y": 583.0546875, + "width": 289.609375, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 545474622, + "version": 209, + "versionNonce": 261789118, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 289.609375, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "icoxl-K2hGvm26t0AudO_", + "type": "text", + "x": 897.99609375, + "y": 588.1640625, + "width": 193, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 219335458, + "version": 214, + "versionNonce": 2002635938, + "isDeleted": false, + "boundElementIds": null, + "text": "return address (pc)", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "OJAhlQXimeySHdfCuTiLj", + "type": "line", + "x": 880.11328125, + "y": 621.93359375, + "width": 290.6328125, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 150030306, + "version": 161, + "versionNonce": 262948478, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 290.6328125, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "aGkSceWFkchSvI35bfPS7", + "type": "text", + "x": 899.05859375, + "y": 630.1953125, + "width": 131, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1852770750, + "version": 201, + "versionNonce": 1157621858, + "isDeleted": false, + "boundElementIds": null, + "text": "frame pointer", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "hx5BRllngdEOcNhzXamJ2", + "type": "line", + "x": 879.328125, + "y": 664.52734375, + "width": 289.609375, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 1766846370, + "version": 250, + "versionNonce": 2040186558, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 289.609375, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "OmmzCgB8661rxeoBD_m1W", + "type": "line", + "x": 878.4075520833333, + "y": 41.99440440900213, + "width": 0, + "height": 751.5995974668178, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 1645430654, + "version": 333, + "versionNonce": 392727586, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 751.5995974668178 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "Tp5z4aXMgu7xrROBPq61m", + "type": "line", + "x": 1169.765625, + "y": 41.51729490991488, + "width": 0, + "height": 761.4669406505653, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 1473325218, + "version": 336, + "versionNonce": 1515142910, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 761.4669406505653 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "1d9E2v-yaIMJR5f8mm_vu", + "type": "text", + "x": 1005.40625, + "y": 759.1480034722222, + "width": 22, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1561384382, + "version": 146, + "versionNonce": 1447735102, + "isDeleted": false, + "boundElementIds": null, + "text": "....", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "NPKP8QSAUMl9C8e3ZlID7", + "type": "line", + "x": 877.78515625, + "y": 303.35546875, + "width": 292.0625, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 127838818, + "version": 72, + "versionNonce": 208235426, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 292.0625, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "syqzluWxmz-NE8mrhudl2", + "type": "text", + "x": 880.0065104166667, + "y": -85.25217013888894, + "width": 293, + "height": 45, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 692837054, + "version": 316, + "versionNonce": 1508775806, + "isDeleted": false, + "boundElementIds": null, + "text": "Goroutine Stack", + "fontSize": 36, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 32 + }, + { + "id": "guDEtzKiU6ou4lv92SvTX", + "type": "text", + "x": 717.6914930555561, + "y": 50.63923611111119, + "width": 123, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 140835710, + "version": 432, + "versionNonce": 688967678, + "isDeleted": false, + "boundElementIds": [ + "TxE7oNEYJaS8t3rcdLQlt" + ], + "text": "high address", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "z5bhp7tVfHca1yjVWHg7q", + "type": "text", + "x": 722.2730902777784, + "y": 755.1171006944446, + "width": 127, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1285921250, + "version": 547, + "versionNonce": 1227011810, + "isDeleted": false, + "boundElementIds": [ + "TxE7oNEYJaS8t3rcdLQlt" + ], + "text": "low addresss", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "T3y__UGff5USKupeLYc6k", + "type": "text", + "x": 1289.6263888888898, + "y": 634.075, + "width": 186, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1584925922, + "version": 141, + "versionNonce": 1529711266, + "isDeleted": false, + "boundElementIds": [ + "KoNFG6D2UwOnInqP6scyw" + ], + "text": "rbp (CPU Register)", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "KoNFG6D2UwOnInqP6scyw", + "type": "arrow", + "x": 1276.4449652777787, + "y": 646.4994791666668, + "width": 97.04427083333371, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 395029666, + "version": 188, + "versionNonce": 1411901026, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + -97.04427083333371, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "TxE7oNEYJaS8t3rcdLQlt", + "type": "arrow", + "x": 776.7348958333336, + "y": 89.64097222222239, + "width": 1.3845998178826449, + "height": 656.3894852307242, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 1279642978, + "version": 820, + "versionNonce": 1333373118, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 1.3845998178826449, + 656.3894852307242 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "guDEtzKiU6ou4lv92SvTX", + "focus": 0.04083615781670036, + "gap": 14.0017361111112 + }, + "endBinding": { + "elementId": "z5bhp7tVfHca1yjVWHg7q", + "focus": -0.11976222857387889, + "gap": 9.086643241497995 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "gMCvQz3kAlikOWFyYp9h1", + "type": "text", + "x": 899.5876736111111, + "y": 49.97916666666665, + "width": 193, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1824441662, + "version": 222, + "versionNonce": 742864354, + "isDeleted": false, + "boundElementIds": null, + "text": "return address (pc)", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "nd2aujH4HrB228mGCMGeN", + "type": "text", + "x": 899.5447048611111, + "y": 91.27083333333337, + "width": 131, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 999678398, + "version": 265, + "versionNonce": 123277630, + "isDeleted": false, + "boundElementIds": null, + "text": "frame pointer", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "2Ryy3fd72z7APGOqfWytO", + "type": "line", + "x": 881.0303819444445, + "y": 82.59505208333337, + "width": 290.51953125, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 169295202, + "version": 172, + "versionNonce": 57289122, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 290.51953125, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "at_dzh07LmADZUxZhWKOR", + "type": "line", + "x": 880.5993923611111, + "y": 121.14583333333337, + "width": 290.6328125, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 1976805566, + "version": 190, + "versionNonce": 1591753086, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 290.6328125, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "LXvZCBS51l0CXzmtSYXn0", + "type": "text", + "x": 898.7738715277777, + "y": 158.86024305555554, + "width": 99, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 756780158, + "version": 373, + "versionNonce": 695772514, + "isDeleted": false, + "boundElementIds": null, + "text": "local vars", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "q9ysYPYbMiCcmZtv2vVXJ", + "type": "line", + "x": 879.8142361111111, + "y": 226.82942708333337, + "width": 289.609375, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 264187966, + "version": 270, + "versionNonce": 1138252222, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 289.609375, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "PDkk2Fq9FJJ6bZqt39fW-", + "type": "text", + "x": 898.3641493055555, + "y": 250.85590277777783, + "width": 97, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 2130452350, + "version": 459, + "versionNonce": 1203874082, + "isDeleted": false, + "boundElementIds": null, + "text": "arguments", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "1RvWKSXhiL6oJ2hEyuXr-", + "type": "line", + "x": 878.2712673611111, + "y": 43.368489583333336, + "width": 292.0625, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 1080551842, + "version": 164, + "versionNonce": 1298297342, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 292.0625, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "trQEtdmw81i1bPAfCCqbI", + "type": "text", + "x": 923.3737847222227, + "y": 820.3076388888892, + "width": 189, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 940795390, + "version": 172, + "versionNonce": 1155483810, + "isDeleted": false, + "boundElementIds": null, + "text": "\"Top\" of the Stack", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "qZS-hLMRA9x5fkuuK5-OT", + "type": "text", + "x": 616.4032986111115, + "y": 322.58541666666684, + "width": 141, + "height": 150, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 618095742, + "version": 729, + "versionNonce": 682621630, + "isDeleted": false, + "boundElementIds": null, + "text": "stacks grow\nfrom high to\nlow memory\naddresses for\nhistorical\nreasons.", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 143 + }, + { + "id": "iSBp6bbfXtVoFELhIM29b", + "type": "text", + "x": 1184.737065972223, + "y": 93.53463541666684, + "width": 399, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1587737022, + "version": 440, + "versionNonce": 1353072930, + "isDeleted": false, + "boundElementIds": [ + "05vm0VOe3NmovqFSN-J6Q" + ], + "text": "last frame pointer usually holds value 0", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "fITJohz9s2h0xtGVeUIq2", + "type": "text", + "x": 914.6194444444449, + "y": -3.8373263888885845, + "width": 225, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1274516322, + "version": 182, + "versionNonce": 757707746, + "isDeleted": false, + "boundElementIds": null, + "text": "\"Bottom\" of the Stack", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "QbrNxfRYs9hN3FePgvFhF", + "type": "text", + "x": 909.1514756944443, + "y": 694.828125, + "width": 99, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1104286754, + "version": 504, + "versionNonce": 1732961342, + "isDeleted": false, + "boundElementIds": null, + "text": "local vars", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "1GLPfUH8Z7W_t0PC9b3FR", + "type": "line", + "x": 877.4618055555557, + "y": 751.9709201388889, + "width": 289.609375, + "height": 0, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 121009086, + "version": 327, + "versionNonce": 846399138, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 289.609375, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null + }, + { + "id": "8tbPs-gfFPV1PLBeqJ0OY", + "type": "arrow", + "x": 1272.104253472223, + "y": 737.5782126006675, + "width": 90.72482638888914, + "height": 0.13515704511178228, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 1132364734, + "version": 176, + "versionNonce": 656387198, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + -90.72482638888914, + -0.13515704511178228 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "ETNZFcmww3iVo3JUw7ZIU", + "type": "text", + "x": 1282.2826388888896, + "y": 722.245138888889, + "width": 189, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 721763710, + "version": 162, + "versionNonce": 1310835170, + "isDeleted": false, + "boundElementIds": [ + "KoNFG6D2UwOnInqP6scyw", + "8tbPs-gfFPV1PLBeqJ0OY" + ], + "text": "rsp (CPU Register)", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "si2GNwgDzg7YPe4ANmQ2U", + "type": "arrow", + "x": 862.6723958333336, + "y": 642.7546874999996, + "width": 51.22265625, + "height": 271.69921875000006, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 751229502, + "version": 328, + "versionNonce": 1903154494, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + -43.3828125, + -28.109375 + ], + [ + -42.640625, + -235.93359375000006 + ], + [ + 7.83984375, + -271.69921875000006 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "ma97F_WLOzJl2N4GEXiTB", + "type": "arrow", + "x": 867.9692708333336, + "y": 358.7351562499996, + "width": 50, + "height": 256.69921875000006, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 464847586, + "version": 495, + "versionNonce": 2115085730, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + -43.3828125, + -28.109375 + ], + [ + -50, + -222.22265625000006 + ], + [ + -1.640625, + -256.69921875000006 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "Z5dHKyxlw7fA3Phl82Uxu", + "type": "arrow", + "x": 1177.5317708333337, + "y": 232.43828124999953, + "width": 42.13671875, + "height": 250.21484375, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "round", + "seed": 1326514850, + "version": 355, + "versionNonce": 1645092286, + "isDeleted": false, + "boundElementIds": null, + "points": [ + [ + 0, + 0 + ], + [ + 39.66796875, + 35.484375 + ], + [ + 41.23046875, + 219.77734375 + ], + [ + -0.90625, + 250.21484375 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": "arrow", + "endArrowhead": "arrow" + }, + { + "id": "V6I1c9v3y8WHm3cF6I_nT", + "type": "text", + "x": 1238.9966145833337, + "y": 348.70390624999953, + "width": 126, + "height": 50, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 143546558, + "version": 228, + "versionNonce": 764907582, + "isDeleted": false, + "boundElementIds": null, + "text": "Stack Frame\n", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 43 + }, + { + "id": "viDIbEoL1cjGl9Or1jVQk", + "type": "text", + "x": 1182.588628472223, + "y": 51.233854166666845, + "width": 676, + "height": 25, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1625361314, + "version": 570, + "versionNonce": 229460258, + "isDeleted": false, + "boundElementIds": [ + "shedVB8WMbAHN6r_PcXqN", + "eVe0CAodN6w0ejuLaSyw4" + ], + "text": "last return address points into runtime internals written in assembly", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 18 + }, + { + "id": "Owca-nOyQKbE8BFlBxKxt", + "type": "text", + "x": 1183.5044270833337, + "y": 509.6257812499996, + "width": 386, + "height": 50, + "angle": 0, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "strokeSharpness": "sharp", + "seed": 1563887778, + "version": 195, + "versionNonce": 1505704226, + "isDeleted": false, + "boundElementIds": null, + "text": "Unlike C/C++ Go passes all arguments\non stack instead of using registers", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "left", + "verticalAlign": "top", + "baseline": 43 + } + ], + "appState": { + "gridSize": null, + "viewBackgroundColor": "#ffffff" + } +} \ No newline at end of file diff --git a/goroutine-stack.png b/goroutine-stack.png new file mode 100644 index 0000000..2c05712 Binary files /dev/null and b/goroutine-stack.png differ diff --git a/stack-traces.md b/stack-traces.md new file mode 100644 index 0000000..4c4ddbd --- /dev/null +++ b/stack-traces.md @@ -0,0 +1,60 @@ +# Stack Traces in Go + +Stack traces play a critical role in Go profiling. So let's try to understand them to see how they might impact the overhead and accuracy of your profiles. + +## Introduction + +All Go profilers work by collecting samples of stack trace and putting them into [pprof profiles](./pprof.md). Ignoring some details, a pprof profile is just a frequency table of stack traces like shown below: + +| stack trace | samples/count | +| ------------ | ------------- | +| main;foo | 5 | +| main;foo;bar | 3 | +| main;foobar | 4 | + +Let's zoom in on the second stack trace in the table above: `main;foo;bar`. A Go developer will usually be more familiar with seeing a stack trace like this as rendered by `panic()` or [`runtime.Stack()`](https://golang.org/pkg/runtime/#Stack) shown below: + +``` +goroutine 1 [running]: +main.bar(...) + /path/to/go-profiler-notes/examples/stack-trace/main.go:17 +main.foo(...) + /path/to/go-profiler-notes/examples/stack-trace/main.go:9 +main.main() + /path/to/go-profiler-notes/examples/stack-trace/main.go:5 +0x3a +``` + +This text format has been [described elsewhere](https://www.ardanlabs.com/blog/2015/01/stack-traces-in-go.html) so we won't discuss the details of it here. Instead we'll dive even deeper and ask ourselves where this data is coming from. + +## Goroutine Stack + +Stack traces + +![](./goroutine-stack.png) + +## Stack Unwinding + +### Frame Pointers + +To write ... + +### .gopclntab + +To write ... + +### DWARF + +To write ... + +## Symbolization + +Woho + +## Overhead + +To write ... + + +## Accuracy + +To write ... \ No newline at end of file