-
Notifications
You must be signed in to change notification settings - Fork 0
Statistics
Igor Parfenov edited this page May 5, 2026
·
1 revision
This section contains some useful scripts for gathering statistics.
This can be made only for C code. Currently code coverage is ~90% lines of code.
- Add flag
--coverageto both compilation and link stages in Makefiles. - Compile and run all tests:
make. Optionally, run language server, to also test its coverage.
mkdir -p build/coverage
lcov -t "Report" -c -d build/compiler/ --output-file build/coverage.info
genhtml build/coverage.info --output-directory build/report
- Open file
build/coverage/index.htmlin your browser.
This can be made only for C code. In this picture calias used 2.35% of CPU time.
- Clone this repository.
- Prepare script, which will execute what you want to measure. To measure compilation and testing, better repeat it multiple times. The example script:
for i in $(seq 1 10); do
make clean ;
make test ;
done
- Probably you will need to allow perf events, which depends on your OS distribution.
mkdir -p build/flamegraph
perf record -F 99 -a -g -- ./script.sh
perf script | <FlameGraph>/stackcollapse-perf.pl | <FlameGraph>/flamegraph.pl > build/flamegraph/flamegraph.svg
- Open file
build/flamegraph/flamegraph.svgin your browser.