[LTP] [PATCH 4/4] scripts/coccinelle: Helper for converting CGroup selftests

Richard Palethorpe rpalethorpe@suse.de
Tue Dec 14 12:22:30 CET 2021


Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
>> +@@
>> +expression cg;
>> +@@
>> +
>> +... when != TST_CGROUP_VER(...)
>> +
>> +- SAFE_CGROUP_PRINT(cg, "cgroup.subtree_control", "+memory");
>> ++ if (TST_CGROUP_VER(cg, "memory") != TST_CGROUP_V1)
>> ++    SAFE_CGROUP_PRINT(cg, "cgroup.subtree_control", "+memory");
>
> I guess that here we operat on already partially converted code right?

Correct, in general cg_write is converted to safe_cgroup_print. Then we
have this special rule for subtree_control to introduce the version
check (if there isn't one already present).

>
>
> Other than this the rest is really straightforward:
>
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>


-- 
Thank you,
Richard.


More information about the ltp mailing list