Bug 4554 - process start time is wrong in SMP systems
Summary: process start time is wrong in SMP systems
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: procps
Version: 6.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
: 4414 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-08-16 21:08 UTC by Ronald Cole
Modified: 2008-05-01 15:37 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 1999-08-31 20:11:28 UTC
Embargoed:


Attachments (Terms of Use)

Description Ronald Cole 1999-08-16 21:08:39 UTC
--- procps-2.0.2-orig/proc/sysinfo.c	Sat Mar 20 12:38:48
1999
+++ procps-2.0.2/proc/sysinfo.c	Mon Aug 16 13:44:06 1999
@@ -30,6 +30,8 @@
 static int uptime_fd = -1;
 #define LOADAVG_FILE "/proc/loadavg"
 static int loadavg_fd = -1;
+#define CPUINFO_FILE "/proc/cpuinfo"
+static int cpuinfo_fd = -1;
 #define MEMINFO_FILE "/proc/meminfo"
 static int meminfo_fd = -1;

@@ -103,6 +105,11 @@
   unsigned long user_j, nice_j, sys_j, other_j;  /* jiffies
(clock ticks) */
   double up_1, up_2, seconds;
   unsigned long jiffies, h;
+  unsigned int ncpu = 0;
+  char *p;
+  FILE_TO_BUF(CPUINFO_FILE,cpuinfo_fd);
+  for (p = buf; p = strstr(p, "processor"); p += 9)
+    ncpu++;
   do{
     FILE_TO_BUF(UPTIME_FILE,uptime_fd);  sscanf(buf, "%lf",
&up_1);
     /* uptime(&up_1, NULL); */
@@ -111,7 +118,7 @@
     FILE_TO_BUF(UPTIME_FILE,uptime_fd);  sscanf(buf, "%lf",
&up_2);
     /* uptime(&up_2, NULL); */
   } while((long)( (up_2-up_1)*1000.0/up_1 )); /* want under
0.1% error */
-  jiffies = user_j + nice_j + sys_j + other_j;
+  jiffies = (user_j + nice_j + sys_j + other_j) / ncpu;
   seconds = (up_1 + up_2) / 2;
   h = (unsigned long)( (double)jiffies/seconds );
   switch(h){

Comment 1 Jeff Johnson 1999-08-20 23:38:59 UTC
*** Bug 4414 has been marked as a duplicate of this bug. ***

"ps u" displays the wrong START time for processes

Comment 2 Michael K. Johnson 1999-08-31 20:11:59 UTC
This should be fixed in procps-2.0.3, which is going onto the ftp
sites now, and will be in the next RawHide and in Red Hat Linux 6.1


Note You need to log in before you can comment on or make changes to this bug.