Hi,
When we use lscgroup with -g to specify more then one controllers,
the  result just display one controllers, such as:

# lssubsys -m
cpuset /cgroup/cpuset
cpu /cgroup/cpu

# lscgroup
cpu:/
cpu:/test
cpuset:/
cpuset:/test

# lscgroup -g cpu,cpuset:test
cpu:/test/

there is no message about cpuset, is it not necessary to support -g
with many controllers ? Because we can get the result we wanted by
specifying multiple -g. Or this may be a bug? if it's a bug, i once
tried to fix it as following, but the solution leads to lscgroup will
not report error when specify the wrong controller or the unmounted
controller as lssubsys.

 src/tools/lscgroup.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/tools/lscgroup.c b/src/tools/lscgroup.c
index 3b74aad..d0b47fe 100644
--- a/src/tools/lscgroup.c
+++ b/src/tools/lscgroup.c
@@ -155,11 +155,6 @@ static int print_cgroup(struct cgroup_group_spec 
*cgroup_spec, int flags)
                                        con_name, all_conts);
                                if (ret)
                                        return ret;
-                               if ((flags & FL_LIST) != 0) {
-                                       /* we succesfully finish printing */
-                                       output = 0;
-                                       break;
-                               }
                        }

                        output = 0;
@@ -183,6 +178,8 @@ static int print_cgroup(struct cgroup_group_spec 
*cgroup_spec, int flags)
        cgroup_get_controller_end(&handle);
        if (ret != ECGEOF)
                return ret;
+       else
+               ret = 0;

        if (output) {
                ret = display_controller_data(
-- 
1.8.2.2



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to