Kaydet (Commit) 2302a5ae authored tarafından Michael Stahl's avatar Michael Stahl

add script bin/includebloat

Change-Id: I086052c9a4dd2a216e0af153c43e98eec85a4600
üst 6a6b91da
#!/usr/bin/gawk -f
BEGIN {
cmd = "find workdir/Dep/CxxObject/ -name *.d | xargs cat"
while ((cmd | getline) > 0) {
if ($0 ~ /^ .*\\$/) {
gsub(/^ /, "");
gsub(/ *\\$/, "");
includes[$1]++
if ($2) {
# GCC emits 2 per line if short enough!
includes[$2]++
}
}
}
exit
}
END {
for (inc in includes) {
cmd = "wc -c " inc
if ((cmd | getline) < 0)
print "ERROR on: " cmd
sizes[inc] = $1 # $0 is wc -c output, $1 is size
totals[inc] = $1 * includes[inc]
totalsize += totals[inc]
close(cmd)
}
PROCINFO["sorted_in"] = "@val_num_desc"
print "sum total bytes included: " totalsize
for (inc in totals) {
print totals[inc], sizes[inc], includes[inc], inc
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment