]> granicus.if.org Git - psmisc/commitdiff
pstree: add 'cgroup' to namespaces
authorJeff Smith <whydoubt@gmail.com>
Wed, 22 Mar 2017 15:26:35 +0000 (10:26 -0500)
committerJeff Smith <whydoubt@gmail.com>
Sat, 25 Mar 2017 03:30:59 +0000 (22:30 -0500)
The namespace 'cgroup' was added in Linux kernel 4.6

src/pstree.c

index 7574bd8a40b391a58a6d417743f900699ef10b0c..ad446e2f39e6d01c9c0674d29d617f34cd094fb2 100644 (file)
@@ -84,7 +84,8 @@ extern const char *__progname;
 #define THREAD_FORMAT        "{%.*s}"        /* Format for thread names */
 
 enum ns_type {
-    IPCNS = 0,
+    CGROUPNS = 0,
+    IPCNS,
     MNTNS,
     NETNS,
     PIDNS,
@@ -94,6 +95,7 @@ enum ns_type {
 };
 
 static const char *ns_names[] = {
+    [CGROUPNS] = "cgroup",
     [IPCNS] = "ipc",
     [MNTNS] = "mnt",
     [NETNS] = "net",
@@ -1096,7 +1098,8 @@ static void usage(void)
              "  -l, --long          don't truncate long lines\n"
              "  -n, --numeric-sort  sort output by PID\n"
              "  -N type,\n"
-             "  --ns-sort=type      sort by namespace type (ipc, mnt, net, pid, user, uts)\n"
+             "  --ns-sort=type      sort by namespace type (cgroup, ipc, mnt, net, pid,\n"
+             "                                              user, uts)\n"
              "  -p, --show-pids     show PIDs; implies -c\n"
              "  -s, --show-parents  show parents of the selected process\n"
              "  -S, --ns-changes    show namespace transitions\n"