summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-02-11 18:17:26 -0800
committerEryu Guan <guaneryu@gmail.com>2019-02-16 19:10:38 +0800
commit0c24aa077f6452710ba38c21e2b5dbded4951afe (patch)
treeba0ed02e6860f6e1e6c6e957fd08fc93131ff7c6 /check
parentc869a6712a86ae1971f39baf3ebeb4d71d106f1c (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-xcheck7
1 files changed, 5 insertions, 2 deletions
diff --git a/check b/check
index 77a06b00..20e95302 100755
--- a/check
+++ b/check
@@ -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`