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

Luke Nowakowski-Krijger luke.nowakowskikrijger@canonical.com
Wed Jan 12 10:46:05 CET 2022


Hi Li,

On Tue, Jan 11, 2022 at 4:43 AM Li Wang <liwang@redhat.com> wrote:

> Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com> wrote:
>
> >  tools/cgroup/Makefile    |  7 ++++
> >  tools/cgroup/tst_cgctl.c | 69 ++++++++++++++++++++++++++++++++++++++++
>
> Looks like putting this tst_cgctl.c in testcase/lib/ will be better,
> we have no necessary to create it under a bit far directory, and
> that tool/ is more generic for LTP, but this process is only for
> shell tests.
>
>
Yeah I will move it over here. I was not sure exactly where it should go.

> +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.

> +    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.


> > +
> > +    return 0;
> > +}
>
>
> --
> Regards,
> Li Wang
>
>
Thanks again for review,

- Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220112/b21e4101/attachment.htm>


More information about the ltp mailing list