[LTP] [PATCH 5/6] tools: Implement tst_cgctl binary utility

Li Wang liwang@redhat.com
Wed Jan 12 11:13:42 CET 2022


Hi Luke,

>> > +static int cgctl_cleanup(const char *config)
>> > +{
>> > +    tst_cgroup_scan();
>> > +    tst_cgroup_load_config(config);
>>
>> This tst_cgroup_load_config() does not work as expected.
>> From my manual check, the ltp and drain dir have been created
>> but it prints " Created_Ltp_Dir=no Created_Drain_Dir=no" strings.
>>
>> ...
>> Detected Roots:
>> /sys/fs/cgroup/memory Mounted_Root=no Created_Ltp_Dir=no
>> Created_Drain_Dir=no Test_Id=test-1801
>> ...
>>
>>
>
> Hm, I'm not sure what this could be. Are you sure when you were reading the printed info it was in the same invocation as when it was being created? Because the tst_cgroup_print_config is just pretty directly printing out the state of the cgroup framework.

I have got the reason, because I manually run Cgroup test but did
not allow it to do cleanup so leaves the ltp/ and drain/ dir there, so
it will not be recorded as "yes" in Created_Ltp_dir next time, that
behavior is correct.

>
>> > +    tst_cgroup_cleanup();
>>
>> This does not work as expected too, but the problem should exist
>> in previous patches. Anyway, I will look into the details tomorrow.
>>
>> # ./tst_cgctl cleanup "$_cgroup_state"
>> tst_cgroup.c:414: TBROK: Could not find root from config. Roots
>> changing between calls?
>>
>
> Was "/sys/fs/cgroup/cpu,cpuacct" one of the roots that was printed out? Because if so the way I have it now it would not be able to parse that. I will look into fixing this.

Yes, it was, I just cut the message to show the problem.


Detected Controllers:
memory V1 @ /sys/fs/cgroup/memory Required
cpu V1 @ /sys/fs/cgroup/cpu,cpuacct
cpuset V1 @ /sys/fs/cgroup/cpuset
Detected Roots:
/sys/fs/cgroup/memory Mounted_Root=no Created_Ltp_Dir=no
Created_Drain_Dir=no Test_Id=test-5091
/sys/fs/cgroup/cpu,cpuacct Mounted_Root=no Created_Ltp_Dir=no
Created_Drain_Dir=no Test_Id=NULL
/sys/fs/cgroup/cpuset Mounted_Root=no Created_Ltp_Dir=no
Created_Drain_Dir=no Test_Id=NULL


>From my test, the progress works well on Cgroup V2,
but now fails on parsing the root config in V1.
I suspect there is a bug in patch 4/6, but still checking
why the "roots" is NULL at that moment.

-- 
Regards,
Li Wang



More information about the ltp mailing list