Skip to content

Commit

Permalink
[metrics/native-code] Add symbols.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy C committed Sep 21, 2022
1 parent 200a63a commit ed65965
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
6 changes: 4 additions & 2 deletions doc/release-quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ This is a supplement to the [main release page](index.html).
passed to the compiler?
- [cxx-dbg](pub/metrics.wwz/preprocessed/cxx-dbg.txt),
[cxx-opt](pub/metrics.wwz/preprocessed/cxx-opt.txt)
- [overview](pub/metrics.wwz/oil-native/overview.txt) - Binary code size reported
by [Bloaty][].
- [Binary code size](pub/metrics.wwz/oil-native/index.html) reported by
[Bloaty][]. How much code is output by the compiler?
- [overview](pub/metrics.wwz/oil-native/overview.txt),
[symbols](pub/metrics.wwz/oil-native/symbols.txt)


[cloc]: https://github.com/AlDanial/cloc
Expand Down
21 changes: 11 additions & 10 deletions metrics/native-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@ fastlex-symbols() {
symbols _devbuild/py-ext/x86_64/fastlex.so
}

symbols() {
print-symbols() {
local obj=$1
nm $obj
ls -l $obj
echo

# Summary
bloaty $obj
echo

# Top symbols
# fastlex_MatchToken is 21.2 KiB. That doesn't seem to large compared ot
# the 14K line output?
bloaty -d symbols $obj
echo

ls -l $obj
nm $obj
echo
}

Expand Down Expand Up @@ -63,11 +65,6 @@ symbols() {
# ovm-opt.stripped doesn't show a report.
local file=${1:-_build/oil/ovm-opt}

# Slightly different.
#local file=_build/oil/ovm-dbg

#bloaty -n 30 -d symbols $file

# Full output
# 3,588 lines!
bloaty --tsv -n 0 -d symbols $file
Expand All @@ -87,6 +84,9 @@ collect-and-report() {
local opt=$3

mkdir -p $base_dir

print-symbols $opt > $base_dir/symbols.txt

symbols $opt > $base_dir/symbols.tsv

# Really 'transation units', but bloaty gives it that name.
Expand All @@ -102,10 +102,11 @@ collect-and-report() {
fi

# For CI
cat >>$base_dir/index.html <<'EOF'
cat >$base_dir/index.html <<'EOF'
<a href="overview.txt">overview.txt</a> <br/>
<a href="compileunits.tsv">compileunits.tsv</a> <br/>
<a href="symbols.tsv">symbols.tsv</a <br/>
<a href="symbols.tsv">symbols.tsv</a> <br/>
<a href="symbols.txt">symbols.txt</a> <br/>
EOF
}

Expand Down

0 comments on commit ed65965

Please sign in to comment.