initctl: add -1,--once flag for top command

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-03-16 23:09:01 +01:00
1 parent da95c7d80e
commit 99a8cf3eb7
3 files changed
+13 -1

No files matched your search

+4
View File
@@ -446,6 +446,7 @@ int show_cgtop(char *arg)
{
struct sysinfo si = { 0 };
char path[512];
int laps = 0;
if (!arg)
arg = FINIT_CGPATH;
@@ -465,6 +466,9 @@ int show_cgtop(char *arg)
if (heading)
print_header(" VmSIZE RSS VmLIB %%MEM %%CPU GROUP");
cgroup_tree(arg, NULL, 1);
if (ionce && laps++)
break;
sleep(1);
}