ps: add -q/q/--quick-pid option

This commit introduces a new option q/-q/--quick-pid
to the 'ps' command. The option does a similar job
to the p/-p/--pid option (i.e. selection of PIDs
listed in the comma separated list that follows
the option), but the new option is optimized
for speed.
In cases where users only need to specify a list
of PIDs to be shown and don't need other selection
options, forest type output and sorting options,
the new option is recommended as it decreases
the initial processing delay by avoiding reading
the necessary information from all the processes
running on the system and by simplifying
the internal filtering logic.
This commit is contained in:
Jaromir Capik
2014-07-10 21:14:02 +02:00
parent 6cd8691720
commit e751606fcc
6 changed files with 131 additions and 4 deletions

View File

@@ -111,6 +111,7 @@ static int proc_was_listed(proc_t *buf){
break; case SEL_PGRP: return_if_match(pgrp,pid);
break; case SEL_PID : return_if_match(tgid,pid);
break; case SEL_PID_QUICK : return_if_match(tgid,pid);
break; case SEL_PPID: return_if_match(ppid,ppid);
break; case SEL_TTY : return_if_match(tty,tty);
break; case SEL_SESS: return_if_match(session,pid);