mirror of
https://github.com/troglobit/finit.git
synced 2026-10-14 10:19:36 +00:00
initctl: add -1,--once flag for top command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
da95c7d80e
commit
99a8cf3eb7
3 files changed
+13
-1
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user