Commit Graph

36 Commits

Author SHA1 Message Date
b2f49b105d Closes: #9 ps: Remove Unix98 output limitations
ps previously followed the Unix98 standard when it comes to
user-defined output, sometimes. This meant you could have
user output format with a header that included commas and
equals signs. It was dependent on if ps thought you wanted
sysv or bsd format and THAT was dependent on things in previous
options.

It was very confusing to a user because
 ps p $$ -o pid=,comm=
gave you a two-column output but
 ps -p $$ -o pid=,comm=
would give you a one column output with the header ",comm="

The -p versus p means (to ps) you want sysv or bsd parsing.
Unix98 standard or not, this is plainly just silly.

The commit removes any of the quirks Unix98 has with user defined
output.  If you really wanted a ps header with commas in the output,
today isn't your day.

Signed-off-by: Craig Small <csmall@enc.com.au>
2015-10-26 11:18:52 +11:00
caeebdc71f ps: exploit the simplified library interface for wchan
This patch was made necessary by those library changes
in support of recently revised/simplified wchan logic.

In addition, this commit eliminates a broken alternate
'namelist' provision which was intended to allow users
to specify a System.map file to be used in translating
addresses into function names. But, the real effect of
the now defunct 'N' and '-n' options was to indirectly
force addresses (not names) to be displayed since such
user named map files could not be successfully parsed.

Besides when the required FRAME_POINTER kconfig option
is absent there is no address to translate and when it
is present /proc/PID/wchan is already translated. Thus
an alternate mapping is unnecessary and inappropriate.

[ we'll forgive POSIX for documenting '-n  namelist' ]

Reference(s):
http://www.freelists.org/post/procps/WCHAN,11

Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-06-19 19:09:20 +10:00
e751606fcc 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.
2014-07-10 21:24:19 +02:00
60ea600599 ps: fix compiler warnings
common.h:23:19: warning: ISO C does not permit named variadic macros [-Wvariadic-macros]
global.c:499:3: warning: ISO C does not support the '%Ld' gnu_printf format [-Wformat]
output.c:134:1: warning: 'sr_cstime' defined but not used [-Wunused-function]
output.c:816:3: warning: ISO C does not support the '%Lu' gnu_printf format [-Wformat]
output.c:816:3: warning: ISO C does not support the '%Lu' gnu_printf format [-Wformat]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-03 18:36:29 +11:00
809906b6a7 ps: add catastrophic_failure()
The catastrophic_failure function tries to make bug reporting useful
by telling in which line error occured, and drops core.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-13 22:42:38 +01:00
4fb48c0bdb ps: generalize help text logic, add related translator hints
This commit represents an experiment in nls help text support.

The word --help itself been made translatable along with the
help section names and their abbreviations.  Thus, the work of
the translators will ultimately alter program run-time behavior.

Perhaps someday all "long" options can behave in a similar way
which could offer a considerable benefit to other languages.
Instead of translationg just option descriptions, the long
forms of those options could also be transalated.

This commit also:
 . includes the section abbreviations in --help output
 . isolates all --help support in the ps/help.c module
 . provides (hopefully) meaningful Translator guidance
 . removes --help support from the ps/common.h header
 . removes --help support from the ps/parser.c module
 . eliminates tabs in line with the style of other ps modules
 . eliminates the need for the include/c.h header file
2012-01-04 08:58:53 +11:00
b8c3288594 ps: exclude debugging only code from participation in nls support
This commit is prmarily concerned with elimnating deugging only
code from the nls template file.

It also eliminates any remaing useless trailing whitespace.
2012-01-04 08:58:53 +11:00
fe20653a4e ps: trade cumbersome GNU attributes with less wordy alternatives 2012-01-04 08:58:52 +11:00
76b3e91e6a Made the c and nls include explicit
These two includes need the path otherwise the make distcheck fails.
I suspect its actually a ps/Makefile.am problem
2012-01-02 17:46:17 +11:00
4bd36d1483 ps: add gettext support
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:45 +01:00
db6aea7d3f ps: new usage function
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:17:03 +01:00
e4c45d6984 added ps etimes, miscellaneous top enhancements
ps program
 . etimes added for ELAPSED expressed in seconds
 . time_t used in place of former unsigned long

top program
 . corrected scroll message bug when 'x' toggle on
 . fixed forest view potential missing libflags bug
 . improved 'k' default signal invocation logic
 . enhanced logic for %CPU maximums displayed
 . made signal handling more robust and efficient
2011-09-12 22:18:23 +10:00
f9d99085e7 crazy Debian GNU/kFreeBSD guy wanted this 2005-01-27 04:08:10 +00:00
6ec1cff342 ps: built-in test code, etc. 2004-10-12 00:12:25 +00:00
4acae28535 misc 2004-08-18 02:22:13 +00:00
6a48d37343 ps: add k and -x 2004-04-26 00:47:31 +00:00
3f603adbae remove some table inconsistencies and rename it_real_value 2004-04-17 03:13:56 +00:00
c36c11c6b2 NSA SELinux for Linux 2.6.xx 2003-12-24 04:18:24 +00:00
3a16c12ce3 top on wyse60, whitespace doc, thread fixes 2003-10-07 03:12:50 +00:00
620b861bd5 Thread flags conflict 2003-09-30 04:00:50 +00:00
71312f1516 more per-process stuff 2003-09-29 04:09:52 +00:00
35859fb0a8 ugly wart gone 2003-09-28 17:23:29 +00:00
c462dcfad5 ps thread support 2003-09-20 08:29:55 +00:00
8b04273f89 EVIL_PROC_HACK 2003-09-17 21:58:32 +00:00
cc5c6955be warning directs users to the FAQ 2003-02-18 03:51:03 +00:00
f5702f2c75 ps --ppid 2003-02-09 07:31:11 +00:00
d8367cbb3e still sig11 w/ "ps f" 2002-12-21 10:34:50 +00:00
3e67b58ec2 satisfy GPL section 2a and LGPL section 2b name+date requirement 2002-12-15 00:30:17 +00:00
460da3c767 c99 for ps 2002-11-27 09:52:19 +00:00
98895d57c1 Jim needs restrictions 2002-11-27 00:24:01 +00:00
81a4a3d281 gcc 3.0 warnings 2002-10-12 04:25:57 +00:00
62b707978e give up, GNU libc will never be compatible with UNIX libc 2002-10-10 20:44:35 +00:00
e96d6b6141 Avoid opening System.map just to check it, etc. 2002-10-02 12:10:39 +00:00
84ed57020d ifdef and cruft removal 2002-09-30 07:11:30 +00:00
cd2727983c added SELINUX patches 2002-09-27 13:48:00 +00:00
03a9b5a30f procps 010114 2002-02-01 22:47:29 +00:00