linux-mips-fnet
[Top] [All Lists]

Re: DECstation HZ_TO_STD ...

To: Ralf Baechle <ralf@uni-koblenz.de>
Subject: Re: DECstation HZ_TO_STD ...
From: Richard van den Berg <R.vandenBerg@inter.NL.net>
Date: Sun, 30 Jan 2000 16:06:09 +0100 (MET)
Cc: linux-mips@fnet.fr
In-reply-to: <20000129004603.A13320@uni-koblenz.de>
Hello Ralf,

On Sat, 29 Jan 2000, Ralf Baechle wrote:

> Merging with 2.3.17 I lost some of the HZ_TO_STD changes.  I'd apreciate
> if somebody could try to fix that.

Attached patch should fix the overhaul of fs/proc/array.c
I haven't been able to test it because of this:

        -o vmlinux
arch/mips/mm/mm.o: In function `get_pte_slow':
init.c(.text.init+0x234): undefined reference to `page_is_ram'
init.c(.text.init+0x234): relocation truncated to fit: R_MIPS_26 page_is_ram
make: *** [vmlinux] Error 1

Regards,
Richard
diff -rubN fs/proc.orig/array.c fs/proc/array.c
--- fs/proc.orig/array.c        Sun Jan 30 13:10:18 2000
+++ fs/proc/array.c     Sun Jan 30 15:55:04 2000
@@ -339,10 +339,10 @@
                task->cmin_flt,
                task->maj_flt,
                task->cmaj_flt,
-               task->times.tms_utime,
-               task->times.tms_stime,
-               task->times.tms_cutime,
-               task->times.tms_cstime,
+               HZ_TO_STD(task->times.tms_utime),
+               HZ_TO_STD(task->times.tms_stime),
+               HZ_TO_STD(task->times.tms_cutime),
+               HZ_TO_STD(task->times.tms_cstime),
                priority,
                nice,
                0UL /* removed */,
@@ -642,14 +642,14 @@
 
        len = sprintf(buffer,
                "cpu  %lu %lu\n",
-               task->times.tms_utime,
-               task->times.tms_stime);
+               HZ_TO_STD(task->times.tms_utime),
+               HZ_TO_STD(task->times.tms_stime));
                
        for (i = 0 ; i < smp_num_cpus; i++)
                len += sprintf(buffer + len, "cpu%d %lu %lu\n",
                        i,
-                       task->per_cpu_utime[cpu_logical_map(i)],
-                       task->per_cpu_stime[cpu_logical_map(i)]);
+                       HZ_TO_STD(task->per_cpu_utime[cpu_logical_map(i)]),
+                       HZ_TO_STD(task->per_cpu_stime[cpu_logical_map(i)]));
 
        return len;
 }
diff -rubN fs/proc.orig/proc_misc.c fs/proc/proc_misc.c
--- fs/proc.orig/proc_misc.c    Sun Jan 30 13:10:26 2000
+++ fs/proc/proc_misc.c Sun Jan 30 15:55:11 2000
@@ -286,7 +286,7 @@
        int i, len;
        unsigned sum = 0;
        extern unsigned long total_forks;
-       unsigned long jif = jiffies;
+       unsigned long jif = HZ_TO_STD(jiffies);
 
        for (i = 0 ; i < NR_IRQS ; i++)
                sum += kstat_irqs(i);
@@ -327,10 +327,11 @@
                "page %u %u\n"
                "swap %u %u\n"
                "intr %u",
-               kstat.cpu_user,
-               kstat.cpu_nice,
-               kstat.cpu_system,
-               jif*smp_num_cpus - (kstat.cpu_user + kstat.cpu_nice + 
kstat.cpu_system),
+               HZ_TO_STD(kstat.cpu_user),
+               HZ_TO_STD(kstat.cpu_nice),
+               HZ_TO_STD(kstat.cpu_system),
+               jif*smp_num_cpus - HZ_TO_STD(kstat.cpu_user + kstat.cpu_nice + 
kstat.cpu_system),
+
 #endif
                kstat.dk_drive[0], kstat.dk_drive[1],
                kstat.dk_drive[2], kstat.dk_drive[3],
<Prev in Thread] Current Thread [Next in Thread>