0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +02:00

Add a bloaty source that estimates code size contributions of crates

Only works on ELF, unfortunately. See https://github.com/google/bloaty.
This commit is contained in:
Jordan Rose 2021-03-16 15:38:44 -07:00
parent 82d0d5e623
commit cdc935d658

36
bin/crates_code_size.bloaty Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bloaty -d crates -s vm -c
# We use VM size because otherwise the debug sections are included.
custom_data_source: {
name: "crates"
base_data_source: "inlines"
rewrite: {
pattern: "^(/rustc/|library/)"
replacement: "stdlib"
}
rewrite: {
pattern: "/\\.?cargo/registry/src/github.com-[^/]+/([^/]+)/"
replacement: "\\1"
}
rewrite: {
pattern: "/\\.?cargo/git/checkouts/([^/]+)/"
replacement: "\\1"
}
rewrite: {
pattern: "^(/?([^/]+/)*)src/"
replacement: "\\1"
}
rewrite: {
pattern: "/target/[^/]+/build/([^/]+)/"
replacement: "\\1 (generated)"
}
rewrite: {
pattern: "\\[section .debug.+\\]"
replacement: "[debug sections]"
}
rewrite: {
pattern: "\\[section .+\\]"
replacement: "[non-code sections]"
}
}