diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 01:06:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 01:06:28 -0500 |
commit | f43dc23d5ea91fca257be02138a255f02d98e806 (patch) | |
tree | b29722f6e965316e90ac97abf79923ced250dc21 /fs/proc/stat.c | |
parent | f8e53553f452dcbf67cb89c8cba63a1cd6eb4cc0 (diff) | |
parent | 4162cf64973df51fc885825bc9ca4d055891c49f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into common/serial-rework
Conflicts:
arch/sh/kernel/cpu/sh2/setup-sh7619.c
arch/sh/kernel/cpu/sh2a/setup-mxg.c
arch/sh/kernel/cpu/sh2a/setup-sh7201.c
arch/sh/kernel/cpu/sh2a/setup-sh7203.c
arch/sh/kernel/cpu/sh2a/setup-sh7206.c
arch/sh/kernel/cpu/sh3/setup-sh7705.c
arch/sh/kernel/cpu/sh3/setup-sh770x.c
arch/sh/kernel/cpu/sh3/setup-sh7710.c
arch/sh/kernel/cpu/sh3/setup-sh7720.c
arch/sh/kernel/cpu/sh4/setup-sh4-202.c
arch/sh/kernel/cpu/sh4/setup-sh7750.c
arch/sh/kernel/cpu/sh4/setup-sh7760.c
arch/sh/kernel/cpu/sh4a/setup-sh7343.c
arch/sh/kernel/cpu/sh4a/setup-sh7366.c
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
arch/sh/kernel/cpu/sh4a/setup-sh7724.c
arch/sh/kernel/cpu/sh4a/setup-sh7763.c
arch/sh/kernel/cpu/sh4a/setup-sh7770.c
arch/sh/kernel/cpu/sh4a/setup-sh7780.c
arch/sh/kernel/cpu/sh4a/setup-sh7785.c
arch/sh/kernel/cpu/sh4a/setup-sh7786.c
arch/sh/kernel/cpu/sh4a/setup-shx3.c
arch/sh/kernel/cpu/sh5/setup-sh5.c
drivers/serial/sh-sci.c
drivers/serial/sh-sci.h
include/linux/serial_sci.h
Diffstat (limited to 'fs/proc/stat.c')
-rw-r--r-- | fs/proc/stat.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 7cc726c6d70a..e15a19c93bae 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c | |||
@@ -1,6 +1,5 @@ | |||
1 | #include <linux/cpumask.h> | 1 | #include <linux/cpumask.h> |
2 | #include <linux/fs.h> | 2 | #include <linux/fs.h> |
3 | #include <linux/gfp.h> | ||
4 | #include <linux/init.h> | 3 | #include <linux/init.h> |
5 | #include <linux/interrupt.h> | 4 | #include <linux/interrupt.h> |
6 | #include <linux/kernel_stat.h> | 5 | #include <linux/kernel_stat.h> |
@@ -27,16 +26,15 @@ static int show_stat(struct seq_file *p, void *v) | |||
27 | int i, j; | 26 | int i, j; |
28 | unsigned long jif; | 27 | unsigned long jif; |
29 | cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; | 28 | cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; |
30 | cputime64_t guest; | 29 | cputime64_t guest, guest_nice; |
31 | u64 sum = 0; | 30 | u64 sum = 0; |
32 | u64 sum_softirq = 0; | 31 | u64 sum_softirq = 0; |
33 | unsigned int per_softirq_sums[NR_SOFTIRQS] = {0}; | 32 | unsigned int per_softirq_sums[NR_SOFTIRQS] = {0}; |
34 | struct timespec boottime; | 33 | struct timespec boottime; |
35 | unsigned int per_irq_sum; | ||
36 | 34 | ||
37 | user = nice = system = idle = iowait = | 35 | user = nice = system = idle = iowait = |
38 | irq = softirq = steal = cputime64_zero; | 36 | irq = softirq = steal = cputime64_zero; |
39 | guest = cputime64_zero; | 37 | guest = guest_nice = cputime64_zero; |
40 | getboottime(&boottime); | 38 | getboottime(&boottime); |
41 | jif = boottime.tv_sec; | 39 | jif = boottime.tv_sec; |
42 | 40 | ||
@@ -51,9 +49,9 @@ static int show_stat(struct seq_file *p, void *v) | |||
51 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); | 49 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); |
52 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); | 50 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); |
53 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); | 51 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); |
54 | for_each_irq_nr(j) { | 52 | guest_nice = cputime64_add(guest_nice, |
55 | sum += kstat_irqs_cpu(j, i); | 53 | kstat_cpu(i).cpustat.guest_nice); |
56 | } | 54 | sum += kstat_cpu_irqs_sum(i); |
57 | sum += arch_irq_stat_cpu(i); | 55 | sum += arch_irq_stat_cpu(i); |
58 | 56 | ||
59 | for (j = 0; j < NR_SOFTIRQS; j++) { | 57 | for (j = 0; j < NR_SOFTIRQS; j++) { |
@@ -65,7 +63,8 @@ static int show_stat(struct seq_file *p, void *v) | |||
65 | } | 63 | } |
66 | sum += arch_irq_stat(); | 64 | sum += arch_irq_stat(); |
67 | 65 | ||
68 | seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", | 66 | seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu " |
67 | "%llu\n", | ||
69 | (unsigned long long)cputime64_to_clock_t(user), | 68 | (unsigned long long)cputime64_to_clock_t(user), |
70 | (unsigned long long)cputime64_to_clock_t(nice), | 69 | (unsigned long long)cputime64_to_clock_t(nice), |
71 | (unsigned long long)cputime64_to_clock_t(system), | 70 | (unsigned long long)cputime64_to_clock_t(system), |
@@ -74,7 +73,8 @@ static int show_stat(struct seq_file *p, void *v) | |||
74 | (unsigned long long)cputime64_to_clock_t(irq), | 73 | (unsigned long long)cputime64_to_clock_t(irq), |
75 | (unsigned long long)cputime64_to_clock_t(softirq), | 74 | (unsigned long long)cputime64_to_clock_t(softirq), |
76 | (unsigned long long)cputime64_to_clock_t(steal), | 75 | (unsigned long long)cputime64_to_clock_t(steal), |
77 | (unsigned long long)cputime64_to_clock_t(guest)); | 76 | (unsigned long long)cputime64_to_clock_t(guest), |
77 | (unsigned long long)cputime64_to_clock_t(guest_nice)); | ||
78 | for_each_online_cpu(i) { | 78 | for_each_online_cpu(i) { |
79 | 79 | ||
80 | /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ | 80 | /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ |
@@ -88,8 +88,10 @@ static int show_stat(struct seq_file *p, void *v) | |||
88 | softirq = kstat_cpu(i).cpustat.softirq; | 88 | softirq = kstat_cpu(i).cpustat.softirq; |
89 | steal = kstat_cpu(i).cpustat.steal; | 89 | steal = kstat_cpu(i).cpustat.steal; |
90 | guest = kstat_cpu(i).cpustat.guest; | 90 | guest = kstat_cpu(i).cpustat.guest; |
91 | guest_nice = kstat_cpu(i).cpustat.guest_nice; | ||
91 | seq_printf(p, | 92 | seq_printf(p, |
92 | "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", | 93 | "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu " |
94 | "%llu\n", | ||
93 | i, | 95 | i, |
94 | (unsigned long long)cputime64_to_clock_t(user), | 96 | (unsigned long long)cputime64_to_clock_t(user), |
95 | (unsigned long long)cputime64_to_clock_t(nice), | 97 | (unsigned long long)cputime64_to_clock_t(nice), |
@@ -99,18 +101,14 @@ static int show_stat(struct seq_file *p, void *v) | |||
99 | (unsigned long long)cputime64_to_clock_t(irq), | 101 | (unsigned long long)cputime64_to_clock_t(irq), |
100 | (unsigned long long)cputime64_to_clock_t(softirq), | 102 | (unsigned long long)cputime64_to_clock_t(softirq), |
101 | (unsigned long long)cputime64_to_clock_t(steal), | 103 | (unsigned long long)cputime64_to_clock_t(steal), |
102 | (unsigned long long)cputime64_to_clock_t(guest)); | 104 | (unsigned long long)cputime64_to_clock_t(guest), |
105 | (unsigned long long)cputime64_to_clock_t(guest_nice)); | ||
103 | } | 106 | } |
104 | seq_printf(p, "intr %llu", (unsigned long long)sum); | 107 | seq_printf(p, "intr %llu", (unsigned long long)sum); |
105 | 108 | ||
106 | /* sum again ? it could be updated? */ | 109 | /* sum again ? it could be updated? */ |
107 | for_each_irq_nr(j) { | 110 | for_each_irq_nr(j) |
108 | per_irq_sum = 0; | 111 | seq_printf(p, " %u", kstat_irqs(j)); |
109 | for_each_possible_cpu(i) | ||
110 | per_irq_sum += kstat_irqs_cpu(j, i); | ||
111 | |||
112 | seq_printf(p, " %u", per_irq_sum); | ||
113 | } | ||
114 | 112 | ||
115 | seq_printf(p, | 113 | seq_printf(p, |
116 | "\nctxt %llu\n" | 114 | "\nctxt %llu\n" |