automated: linux: modules: add configurable memory tolerance for leak detection
Add configurable memory leak detection tolerance to reduce false positives
from MemAvailable measurement variations due to kernel memory management
artifacts like page cache changes, buffer allocations, and memory fragmentation.
Changes:
- Add MEMORY_TOLERANCE variable (default: 512KB)
- Add -t option to configure tolerance from command line
- Update usage help to document the new option
- Change leak detection from strict (diff < 0) to tolerance-based (diff < -tolerance)
This allows filtering out small memory variations that are not actual leaks
while still detecting significant memory leaks. The default 100KB tolerance
provides a good balance between sensitivity and false positive reduction.
Usage: ./modules.sh -t 512 # Set 512KB tolerance
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
2 files changed