From 0d2d52339058a19e66ecc75f78c52596054c7dad Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 29 Apr 2019 11:21:55 +0200 Subject: top: fallback to execing ps(1) Fallback to executing ps(1) in case we hit an unknown psgo descriptor. This ensures backwards compatibility with docker-top, which was purely ps(1) driven. Also support comma-separated descriptors as input. Signed-off-by: Valentin Rothberg --- docs/podman-top.1.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'docs/podman-top.1.md') diff --git a/docs/podman-top.1.md b/docs/podman-top.1.md index 52d1238ef..74175b753 100644 --- a/docs/podman-top.1.md +++ b/docs/podman-top.1.md @@ -7,7 +7,7 @@ podman\-top - Display the running processes of a container **podman top** [*options*] *container* [*format-descriptors*] ## DESCRIPTION -Display the running process of the container. The *format-descriptors* are ps (1) compatible AIX format descriptors but extended to print additional information, such as the seccomp mode or the effective capabilities of a given process. +Display the running processes of the container. The *format-descriptors* are ps (1) compatible AIX format descriptors but extended to print additional information, such as the seccomp mode or the effective capabilities of a given process. The descriptors can either be passed as separated arguments or as a single comma-separated argument. Note that you can also specify options and or flags of ps(1); in this case, Podman will fallback to executing ps with the specified arguments and flags in the container. ## OPTIONS @@ -83,12 +83,20 @@ root 8 1 0.000 11.386886562s pts/0 0s vi The output can be controlled by specifying format descriptors as arguments after the container: ``` -$ sudo ./bin/podman top -l pid seccomp args %C +$ podman top -l pid seccomp args %C PID SECCOMP COMMAND %CPU 1 filter sh 0.000 8 filter vi /etc/ 0.000 ``` +Podman will fallback to executing ps(1) in the container if an unknown descriptor is specified. + +``` +$ podman top -l -- aux +USER PID PPID %CPU ELAPSED TTY TIME COMMAND +root 1 0 0.000 1h2m12.497061672s ? 0s sleep 100000 +``` + ## SEE ALSO podman(1), ps(1), seccomp(2), proc(5), capabilities(7) -- cgit v1.2.3-54-g00ecf