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,8 +111,10 @@ void do_help (const char *opt, int rc) {
fputs(_(" -C <command> command name\n"), out);
fputs(_(" -G, --Group <GID> real group id or name\n"), out);
fputs(_(" -g, --group <group> session or effective group name\n"), out);
fputs(_(" -p, --pid <PID> process id\n"), out);
fputs(_(" --ppid <PID> select by parent process id\n"), out);
fputs(_(" -p, p, --pid <PID> process id\n"), out);
fputs(_(" --ppid <PID> parent process id\n"), out);
fputs(_(" -q, q, --quick-pid <PID>\n"
" process id (quick mode)\n"), out);
fputs(_(" -s, --sid <session> session id\n"), out);
fputs(_(" -t, t, --tty <tty> terminal\n"), out);
fputs(_(" -u, U, --user <UID> effective user id or name\n"), out);