procps/proc
Jim Warner acda6f40d1 library: miscellaneous additional efficiencies, <pids>
This patch contains the following miscellaneous stuff:

. The pids_stacks_fetch() routine might call for newly
allocated stacks to be itemized. However, that job was
already tended to by the pids_stacks_alloc() function.

So, this patch just eliminates a redundant invocation.
------------------------------------------------------

. The concept of 'dirty_stacks' has not kept pace with
the evolving stacks implementation. Originally, stacks
were considered dirty only if free() of dynamic memory
was needed before refreshing any single result struct.

Later, with the introduction of the 'extra' item and a
promise to reset it to zero, 'dirty' was much broader.

So, this patch just treats the dirty flg as others do.
------------------------------------------------------

. Lastly, a word or three about performance & timings.

Tuning efforts concentrated on the <pids> API and top.
And unless an oldlib equivalent to the preceding patch
is applied (favoring stat vs. status), newlib top will
often outperform the oldlib version (obviously wrong).

So assuming /proc/stat is preferred in both libraries,
generally speaking, a cpu and elapsed time increase of
1-5% was found for this new stacks oriented interface.
Of course, there's also an increased memory footprint.

There are some occasions, however, when the newlib top
is at a substantial disadvantage. For example if WCHAN
or TTY is displayed, such items will be present in all
newlib reaped stacks (i.e. every process). But old top
would only incur such overhead with displayable tasks.

Thus, oldlib top could outperform newlib by up to 25%,
for example, if only fields requiring NO library flags
were displayed. However, such a scenario is not likely
since only GID, UID, PID, TGID & WCHAN would be shown.
In the usual case, that overhead associated with WCHAN
and/or TTY is overshadowed by other top runtime costs.

All in all a pleasing outcome I deem quite acceptable.
------------------------------------------------------

Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-08-23 21:11:09 +10:00
..
.gitignore tests: update template and add pids 2016-04-19 21:33:02 +10:00
alloc.c library: cleanup of library includes 2016-04-16 17:03:57 +10:00
alloc.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
COPYING miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
devname.c library: find tty device name of process quicker 2016-07-03 10:47:25 +10:00
devname.h library: cleanup of readproc functions 2016-04-17 14:14:27 +10:00
diskstats.c library: most function names now more profile friendly 2016-08-23 21:11:09 +10:00
diskstats.h library: ensure that all those 'GET' macros are robust 2016-08-07 21:43:38 +10:00
escape.c library: re-arrange escape commands 2016-04-17 14:45:19 +10:00
escape.h library: re-arrange escape commands 2016-04-17 14:45:19 +10:00
libprocps.pc.in Renaming libprocfs to libprocps 2011-12-23 09:18:43 +11:00
libprocps.sym library: provide for validating result type references 2016-08-07 21:40:48 +10:00
meminfo.c library: most function names now more profile friendly 2016-08-23 21:11:09 +10:00
meminfo.h library: expand fields and break an ABI, <MEMINFO> api 2016-08-16 21:08:27 +10:00
namespace.c miscellaneous: silence a whole bunch of clang warnings 2015-09-21 22:34:27 +10:00
namespace.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
openproc.3 documentation: fix man pages due to refactor for wchan 2015-06-19 19:09:21 +10:00
pids.c library: miscellaneous additional efficiencies, <pids> 2016-08-23 21:11:09 +10:00
pids.h library: expand VAL macros to include the context parm 2016-08-07 21:40:48 +10:00
procps-private.h library: please keep procps-private.h free of #include 2016-06-11 11:50:37 +10:00
procps.h library: provide for validating result type references 2016-08-07 21:40:48 +10:00
pwcache.c library: rename clashing pwcache functions 2016-06-18 08:17:45 +10:00
pwcache.h library: rename clashing pwcache functions 2016-06-18 08:17:45 +10:00
readproc.3 misc: result after checking all files for misspellings 2014-08-08 22:14:21 +02:00
readproc.c library: normalize & minimize result types, <PIDS> api 2016-08-01 20:09:18 +10:00
readproc.h library: normalize & minimize result types, <PIDS> api 2016-08-01 20:09:18 +10:00
readproctab.3 misc: result after checking all files for misspellings 2014-08-08 22:14:21 +02:00
slabinfo.c library: most function names now more profile friendly 2016-08-23 21:11:09 +10:00
slabinfo.h library: ensure that all those 'GET' macros are robust 2016-08-07 21:43:38 +10:00
stat.c library: most function names now more profile friendly 2016-08-23 21:11:09 +10:00
stat.h library: ensure that all those 'GET' macros are robust 2016-08-07 21:43:38 +10:00
sysinfo.c misc: just eliminate several 'unused' warning messages 2016-07-26 07:59:48 +10:00
sysinfo.h library: remove an obsolete 'jiffs' typedef in sysinfo 2016-05-08 21:12:22 +10:00
test_namespace.c tests: update template and add pids 2016-04-19 21:33:02 +10:00
test_pids.c related: change for lost 'PROCPS_' enumerator prefixes 2016-07-26 20:49:44 +10:00
test_sysinfo.c tests: update template and add pids 2016-04-19 21:33:02 +10:00
test_uptime.c library: procps_uptime() return value is a status 2016-05-01 16:50:25 +10:00
test_version.c library: Fix LINUX_VERSION macro 2016-05-01 17:46:25 +10:00
uptime.c library: procps_uptime() return value is a status 2016-05-01 16:50:25 +10:00
uptime.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
version.c miscellaneous: remove some trailing whitespace buildup 2015-06-20 07:46:23 +10:00
version.h library: Fix LINUX_VERSION macro 2016-05-01 17:46:25 +10:00
vmstat.c library: most function names now more profile friendly 2016-08-23 21:11:09 +10:00
vmstat.h library: ensure that all those 'GET' macros are robust 2016-08-07 21:43:38 +10:00
wchan.c library: refactor and rely on modern kernels for wchan 2015-06-19 19:09:20 +10:00
wchan.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
xtra-procps-debug.h library: strengthen the VAL macro validation functions 2016-08-08 22:01:37 +10:00