Commit 41646b1
committed
kern: stack watermark support
Each task has grown a new field, `low_stack_pointer`, that tracks the
lowest stack pointer value seen so far (because stacks grow down). We
update this value on any kernel entry (interrupt, timer, fault,
syscall), so while we will miss very brief excursions of stack _between_
syscalls or interrupts, we should still get a useful value.
In addition, the field `past_low_stack_pointer` tracks the lowest stack
pointer value across _all previous incarnations_ of the task. This way
if the task is periodically restarting, we can still get useful stack
stats, including at stack overflow.1 parent 874c3b8 commit 41646b1
4 files changed
+74
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
939 | 950 | | |
940 | 951 | | |
941 | 952 | | |
| |||
1108 | 1119 | | |
1109 | 1120 | | |
1110 | 1121 | | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1111 | 1131 | | |
1112 | 1132 | | |
1113 | 1133 | | |
| |||
1406 | 1426 | | |
1407 | 1427 | | |
1408 | 1428 | | |
1409 | | - | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
1410 | 1435 | | |
1411 | 1436 | | |
1412 | 1437 | | |
| |||
1534 | 1559 | | |
1535 | 1560 | | |
1536 | 1561 | | |
1537 | | - | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1538 | 1568 | | |
1539 | 1569 | | |
1540 | 1570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
52 | 66 | | |
53 | 67 | | |
54 | 68 | | |
| |||
69 | 83 | | |
70 | 84 | | |
71 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
| |||
321 | 339 | | |
322 | 340 | | |
323 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
324 | 349 | | |
325 | 350 | | |
326 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
327 | 364 | | |
328 | 365 | | |
329 | 366 | | |
| |||
0 commit comments