Bug 4554 - process start time is wrong in SMP systems
process start time is wrong in SMP systems
Status: CLOSED NEXTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: procps (Show other bugs)
6.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: David Lawrence
:
: 4414 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-08-16 17:08 EDT by Ronald Cole
Modified: 2008-05-01 11:37 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-08-31 16:11:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ronald Cole 1999-08-16 17:08:39 EDT
--- 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 19:38:59 EDT
*** 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 16:11:59 EDT
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.