zfs/scripts
Damian Szuberski a69765ea5b Add Linux kmemleak support to ZTS
- Kmemleak `clear` is invoked right before every test case run.
- Kmemleak `scan` is requested right after each test case is finished.
- Kmemleak instrumentation is not used for
  setup/cleanup/pretest/posttest/failsafe stages to shorten the test
  case execution time.
- Kmemleak periodic scan is disabled (`scan=0`) before the test suite
  run to avoid interfering with the on-demand scan results.
- There are unavoidable potential false positives coming from kernel
  areas other than OpenZFS module.
- The ZTS with kmemleak enabled duration is increased by ~50%.

Example run
```
Running Time:   07:12:13
Percent passed: 98.3%

unreferenced object 0xffff9da82aea5410 (size 80):
  comm "kworker/u32:10", pid 942206, jiffies 4296749716 (age 2615.516s)
  hex dump (first 32 bytes):
    00 30 30 00 00 00 00 00 ff 8f 30 00 00 00 00 00  .00.......0.....
    51 e6 77 05 a8 9d ff ff 00 00 00 00 00 00 00 00  Q.w.............
  backtrace:
    [<000000005cf1fea2>] alloc_extent_state+0x1d/0xb0 [btrfs]
    [<0000000083f78ae5>] set_extent_bit+0x2ff/0x670 [btrfs]
    [<00000000de29249e>] lock_extent_bits+0x6b/0xa0 [btrfs]
    [<00000000b241f424>] lock_and_cleanup_extent_if_need+0xaf/0x1c0
       [btrfs]
    [<0000000093ca72b5>] btrfs_buffered_write+0x297/0x7d0 [btrfs]
    [<000000002c2938c8>] btrfs_file_write_iter+0x127/0x390 [btrfs]
    [<00000000b888f720>] do_iter_readv_writev+0x152/0x1b0
    [<00000000320f0bcc>] do_iter_write+0x7c/0x1c0
    [<000000000b5a8fe0>] lo_write_bvec+0x62/0x150 [loop]
    [<000000009aa03c73>] loop_process_work+0x250/0xbd0 [loop]
    [<00000000c7487d8a>] process_one_work+0x1f1/0x390
    [<000000000b236831>] worker_thread+0x53/0x3e0
    [<0000000023cb3e57>] kthread+0x127/0x150
    [<000000002d48676a>] ret_from_fork+0x22/0x30
```

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #13084
2023-04-03 13:50:02 -07:00
..
zfs-images@3331601f6d Add zimport.sh compatibility test script 2014-02-21 12:10:31 -08:00
.gitignore Remove autotools products 2012-08-27 11:47:44 -07:00
Makefile.am Update workflows 2023-03-09 18:46:36 -08:00
commitcheck.sh Fix SC2181 ("[ $?") outside tests/ 2021-06-08 14:45:03 -07:00
common.sh.in zpool_influxdb: move to libexec dir 2020-11-28 11:15:57 -08:00
cstyle.pl cstyle.pl: echo commands for github workflow 2020-08-13 14:58:53 -07:00
dkms.mkconf Remove REMAKE_INITRD 2022-05-06 11:32:45 -07:00
dkms.postbuild Turn shellcheck into a normal make target. Fix new files it caught 2021-06-09 13:05:34 -07:00
enum-extract.pl scripts/enum-extract.pl should not hard code perl path 2022-12-01 12:39:41 -08:00
kmodtool Remove basename(1). Clean up/shorten some coreutils pipelines 2022-02-16 17:58:55 -08:00
make_gitrev.sh Fix minor shellcheck 0.7.2 warnings 2021-06-10 10:50:16 -07:00
man-dates.sh Fix minor shellcheck 0.7.2 warnings 2021-06-10 10:50:16 -07:00
mancheck.sh Update `checkstyle` workflow env to ubuntu-20.04 2021-12-08 13:27:56 -08:00
paxcheck.sh Turn checkbashisms into a make target 2021-06-09 13:05:34 -07:00
zfs-helpers.sh Remove draid.d symlink from zfs_helpers.sh 2020-12-11 11:00:58 -08:00
zfs-tests.sh Add Linux kmemleak support to ZTS 2023-04-03 13:50:02 -07:00
zfs.sh Remove basename(1). Clean up/shorten some coreutils pipelines 2022-02-16 17:58:55 -08:00
zfs2zol-patch.sed Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
zimport.sh Remove basename(1). Clean up/shorten some coreutils pipelines 2022-02-16 17:58:55 -08:00
zloop.sh zloop: Add a max iterations option, use default run/pass times 2021-09-14 12:40:45 -07:00
zol2zfs-patch.sed Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00