]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsns: add time namespace support
authorAdrian Reber <areber@redhat.com>
Mon, 9 Mar 2020 09:16:07 +0000 (09:16 +0000)
committerAdrian Reber <areber@redhat.com>
Mon, 9 Mar 2020 09:19:50 +0000 (10:19 +0100)
 # ./lsns -t time
         NS TYPE  NPROCS   PID USER COMMAND
 4026531834 time     102     1 root /usr/lib/systemd/systemd --switched-root --system --deserialize 29
 4026532246 time       1 54797 root sleep 1000

Signed-off-by: Adrian Reber <areber@redhat.com>
sys-utils/lsns.8
sys-utils/lsns.c

index 3aa5b84be90d2be76abf987df9aba9cdd0dd1e52..eed50d043f7f76c7cf8ca8dd384451ee43461914 100644 (file)
@@ -61,8 +61,8 @@ Use the raw output format.
 .TP
 .BR \-t , " \-\-type " \fItype\fP
 Display the specified \fItype\fP of namespaces only.  The supported types are
-\fBmnt\fP, \fBnet\fP, \fBipc\fP, \fBuser\fP, \fBpid\fP, \fButs\fP and
-\fBcgroup\fP.  This option may be given more than once.
+\fBmnt\fP, \fBnet\fP, \fBipc\fP, \fBuser\fP, \fBpid\fP, \fButs\fP,
+\fBcgroup\fP and \fBtime\fP.  This option may be given more than once.
 .TP
 .BR \-u , " \-\-notruncate"
 Do not truncate text in columns.
index c298d6a3cd0b647144f925589727702139fd96e5..cab9343175071d1b830540b07011624a7408c805 100644 (file)
@@ -119,7 +119,8 @@ enum {
        LSNS_ID_UTS,
        LSNS_ID_IPC,
        LSNS_ID_USER,
-       LSNS_ID_CGROUP
+       LSNS_ID_CGROUP,
+       LSNS_ID_TIME
 };
 
 static char *ns_names[] = {
@@ -129,7 +130,8 @@ static char *ns_names[] = {
        [LSNS_ID_UTS] = "uts",
        [LSNS_ID_IPC] = "ipc",
        [LSNS_ID_USER] = "user",
-       [LSNS_ID_CGROUP] = "cgroup"
+       [LSNS_ID_CGROUP] = "cgroup",
+       [LSNS_ID_TIME] = "time"
 };
 
 struct lsns_namespace {
@@ -910,7 +912,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -r, --raw              use the raw output format\n"), out);
        fputs(_(" -u, --notruncate       don't truncate text in columns\n"), out);
        fputs(_(" -W, --nowrap           don't use multi-line representation\n"), out);
-       fputs(_(" -t, --type <name>      namespace type (mnt, net, ipc, user, pid, uts, cgroup)\n"), out);
+       fputs(_(" -t, --type <name>      namespace type (mnt, net, ipc, user, pid, uts, cgroup, time)\n"), out);
 
        fputs(USAGE_SEPARATOR, out);
        printf(USAGE_HELP_OPTIONS(24));