-
Notifications
You must be signed in to change notification settings - Fork 139
Includes analyzer
Anna Berdichevskaya edited this page Feb 3, 2022
·
1 revision
To analyze includes in SPAdes source files, you can use an Include analyzer tool. Follow next steps:
- Generate build.ninja file via command cmake ../src -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G Ninja -DCMAKE_C_FLAGS="-H" -DCMAKE_CXX_FLAGS="-H".
- Create file build_log.txt.
- Run ninja | tee ninja_log.txt.
- Run python3 analyze_includes.py --target=spades-core --revision=$(git rev-parse --short HEAD) --json-out=include-analysis.js build_log.txt. You also can add argument --roo_filter to define which files will count in statistics. For example, to look only at files from /src directory, use --root-filter="[./]/src/.".
- As a result of a previous step you will get include-analysis.js file that accompanies include-analysis.html. Open html page to see the results.
html file contains per-file and per-edge analysis. Information about each file:
- Individual size - the size of a file itself in bytes.
- Expanded size - the size of the file and all the files it includes, directly and indirectly.
- Added size - the size added by this file being part of the build. In other words, if this file were empty and had no includes, how much smaller would the build be.
- Accurance - number of translation units that this file is part of.
- Directly Included In - number of files that containe considered file as a direct include.
- Direct Includes - number of includes in this file (only files that match --root_filter count).
Information about each edge:
- File-includer.
- Included file.
- Added Size - the size added to includer file by this include.