-
Notifications
You must be signed in to change notification settings - Fork 0
Filtering and Configuration
The analyzer provides flexible filtering to focus analysis on specific files, directories, or functions.
Only report diagnostics from functions defined in this source file.
./build/stack_usage_analyzer --compdb=build --only-file=src/main.cppMatching is flexible:
- Absolute path match
- Basename match (just the filename)
- Suffix match (partial path)
Only report diagnostics from functions defined under this directory.
./build/stack_usage_analyzer --compdb=build --only-dir=src/core/Exclude input files under these directories. Applied before analysis, so excluded files are not compiled at all. Comma-separated.
./build/stack_usage_analyzer --compdb=build --exclude-dir=_deps,third_party,vendorOnly report functions matching this name. Comma-separated for multiple.
./build/stack_usage_analyzer main.cpp --only-func=main,processDataMatching supports:
- Exact symbol name
- Demangled name (with or without parameters)
- Itanium ABI base name extraction
- Mangled filter values
Include STL, system library, and third-party functions in analysis output. By default, these are excluded to keep results focused on project code.
When --compile-commands is provided and no explicit input files are given:
- All supported entries (
.c,.cc,.cpp,.cxx,.ll) are analyzed - Unsupported entries (e.g.,
.mfor Objective-C) are skipped -
_depsdirectories are excluded by default
Override the default _deps exclusion:
./build/stack_usage_analyzer --compdb=build --include-compdb-depsStrips heavy build flags from compile database entries for faster analysis:
- Optimization flags (
-O2,-O3) - Sanitizer flags (
-fsanitize=...) - Profiling flags
- Platform-specific flags
Include paths and macros are preserved.
Only emit warnings and errors. Hides info-level diagnostics (e.g., MultipleStoresToStackBuffer, ConstParameterNotModified).
In human output, functions with no remaining warning/error diagnostics are omitted from the listing.
Suppress all per-function diagnostics. Only stack sizes are shown in human output.
Print filter decisions to stderr. Shows why each function/file was included or excluded:
./build/stack_usage_analyzer --compdb=build --only-dir=src/ --dump-filter| Setting | Default |
|---|---|
| Analysis mode | ir |
| Analysis profile |
full (auto: fast for multi-file compdb) |
| Stack limit | 8 MiB (8388608 bytes) |
| Output format | human |
| Resource cross-TU | enabled |
| Uninitialized cross-TU | enabled |
| Summary cache dir | .cache/resource-lifetime |
| Jobs | 1 |
| STL inclusion | off |
| Include compdb _deps | off |
Override the default 8 MiB stack limit:
--stack-limit=8192 # 8192 bytes
--stack-limit=8KiB # 8 * 1024 bytes
--stack-limit=1MiB # 1 * 1024 * 1024 bytes
--stack-limit=2GiB # 2 * 1024^3 bytesThis affects the StackFrameTooLarge error threshold.