This source patchset addresses the following:
Library Extension (readproc)
. added PROC_EDITCGRPCVT flag
. added an internal (static) fill_cgroup_cvt function:
. reads AND parses /proc/#/cgroup
. returns result as a single string in a single vector
. thus no changes to proc_t structure or free memory logic
Program Enhancements (top)
. removed parse_cgroup logic in favor of libproc
. eliminated cgroup sort recurring overhead
. converted WCHAN field to variable width
. generalized variable width field logic in task_show
. real-time notation under P col more distinctive as 'rt'
Program Cosmetic (top)
. CGROUP now known as CGROUPS (plural)
. moved jan's attribution from top.c to 'Notes' in top.h
. numerous comments tweaked
Document Enhancements (top)
. documented CGROUPS field (required renumbering all fields)
. adapted narratives for the 3 current variable width fields
. expanded real-time scheduling notes, 'RT' now shown as 'rt'
Signed-off-by: Jan Görig <jgorig@redhat.com>
Having one constructor depend on another means if the order
is reversed you get a different result.
Patched based on idea by Tom Evans.
Added new code to old_Hertz_hack by Werner Fink <werner@suse.de>
Bug-Debian: http://bugs.debian.org/460331
Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=632236
Reviewed-by: Jan Görig <jgorig@redhat.com>
Read the time of system boot from /proc/stat (entry: btime) instead
of computing it as the difference between the current time and the
uptime. This is the only way to get a consistent result which won't
possibly change from one run to the next.
The problems with the original code were:
* Both the current time and the uptime are rounded down to the second,
but the system doesn't boot on an integer second value so they do not
tick at the same moment. Thus, the rounding errors can cause a one
second difference from one run to the next.
* We can't read the uptime and the current time at the exact same moment
anyway, so the time difference we compute is bound to be inaccurate.
Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=222251
Author: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Craig Small <csmall@debian.org>