diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-11 18:17:26 -0800 |
---|---|---|
committer | Eryu Guan <guaneryu@gmail.com> | 2019-02-16 19:10:38 +0800 |
commit | 0c24aa077f6452710ba38c21e2b5dbded4951afe (patch) | |
tree | ba0ed02e6860f6e1e6c6e957fd08fc93131ff7c6 /check | |
parent | c869a6712a86ae1971f39baf3ebeb4d71d106f1c (diff) |
common: fix kmemleak to work with sections
Refactor the kmemleak code to work correctly with sections. This
requires changing the location of the "is kmemleak enabled?" flag to
use /tmp instead of RESULT_BASE, scanning for leaks after every
test, and clarifying which functions get used when.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Diffstat (limited to 'check')
-rwxr-xr-x | check | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -496,7 +496,7 @@ _expunge_test() return 0 } -_init_kmemleak +_detect_kmemleak _prepare_test_list if $OPTIONS_HAVE_SECTIONS; then @@ -771,9 +771,12 @@ for section in $HOST_OPTIONS_SECTIONS; do # and log messages that shouldn't be there. _check_filesystems _check_dmesg || err=true - _check_kmemleak || err=true fi + # Scan for memory leaks after every test so that associating + # a leak to a particular test will be as accurate as possible. + _check_kmemleak || err=true + # test ends after all checks are done. $timestamp && _timestamp stop=`_wallclock` |