Skip to content

Commit

Permalink
Add ClangBuildAnalyzer automation script
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Aug 26, 2023
1 parent b81b677 commit 8164ac6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
32 changes: 32 additions & 0 deletions ClangBuildAnalyzer.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# How many of most expensive things are reported?
[counts]

# files that took most time to parse
fileParse = 10
# files that took most time to generate code for
fileCodegen = 10
# functions that took most time to generate code for
function = 30
# header files that were most expensive to include
header = 10
# for each expensive header, this many include paths to it are shown
headerChain = 10
# templates that took longest to instantiate
template = 30


# Minimum times (in ms) for things to be recorded into trace
[minTimes]

# parse/codegen for a file
file = 10


[misc]

# Maximum length of symbol names printed; longer names will get truncated
maxNameLength = 70

# Only print "root" headers in expensive header report, i.e.
# only headers that are directly included by at least one source file
onlyRootHeaders = true
12 changes: 12 additions & 0 deletions scripts/analyze-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Simple automation script to run ClangBuildAnalyzer over the pioneer codebase
# and generate reports.
# Requires a clean build with the -DUSE_TIME_TRACE=1 cmake option passed to
# ./bootstrap, and should be run in the top-level directory of the pioneer repo

ANALYZER="$1"
if [ -z "$ANALYZER" ]; then
ANALYZER="ClangBuildAnalyzer"
fi

$ANALYZER --all build/ build/build-pioneer-trace.bin 2&>/dev/null
$ANALYZER --analyze build/build-pioneer-trace.bin > build/build-pioneer-trace-$(date +%F-%T).txt

0 comments on commit 8164ac6

Please sign in to comment.