Commit Graph

23 Commits

Author SHA1 Message Date
Jan Görig
4d3c19af52 Read the system boot time from /proc instead of computing
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>
2010-12-16 10:30:39 +01:00
albert
9278134e49 top: show CPU time stolen from a virtual machine 2006-06-25 02:15:36 +00:00
albert
777fcd3cf1 /proc/stat for 1024 CPUs 2005-10-30 00:14:16 +00:00
albert
864a5356a1 fix race condition 2005-06-10 15:43:15 +00:00
albert
c8a8290ef2 fix vmstat -d 2004-05-04 23:29:40 +00:00
albert
658b03bec6 alignment 2004-02-23 19:31:00 +00:00
albert
e54c8239b1 new Linux 2.6.0-test4 CPU stats shown 2003-09-08 01:39:49 +00:00
albert
6ba229fa4c alignment 2003-08-11 01:59:53 +00:00
albert
8618adeaaf got most of procps-3.1.11ff2.diff 2003-08-10 23:40:41 +00:00
albert
0db94e6a1a GPLONLY_ and PID-related stuff 2003-07-03 05:20:19 +00:00
albert
5c99a21b72 diskstats and slabinfo 2003-06-08 17:28:06 +00:00
albert
573423ff40 warning + doc refs 2003-06-02 23:31:12 +00:00
albert
de2857aa89 fabian.frederick@gmx.fr vmstat code 2003-05-31 00:38:55 +00:00
albert
0a03eac352 malloc error 2003-01-23 05:48:27 +00:00
albert
5087f3dbf6 big header clean-up 2002-12-09 07:00:07 +00:00
albert
c3ee8f3252 Inact_laundry 2002-12-08 00:14:02 +00:00
albert
bd1a19b577 c99 2002-11-25 10:16:33 +00:00
albert
f86b39f44e that was excessive 2002-10-12 01:57:05 +00:00
albert
0fda206a66 warning and variable name fixes 2002-10-09 07:11:08 +00:00
albert
eeb598fd98 handle Linux 2.5.xx ABI 2002-10-06 16:46:06 +00:00
albert
bce2da1f9a 64-bit time for Linux 2.5.xx 2002-05-28 04:18:55 +00:00
albert
17bd2ac219 crapectomy, add user-mode and S/390 arch, add kb_swap_cached 2002-05-28 02:30:40 +00:00
csmall
03a9b5a30f procps 010114 2002-02-01 22:47:29 +00:00