20e44569f5
With openSUSE's tumbleweed release of procps-ng-4.0.0, their source rpm contained a questionable patch. It is ostensibly devoted to increasing the accuracy for %cpu calculations in the ps program. However, in my opinion it goes too far and is quite flawed for these reasons: 1. Six separate files were impacted instead of just 1. 2. While ps was the object, libproc-2 was changed too. 3. A header file's alphabetic item order was violated. 4. The library API and ABI were altered unnecessarily. It should be noted that all the <pids> TIME items were made 'real' when representing seconds so that they can be converted into jiffies/tics if multiplied by hertz. Thus, there was absolutely no justification for adding a new PIDS_TICS_ELAPSED ull_int item to the interface. As an example, assuming a hertz value of 100, there is enough capacity in all of those 'TIME' seconds to hold nearly 3 million years worth of tics without a loss of precision whenever they are changed back into jiffies. [ that's nine quadrillion seven trillion one hundred ] [ ninety-nine billion two hundred fifty-four million ] [ seven hundred forty thousand nine hundred ninety + ] [ one! or more concisely, as: 9,007,199,254,740,991. ] So, any need for increased accuracy in that ps program can be realized within the single output.c file alone. That's what will be accomplished with this new commit. And for any doubters here's a 'double' capacity proof: beg ------ 9007199254740991.000000000000000000000 tic| d /= 100, 90071992547409.90625000000000000000000 sec d /= 60, 1501199875790.165039062500000000000000 min d /= 60, 25019997929.83608245849609375000000000 hrs d /= 24, 1042499913.743170142173767089843750000 day d /= 7, 148928559.1061671674251556396484375000 wks d /= 52, 2864010.752041676081717014312744140625 yrs d *= 52, 148928559.1061671674251556396484375000 wks d *= 7, 1042499913.743170142173767089843750000 day d *= 24, 25019997929.83608245849609375000000000 hrs d *= 60, 1501199875790.165039062500000000000000 min d *= 60, 90071992547409.90625000000000000000000 sec d *= 100, 9007199254740991.000000000000000000000 tic end ------ 9007199254740991.000000000000000000000 " | [ who knows, maybe we'll even convince openSUSE that ] [ the original sledgehammer 'dif' should be dropped. ] Reference(s): . openSUSE equivalent: 'procps-ng-4.0.0-accuracy.dif' Signed-off-by: Jim Warner <james.warner@comcast.net> |
||
---|---|---|
.. | ||
common.h | ||
COPYING | ||
display.c | ||
global.c | ||
HACKING | ||
help.c | ||
output.c | ||
parser.c | ||
ps.1 | ||
regression | ||
select.c | ||
sortformat.c | ||
stacktrace.c |