build-sys: treate new pidof the same as other products

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: address some potential libnuma display corruption

There is a chance that the libnuma library may corrupt
top's display with some stderr warning messages in the
event something under /sys/devices/system/node/ cannot
be accessed. And, while 2 overridable 'weak' functions
are provided to alter such behavior, we can't use them
since top dynamically links to the library via dlopen.

This commit will redirect stderr to '/dev/null' during
just the first screen display cycle. Thus we can avoid
the corruption which would have remained visible until
the underlining screen row's data had finally changed.

Lastly, this patch should allow such a library warning
to actually appear when one finally exits our program.

[ i think the libnuma folks should consider changing ]
[ the error/warning interfaces to accommodate dlopen ]
[ rather than forcing something like the ugly kludge ]
[ we have employed or libnuma dependency on everyone ]

Reference(s):
https://bugzilla.redhat.com/show_bug.cgi?id=998678

Signed-off-by: Jim Warner <james.warner@comcast.net>
pidof: fixing compiller warnings

Removing unused variable and adding explicit pid_t retype in printf.
Merge branch 'master' of git://gitorious.org/procps/procps
top: fix miscellaneous spelling errors in man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: expand on column highlight quirks in man document

Confession is supposed to be good for the sole, right?

After a senior moment regarding the 'x' toggle quirks,
and thinking top had somehow regressed, I concluded an
additional explanatory note might well be appropriate.

Those quirks were already documented under the 5d & 5e
topics. But there was no such caution documented under
the 'x' command explanation itself, found in topic 4c.

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: add some flexibility to dlopen() for numa support

A recent libnuma potential corruption problem solution
suggests that libnuma could change in the future so as
to not spew to stderr. This then raises a question how
top could exploit any such library change since we are
currently locked into version #1 of the library by way
of our dlopen("libnuma.so.1", RTLD_LAZY) runtime call.

While not an ultimate solution, this commit will first
try for the most recent version of that library during
top's startup before trying the original libnuma.so.1.
We do this via the unqualified library soname symlink.

For this new dlopen() call to succeed, technically the
numa 'devel' package would usually have been required,
but that's not always true with every distro. And when
the libnuma.so symlink isn't present, it can always be
manually added should a newer & better behaved library
arrive & users tire of the stderr warning at top exit.

Reference(s):
commit 24bd950cb2e1722d459461f0f9c0c30a4b9ffdaa

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: minimize the statistics overhead for numa support

A recent libnuma potential corruption problem solution
has caused me to reevaluate some associated numa logic
for efficiency. Here is a summary of the problems that
exist with current libnuma/user possible interactions:

. Whenever the numa library was present extra overhead
would always be incurred in maintaining the node stats
even when the '2' or '3' commands were not being used.

. As part of such overhead a separate loop was used to
reinitialize each cpu/node structure with each display
cycle so that prior accumulated totals were preserved.
Again, it didn't matter if numa data was really shown.

This commit attempts to refocus on the 'critical path'
costs in a running top by optimizing for the occasions
when numa node data is not being displayed. Under such
conditions, no extra overhead will be incurred whether
or not a distribution has the libnuma library present.

To achieve this goal, some additional overhead will be
incurred, but only when actually displaying numa data.
And all such new costs have been minimized in spite of
the gcc inclination to duplicate subscript resolution.

Reference(s):
commit 24bd950cb2e1722d459461f0f9c0c30a4b9ffdaa

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: eliminate yet more gcc subscript resolution bloat

This patch is inspired by the 'minimize numa overhead'
patch. It trades the use of subscripts for pointers to
avoid gcc repeated subscript offset calculation bloat.

Now, throughout the cpus_refresh function, a subscript
will be resolved just once & this will (dramatically?)
reduce the path-length taken for each and every frame!

For example, a non-optimized compilation could produce
400+ fewer machine instructions through pointer usage.

[ ok, optimized compiles only save 18+ instructions! ]

Lastly, any residual 'symmetry only' crap is now gone!

Signed-off-by: Jim Warner <james.warner@comcast.net>
library: normalize recently added namespaces interface

While 'invisible' thread subdirectories are accessible
under /proc/ with stat/opendir calls, they have always
been treated as non-existent, as is true with readdir.

This patch trades the /proc/#/ns access convention for
the more proper /proc/#/task/#/ns approach when thread
access is desired. In addition some namespace code has
been simplified and made slightly more efficient given
the calloc nature of proc_t acquisition and its reuse.

Reference(s):
commit a01ee3c0b32d4c39aa83066ed61103343469527e

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: expand this program to include namespaces support

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: expand the man page to include namespaces support

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: increase the maximum number of displayable fields

The recent addition of namespaces, combined with those
potential suse out-of-memory fields, means that we are
close to the maximum number of fields poor ol' top can
display. Imagine, the really old top was limited to 26
fields (28 with the suse hack) and this top had neared
the version 'g' rcfile limits which were a healthy 55.

This patch adds another 15 fields to the maximum while
making it even easier to increase in the future. Also,
top still silently accommodates older config files all
the way back to the original pre-ng version top-3.2.8!

Signed-off-by: Jim Warner <james.warner@comcast.net>
NEWS: updated with the next procps-ng release of 3.3.9

Signed-off-by: Jim Warner <james.warner@comcast.net>
vmstat: -w switch for wider output

This is a rework of the merge request #5 that unconditionally
forced the output to cross the 80 chars border.
With this commit users can switch to the wide output mode
with the -w option.
vmstat: support for time stolen from virtual machines

Surprisingly the code for the 'st' column was added in the past,
but wasn't enabled. The vmstat manual already contains the 'st'
column and this commit finally enables the feature.
pmap: Including -c -C -n -N in the man page

Previously the pmap man page was missing the -c -C -n -N switches.
This commit fixes that.
pmap: Including -p in the man page

Previously the pmap man page was missing the -p switch.
This commit fixes that.
Merge branch 'master' of git://gitorious.org/procps/procps
top: do not lie about purported alphabetical orderings

Excluding those special X_XON/X_XOF enums, which might
not even be present, restore strict collating order of
all the case labels in the task_show switch statement.

Also, adjust a few sort callbacks for the same reason.

Signed-off-by: Jim Warner <james.warner@comcast.net>