From 8164ac69775f2f425a7a231a7d10b64c4d0a1ce5 Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Fri, 13 May 2022 18:31:20 -0400 Subject: [PATCH] Add ClangBuildAnalyzer automation script --- ClangBuildAnalyzer.ini | 32 ++++++++++++++++++++++++++++++++ scripts/analyze-build.sh | 12 ++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 ClangBuildAnalyzer.ini create mode 100755 scripts/analyze-build.sh diff --git a/ClangBuildAnalyzer.ini b/ClangBuildAnalyzer.ini new file mode 100644 index 00000000000..161f925347d --- /dev/null +++ b/ClangBuildAnalyzer.ini @@ -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 diff --git a/scripts/analyze-build.sh b/scripts/analyze-build.sh new file mode 100755 index 00000000000..1e3b0bf63f0 --- /dev/null +++ b/scripts/analyze-build.sh @@ -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