]> err.no Git - linux-2.6/blobdiff - fs/proc/proc_misc.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
[linux-2.6] / fs / proc / proc_misc.c
index c9d6d5f400ad0b4f9803a13438f5e7fb9c434686..e0d064e9764ef55422cf79119b7624b3e6b87373 100644 (file)
@@ -91,7 +91,8 @@ static int loadavg_read_proc(char *page, char **start, off_t off,
                LOAD_INT(a), LOAD_FRAC(a),
                LOAD_INT(b), LOAD_FRAC(b),
                LOAD_INT(c), LOAD_FRAC(c),
-               nr_running(), nr_threads, current->nsproxy->pid_ns->last_pid);
+               nr_running(), nr_threads,
+               task_active_pid_ns(current)->last_pid);
        return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
@@ -229,6 +230,19 @@ static const struct file_operations fragmentation_file_operations = {
        .release        = seq_release,
 };
 
+extern struct seq_operations pagetypeinfo_op;
+static int pagetypeinfo_open(struct inode *inode, struct file *file)
+{
+       return seq_open(file, &pagetypeinfo_op);
+}
+
+static const struct file_operations pagetypeinfo_file_ops = {
+       .open           = pagetypeinfo_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = seq_release,
+};
+
 extern struct seq_operations zoneinfo_op;
 static int zoneinfo_open(struct inode *inode, struct file *file)
 {
@@ -442,6 +456,7 @@ static int show_stat(struct seq_file *p, void *v)
        int i;
        unsigned long jif;
        cputime64_t user, nice, system, idle, iowait, irq, softirq, steal;
+       cputime64_t guest;
        u64 sum = 0;
        struct timespec boottime;
        unsigned int *per_irq_sum;
@@ -452,6 +467,7 @@ static int show_stat(struct seq_file *p, void *v)
 
        user = nice = system = idle = iowait =
                irq = softirq = steal = cputime64_zero;
+       guest = cputime64_zero;
        getboottime(&boottime);
        jif = boottime.tv_sec;
 
@@ -466,6 +482,7 @@ static int show_stat(struct seq_file *p, void *v)
                irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq);
                softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
                steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
+               guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
                for (j = 0; j < NR_IRQS; j++) {
                        unsigned int temp = kstat_cpu(i).irqs[j];
                        sum += temp;
@@ -473,7 +490,7 @@ static int show_stat(struct seq_file *p, void *v)
                }
        }
 
-       seq_printf(p, "cpu  %llu %llu %llu %llu %llu %llu %llu %llu\n",
+       seq_printf(p, "cpu  %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
                (unsigned long long)cputime64_to_clock_t(user),
                (unsigned long long)cputime64_to_clock_t(nice),
                (unsigned long long)cputime64_to_clock_t(system),
@@ -481,7 +498,8 @@ static int show_stat(struct seq_file *p, void *v)
                (unsigned long long)cputime64_to_clock_t(iowait),
                (unsigned long long)cputime64_to_clock_t(irq),
                (unsigned long long)cputime64_to_clock_t(softirq),
-               (unsigned long long)cputime64_to_clock_t(steal));
+               (unsigned long long)cputime64_to_clock_t(steal),
+               (unsigned long long)cputime64_to_clock_t(guest));
        for_each_online_cpu(i) {
 
                /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
@@ -493,7 +511,9 @@ static int show_stat(struct seq_file *p, void *v)
                irq = kstat_cpu(i).cpustat.irq;
                softirq = kstat_cpu(i).cpustat.softirq;
                steal = kstat_cpu(i).cpustat.steal;
-               seq_printf(p, "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu\n",
+               guest = kstat_cpu(i).cpustat.guest;
+               seq_printf(p,
+                       "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
                        i,
                        (unsigned long long)cputime64_to_clock_t(user),
                        (unsigned long long)cputime64_to_clock_t(nice),
@@ -502,15 +522,13 @@ static int show_stat(struct seq_file *p, void *v)
                        (unsigned long long)cputime64_to_clock_t(iowait),
                        (unsigned long long)cputime64_to_clock_t(irq),
                        (unsigned long long)cputime64_to_clock_t(softirq),
-                       (unsigned long long)cputime64_to_clock_t(steal));
+                       (unsigned long long)cputime64_to_clock_t(steal),
+                       (unsigned long long)cputime64_to_clock_t(guest));
        }
        seq_printf(p, "intr %llu", (unsigned long long)sum);
 
-#ifndef CONFIG_SMP
-       /* Touches too many cache lines on SMP setups */
        for (i = 0; i < NR_IRQS; i++)
                seq_printf(p, " %u", per_irq_sum[i]);
-#endif
 
        seq_printf(p,
                "\nctxt %llu\n"
@@ -717,6 +735,7 @@ void __init proc_misc_init(void)
 #endif
 #endif
        create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations);
+       create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops);
        create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations);
        create_seq_entry("zoneinfo",S_IRUGO, &proc_zoneinfo_file_operations);
 #ifdef CONFIG_BLOCK