diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /fs/proc/stat.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'fs/proc/stat.c')
-rw-r--r-- | fs/proc/stat.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 7cc726c6d70a..bf31b03fc275 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,7 +26,7 @@ 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}; |
@@ -36,7 +35,7 @@ static int show_stat(struct seq_file *p, void *v) | |||
36 | 35 | ||
37 | user = nice = system = idle = iowait = | 36 | user = nice = system = idle = iowait = |
38 | irq = softirq = steal = cputime64_zero; | 37 | irq = softirq = steal = cputime64_zero; |
39 | guest = cputime64_zero; | 38 | guest = guest_nice = cputime64_zero; |
40 | getboottime(&boottime); | 39 | getboottime(&boottime); |
41 | jif = boottime.tv_sec; | 40 | jif = boottime.tv_sec; |
42 | 41 | ||
@@ -51,6 +50,8 @@ static int show_stat(struct seq_file *p, void *v) | |||
51 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); | 50 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); |
52 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); | 51 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); |
53 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); | 52 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); |
53 | guest_nice = cputime64_add(guest_nice, | ||
54 | kstat_cpu(i).cpustat.guest_nice); | ||
54 | for_each_irq_nr(j) { | 55 | for_each_irq_nr(j) { |
55 | sum += kstat_irqs_cpu(j, i); | 56 | sum += kstat_irqs_cpu(j, i); |
56 | } | 57 | } |
@@ -65,7 +66,8 @@ static int show_stat(struct seq_file *p, void *v) | |||
65 | } | 66 | } |
66 | sum += arch_irq_stat(); | 67 | sum += arch_irq_stat(); |
67 | 68 | ||
68 | seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", | 69 | seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu " |
70 | "%llu\n", | ||
69 | (unsigned long long)cputime64_to_clock_t(user), | 71 | (unsigned long long)cputime64_to_clock_t(user), |
70 | (unsigned long long)cputime64_to_clock_t(nice), | 72 | (unsigned long long)cputime64_to_clock_t(nice), |
71 | (unsigned long long)cputime64_to_clock_t(system), | 73 | (unsigned long long)cputime64_to_clock_t(system), |
@@ -74,7 +76,8 @@ static int show_stat(struct seq_file *p, void *v) | |||
74 | (unsigned long long)cputime64_to_clock_t(irq), | 76 | (unsigned long long)cputime64_to_clock_t(irq), |
75 | (unsigned long long)cputime64_to_clock_t(softirq), | 77 | (unsigned long long)cputime64_to_clock_t(softirq), |
76 | (unsigned long long)cputime64_to_clock_t(steal), | 78 | (unsigned long long)cputime64_to_clock_t(steal), |
77 | (unsigned long long)cputime64_to_clock_t(guest)); | 79 | (unsigned long long)cputime64_to_clock_t(guest), |
80 | (unsigned long long)cputime64_to_clock_t(guest_nice)); | ||
78 | for_each_online_cpu(i) { | 81 | for_each_online_cpu(i) { |
79 | 82 | ||
80 | /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ | 83 | /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ |
@@ -88,8 +91,10 @@ static int show_stat(struct seq_file *p, void *v) | |||
88 | softirq = kstat_cpu(i).cpustat.softirq; | 91 | softirq = kstat_cpu(i).cpustat.softirq; |
89 | steal = kstat_cpu(i).cpustat.steal; | 92 | steal = kstat_cpu(i).cpustat.steal; |
90 | guest = kstat_cpu(i).cpustat.guest; | 93 | guest = kstat_cpu(i).cpustat.guest; |
94 | guest_nice = kstat_cpu(i).cpustat.guest_nice; | ||
91 | seq_printf(p, | 95 | seq_printf(p, |
92 | "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", | 96 | "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu " |
97 | "%llu\n", | ||
93 | i, | 98 | i, |
94 | (unsigned long long)cputime64_to_clock_t(user), | 99 | (unsigned long long)cputime64_to_clock_t(user), |
95 | (unsigned long long)cputime64_to_clock_t(nice), | 100 | (unsigned long long)cputime64_to_clock_t(nice), |
@@ -99,7 +104,8 @@ static int show_stat(struct seq_file *p, void *v) | |||
99 | (unsigned long long)cputime64_to_clock_t(irq), | 104 | (unsigned long long)cputime64_to_clock_t(irq), |
100 | (unsigned long long)cputime64_to_clock_t(softirq), | 105 | (unsigned long long)cputime64_to_clock_t(softirq), |
101 | (unsigned long long)cputime64_to_clock_t(steal), | 106 | (unsigned long long)cputime64_to_clock_t(steal), |
102 | (unsigned long long)cputime64_to_clock_t(guest)); | 107 | (unsigned long long)cputime64_to_clock_t(guest), |
108 | (unsigned long long)cputime64_to_clock_t(guest_nice)); | ||
103 | } | 109 | } |
104 | seq_printf(p, "intr %llu", (unsigned long long)sum); | 110 | seq_printf(p, "intr %llu", (unsigned long long)sum); |
105 | 111 | ||