summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/top.go15
-rw-r--r--docs/podman-top.1.md2
2 files changed, 15 insertions, 2 deletions
diff --git a/cmd/podman/top.go b/cmd/podman/top.go
index 749d97505..ab29df3ab 100644
--- a/cmd/podman/top.go
+++ b/cmd/podman/top.go
@@ -12,6 +12,16 @@ import (
"github.com/urfave/cli"
)
+func getDescriptorString() string {
+ descriptors, err := libpod.GetContainerPidInformationDescriptors()
+ if err == nil {
+ return fmt.Sprintf(`
+Format Descriptors:
+%s`, strings.Join(descriptors, ","))
+ }
+ return ""
+}
+
var (
topFlags = []cli.Flag{
LatestFlag,
@@ -20,11 +30,12 @@ var (
Hidden: true,
},
}
- topDescription = `Display the running processes of the container. Specify format descriptors
+ topDescription = fmt.Sprintf(`Display the running processes of the container. Specify format descriptors
to alter the output. You may run "podman top -l pid pcpu seccomp" to print
the process ID, the CPU percentage and the seccomp mode of each process of
the latest container.
-`
+%s
+`, getDescriptorString())
topCommand = cli.Command{
Name: "top",
diff --git a/docs/podman-top.1.md b/docs/podman-top.1.md
index 28743c84b..76cc573d6 100644
--- a/docs/podman-top.1.md
+++ b/docs/podman-top.1.md
@@ -24,6 +24,8 @@ to run containers such as CRI-O, the last started container could be from either
The following descriptors are supported in addition to the AIX format descriptors mentioned in ps (1):
+**pcpu, group, ppid, user, args, comm, rgroup, nice, pid, pgid, etime, ruser, time, tty, vsz**
+
**capinh**
Set of inheritable capabilities. See capabilities (7) for more information.