summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authordzwdz2022-05-03 19:18:28 +0200
committerdzwdz2022-05-03 19:18:28 +0200
commit48bba6c6883f53b9c101d3dc31914797153ab019 (patch)
tree181a1cb78da52dacdbb04d60285191778f221dab /tools
parent600dd0bb30d9d8d5c7645156c1c50ad68ec1b334 (diff)
kernel/alloc: print who allocated unfreed memory on shutdown
Diffstat (limited to 'tools')
-rw-r--r--tools/stacktrace_resolve.awk11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/stacktrace_resolve.awk b/tools/stacktrace_resolve.awk
index a8254a7..1b4742d 100644
--- a/tools/stacktrace_resolve.awk
+++ b/tools/stacktrace_resolve.awk
@@ -1,9 +1,12 @@
/k\/[0-9A-Fa-f]{8}/ {
print;
- addr = substr($0, match($0, /k\/[0-9A-Fa-f]{8}/) + 2, RLENGTH - 2);
- if (addr != "00000000") {
- printf " ";
- system("addr2line -psfe out/fs/boot/kernel.bin 0x" addr);
+ while (match($0, /k\/[0-9A-Fa-f]{8}/)) {
+ addr = substr($0, RSTART + 2, RLENGTH - 2);
+ if (addr != "00000000") {
+ printf " ";
+ system("addr2line -psfe out/fs/boot/kernel.bin 0x" addr);
+ }
+ $0 = substr($0, RSTART + RLENGTH);
}
next;
}