[LTP] [PATCH 3/3] zram/zram03: Convert into new api

Petr Vorel pvorel@suse.cz
Mon Dec 13 08:30:03 CET 2021


Hi all,
> Hi Petr
> > Hi Petr
> >> Hi Xu,

> >>> Also add removing zram module step in setup, so we can avoid the situation that
> >>> zram module is being used by zram-generator.

> >> ...
> >>> +++ b/testcases/kernel/device-drivers/zram/zram03.c
> >> ...
> >>> +static const char *const cmd_rmmod[] = {"rmmod", "zram", NULL};

> >> Again, here should be lsmod used.
> > I prefer to detect it in /proc/modules.
Generally I'd vote for approaches like this to not depend on anything external
to cover more systems (Cyril suggested in v2 SAFE_FOPEN("/proc/modules") and
loop over the lines and do strstr() for zram.)

> > What do you think about it?
> Since we have require modprobe/rmmod commands, using lsmod is better. I 
> will use lsmod as you suggested.
OK. I was thinking a bit whether using finit_module would help to replace
modprobe and not require rmmod to cover more systems, but it'd be probably
overcomplicated just for very few systems without kmod installed.

(+ We already depend on all but AOSP on /lib/modules/$(uname
-r)/modules.{dep,builtin} for tst_check_driver().)

Thus ack keeping the current approach.

Kind regards,
Petr


More information about the ltp mailing list