2 * linux/fs/proc/proc_misc.c
4 * linux/fs/proc/array.c
5 * Copyright (C) 1992 by Linus Torvalds
6 * based on ideas by Darren Senn
8 * This used to be the part of array.c. See the rest of history and credits
9 * there. I took this into a separate file and switched the thing to generic
10 * proc_file_inode_operations, leaving in array.c only per-process stuff.
11 * Inumbers allocation made dynamic (via create_proc_entry()). AV, May 1999.
14 * Fulton Green : Encapsulated position metric calculations.
15 * <kernel@FultonGreen.com>
18 #include <linux/types.h>
19 #include <linux/errno.h>
20 #include <linux/time.h>
21 #include <linux/kernel.h>
22 #include <linux/kernel_stat.h>
24 #include <linux/tty.h>
25 #include <linux/string.h>
26 #include <linux/mman.h>
27 #include <linux/quicklist.h>
28 #include <linux/proc_fs.h>
29 #include <linux/ioport.h>
31 #include <linux/mmzone.h>
32 #include <linux/pagemap.h>
33 #include <linux/interrupt.h>
34 #include <linux/swap.h>
35 #include <linux/slab.h>
36 #include <linux/genhd.h>
37 #include <linux/smp.h>
38 #include <linux/signal.h>
39 #include <linux/module.h>
40 #include <linux/init.h>
41 #include <linux/seq_file.h>
42 #include <linux/times.h>
43 #include <linux/profile.h>
44 #include <linux/utsname.h>
45 #include <linux/blkdev.h>
46 #include <linux/hugetlb.h>
47 #include <linux/jiffies.h>
48 #include <linux/vmalloc.h>
49 #include <linux/crash_dump.h>
50 #include <linux/pid_namespace.h>
51 #include <linux/bootmem.h>
52 #include <asm/uaccess.h>
53 #include <asm/pgtable.h>
56 #include <asm/div64.h>
59 #define LOAD_INT(x) ((x) >> FSHIFT)
60 #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
62 * Warning: stuff below (imported functions) assumes that its output will fit
63 * into one page. For some of those functions it may be wrong. Moreover, we
64 * have a way to deal with that gracefully. Right now I used straightforward
65 * wrappers, but this needs further analysis wrt potential overflows.
67 extern int get_hardware_list(char *);
68 extern int get_stram_list(char *);
69 extern int get_exec_domain_list(char *);
71 static int proc_calc_metrics(char *page, char **start, off_t off,
72 int count, int *eof, int len)
74 if (len <= off+count) *eof = 1;
77 if (len>count) len = count;
82 static int loadavg_read_proc(char *page, char **start, off_t off,
83 int count, int *eof, void *data)
90 seq = read_seqbegin(&xtime_lock);
91 a = avenrun[0] + (FIXED_1/200);
92 b = avenrun[1] + (FIXED_1/200);
93 c = avenrun[2] + (FIXED_1/200);
94 } while (read_seqretry(&xtime_lock, seq));
96 len = sprintf(page,"%d.%02d %d.%02d %d.%02d %ld/%d %d\n",
97 LOAD_INT(a), LOAD_FRAC(a),
98 LOAD_INT(b), LOAD_FRAC(b),
99 LOAD_INT(c), LOAD_FRAC(c),
100 nr_running(), nr_threads,
101 task_active_pid_ns(current)->last_pid);
102 return proc_calc_metrics(page, start, off, count, eof, len);
105 static int uptime_read_proc(char *page, char **start, off_t off,
106 int count, int *eof, void *data)
108 struct timespec uptime;
109 struct timespec idle;
111 cputime_t idletime = cputime_add(init_task.utime, init_task.stime);
113 do_posix_clock_monotonic_gettime(&uptime);
114 monotonic_to_bootbased(&uptime);
115 cputime_to_timespec(idletime, &idle);
116 len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
117 (unsigned long) uptime.tv_sec,
118 (uptime.tv_nsec / (NSEC_PER_SEC / 100)),
119 (unsigned long) idle.tv_sec,
120 (idle.tv_nsec / (NSEC_PER_SEC / 100)));
122 return proc_calc_metrics(page, start, off, count, eof, len);
125 int __attribute__((weak)) arch_report_meminfo(char *page)
130 static int meminfo_read_proc(char *page, char **start, off_t off,
131 int count, int *eof, void *data)
135 unsigned long committed;
136 unsigned long allowed;
137 struct vmalloc_info vmi;
139 unsigned long pages[NR_LRU_LISTS];
143 * display in kilobytes.
145 #define K(x) ((x) << (PAGE_SHIFT - 10))
148 committed = atomic_long_read(&vm_committed_space);
149 allowed = ((totalram_pages - hugetlb_total_pages())
150 * sysctl_overcommit_ratio / 100) + total_swap_pages;
152 cached = global_page_state(NR_FILE_PAGES) -
153 total_swapcache_pages - i.bufferram;
157 get_vmalloc_info(&vmi);
159 for (lru = LRU_BASE; lru < NR_LRU_LISTS; lru++)
160 pages[lru] = global_page_state(NR_LRU_BASE + lru);
163 * Tagged format, for easy grepping and expansion.
166 "MemTotal: %8lu kB\n"
170 "SwapCached: %8lu kB\n"
172 "Inactive: %8lu kB\n"
173 "Active(anon): %8lu kB\n"
174 "Inactive(anon): %8lu kB\n"
175 "Active(file): %8lu kB\n"
176 "Inactive(file): %8lu kB\n"
177 #ifdef CONFIG_UNEVICTABLE_LRU
178 "Unevictable: %8lu kB\n"
181 #ifdef CONFIG_HIGHMEM
182 "HighTotal: %8lu kB\n"
183 "HighFree: %8lu kB\n"
184 "LowTotal: %8lu kB\n"
187 "SwapTotal: %8lu kB\n"
188 "SwapFree: %8lu kB\n"
190 "Writeback: %8lu kB\n"
191 "AnonPages: %8lu kB\n"
194 "SReclaimable: %8lu kB\n"
195 "SUnreclaim: %8lu kB\n"
196 "PageTables: %8lu kB\n"
197 #ifdef CONFIG_QUICKLIST
198 "Quicklists: %8lu kB\n"
200 "NFS_Unstable: %8lu kB\n"
202 "WritebackTmp: %8lu kB\n"
203 "CommitLimit: %8lu kB\n"
204 "Committed_AS: %8lu kB\n"
205 "VmallocTotal: %8lu kB\n"
206 "VmallocUsed: %8lu kB\n"
207 "VmallocChunk: %8lu kB\n",
212 K(total_swapcache_pages),
213 K(pages[LRU_ACTIVE_ANON] + pages[LRU_ACTIVE_FILE]),
214 K(pages[LRU_INACTIVE_ANON] + pages[LRU_INACTIVE_FILE]),
215 K(pages[LRU_ACTIVE_ANON]),
216 K(pages[LRU_INACTIVE_ANON]),
217 K(pages[LRU_ACTIVE_FILE]),
218 K(pages[LRU_INACTIVE_FILE]),
219 #ifdef CONFIG_UNEVICTABLE_LRU
220 K(pages[LRU_UNEVICTABLE]),
221 K(global_page_state(NR_MLOCK)),
223 #ifdef CONFIG_HIGHMEM
226 K(i.totalram-i.totalhigh),
227 K(i.freeram-i.freehigh),
231 K(global_page_state(NR_FILE_DIRTY)),
232 K(global_page_state(NR_WRITEBACK)),
233 K(global_page_state(NR_ANON_PAGES)),
234 K(global_page_state(NR_FILE_MAPPED)),
235 K(global_page_state(NR_SLAB_RECLAIMABLE) +
236 global_page_state(NR_SLAB_UNRECLAIMABLE)),
237 K(global_page_state(NR_SLAB_RECLAIMABLE)),
238 K(global_page_state(NR_SLAB_UNRECLAIMABLE)),
239 K(global_page_state(NR_PAGETABLE)),
240 #ifdef CONFIG_QUICKLIST
241 K(quicklist_total_size()),
243 K(global_page_state(NR_UNSTABLE_NFS)),
244 K(global_page_state(NR_BOUNCE)),
245 K(global_page_state(NR_WRITEBACK_TEMP)),
248 (unsigned long)VMALLOC_TOTAL >> 10,
250 vmi.largest_chunk >> 10
253 len += hugetlb_report_meminfo(page + len);
255 len += arch_report_meminfo(page + len);
257 return proc_calc_metrics(page, start, off, count, eof, len);
261 static int fragmentation_open(struct inode *inode, struct file *file)
264 return seq_open(file, &fragmentation_op);
267 static const struct file_operations fragmentation_file_operations = {
268 .open = fragmentation_open,
271 .release = seq_release,
274 static int pagetypeinfo_open(struct inode *inode, struct file *file)
276 return seq_open(file, &pagetypeinfo_op);
279 static const struct file_operations pagetypeinfo_file_ops = {
280 .open = pagetypeinfo_open,
283 .release = seq_release,
286 static int zoneinfo_open(struct inode *inode, struct file *file)
288 return seq_open(file, &zoneinfo_op);
291 static const struct file_operations proc_zoneinfo_file_operations = {
292 .open = zoneinfo_open,
295 .release = seq_release,
298 static int version_read_proc(char *page, char **start, off_t off,
299 int count, int *eof, void *data)
303 len = snprintf(page, PAGE_SIZE, linux_proc_banner,
307 return proc_calc_metrics(page, start, off, count, eof, len);
310 extern const struct seq_operations cpuinfo_op;
311 static int cpuinfo_open(struct inode *inode, struct file *file)
313 return seq_open(file, &cpuinfo_op);
316 static const struct file_operations proc_cpuinfo_operations = {
317 .open = cpuinfo_open,
320 .release = seq_release,
323 static int devinfo_show(struct seq_file *f, void *v)
325 int i = *(loff_t *) v;
327 if (i < CHRDEV_MAJOR_HASH_SIZE) {
329 seq_printf(f, "Character devices:\n");
334 i -= CHRDEV_MAJOR_HASH_SIZE;
336 seq_printf(f, "\nBlock devices:\n");
343 static void *devinfo_start(struct seq_file *f, loff_t *pos)
345 if (*pos < (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE))
350 static void *devinfo_next(struct seq_file *f, void *v, loff_t *pos)
353 if (*pos >= (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE))
358 static void devinfo_stop(struct seq_file *f, void *v)
363 static const struct seq_operations devinfo_ops = {
364 .start = devinfo_start,
365 .next = devinfo_next,
366 .stop = devinfo_stop,
370 static int devinfo_open(struct inode *inode, struct file *filp)
372 return seq_open(filp, &devinfo_ops);
375 static const struct file_operations proc_devinfo_operations = {
376 .open = devinfo_open,
379 .release = seq_release,
382 static int vmstat_open(struct inode *inode, struct file *file)
384 return seq_open(file, &vmstat_op);
386 static const struct file_operations proc_vmstat_file_operations = {
390 .release = seq_release,
393 #ifdef CONFIG_PROC_HARDWARE
394 static int hardware_read_proc(char *page, char **start, off_t off,
395 int count, int *eof, void *data)
397 int len = get_hardware_list(page);
398 return proc_calc_metrics(page, start, off, count, eof, len);
402 #ifdef CONFIG_STRAM_PROC
403 static int stram_read_proc(char *page, char **start, off_t off,
404 int count, int *eof, void *data)
406 int len = get_stram_list(page);
407 return proc_calc_metrics(page, start, off, count, eof, len);
412 static int partitions_open(struct inode *inode, struct file *file)
414 return seq_open(file, &partitions_op);
416 static const struct file_operations proc_partitions_operations = {
417 .open = partitions_open,
420 .release = seq_release,
423 static int diskstats_open(struct inode *inode, struct file *file)
425 return seq_open(file, &diskstats_op);
427 static const struct file_operations proc_diskstats_operations = {
428 .open = diskstats_open,
431 .release = seq_release,
435 #ifdef CONFIG_MODULES
436 extern const struct seq_operations modules_op;
437 static int modules_open(struct inode *inode, struct file *file)
439 return seq_open(file, &modules_op);
441 static const struct file_operations proc_modules_operations = {
442 .open = modules_open,
445 .release = seq_release,
449 #ifdef CONFIG_SLABINFO
450 static int slabinfo_open(struct inode *inode, struct file *file)
452 return seq_open(file, &slabinfo_op);
454 static const struct file_operations proc_slabinfo_operations = {
455 .open = slabinfo_open,
457 .write = slabinfo_write,
459 .release = seq_release,
462 #ifdef CONFIG_DEBUG_SLAB_LEAK
463 extern const struct seq_operations slabstats_op;
464 static int slabstats_open(struct inode *inode, struct file *file)
466 unsigned long *n = kzalloc(PAGE_SIZE, GFP_KERNEL);
469 ret = seq_open(file, &slabstats_op);
471 struct seq_file *m = file->private_data;
472 *n = PAGE_SIZE / (2 * sizeof(unsigned long));
481 static const struct file_operations proc_slabstats_operations = {
482 .open = slabstats_open,
485 .release = seq_release_private,
491 static int vmalloc_open(struct inode *inode, struct file *file)
493 unsigned int *ptr = NULL;
497 ptr = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL);
498 ret = seq_open(file, &vmalloc_op);
500 struct seq_file *m = file->private_data;
507 static const struct file_operations proc_vmalloc_operations = {
508 .open = vmalloc_open,
511 .release = seq_release_private,
515 #ifndef arch_irq_stat_cpu
516 #define arch_irq_stat_cpu(cpu) 0
518 #ifndef arch_irq_stat
519 #define arch_irq_stat() 0
522 static int show_stat(struct seq_file *p, void *v)
526 cputime64_t user, nice, system, idle, iowait, irq, softirq, steal;
529 struct timespec boottime;
530 unsigned int *per_irq_sum;
532 per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL);
536 user = nice = system = idle = iowait =
537 irq = softirq = steal = cputime64_zero;
538 guest = cputime64_zero;
539 getboottime(&boottime);
540 jif = boottime.tv_sec;
542 for_each_possible_cpu(i) {
545 user = cputime64_add(user, kstat_cpu(i).cpustat.user);
546 nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice);
547 system = cputime64_add(system, kstat_cpu(i).cpustat.system);
548 idle = cputime64_add(idle, kstat_cpu(i).cpustat.idle);
549 iowait = cputime64_add(iowait, kstat_cpu(i).cpustat.iowait);
550 irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq);
551 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
552 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
553 guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
554 for (j = 0; j < NR_IRQS; j++) {
555 unsigned int temp = kstat_cpu(i).irqs[j];
557 per_irq_sum[j] += temp;
559 sum += arch_irq_stat_cpu(i);
561 sum += arch_irq_stat();
563 seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
564 (unsigned long long)cputime64_to_clock_t(user),
565 (unsigned long long)cputime64_to_clock_t(nice),
566 (unsigned long long)cputime64_to_clock_t(system),
567 (unsigned long long)cputime64_to_clock_t(idle),
568 (unsigned long long)cputime64_to_clock_t(iowait),
569 (unsigned long long)cputime64_to_clock_t(irq),
570 (unsigned long long)cputime64_to_clock_t(softirq),
571 (unsigned long long)cputime64_to_clock_t(steal),
572 (unsigned long long)cputime64_to_clock_t(guest));
573 for_each_online_cpu(i) {
575 /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
576 user = kstat_cpu(i).cpustat.user;
577 nice = kstat_cpu(i).cpustat.nice;
578 system = kstat_cpu(i).cpustat.system;
579 idle = kstat_cpu(i).cpustat.idle;
580 iowait = kstat_cpu(i).cpustat.iowait;
581 irq = kstat_cpu(i).cpustat.irq;
582 softirq = kstat_cpu(i).cpustat.softirq;
583 steal = kstat_cpu(i).cpustat.steal;
584 guest = kstat_cpu(i).cpustat.guest;
586 "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
588 (unsigned long long)cputime64_to_clock_t(user),
589 (unsigned long long)cputime64_to_clock_t(nice),
590 (unsigned long long)cputime64_to_clock_t(system),
591 (unsigned long long)cputime64_to_clock_t(idle),
592 (unsigned long long)cputime64_to_clock_t(iowait),
593 (unsigned long long)cputime64_to_clock_t(irq),
594 (unsigned long long)cputime64_to_clock_t(softirq),
595 (unsigned long long)cputime64_to_clock_t(steal),
596 (unsigned long long)cputime64_to_clock_t(guest));
598 seq_printf(p, "intr %llu", (unsigned long long)sum);
600 for (i = 0; i < NR_IRQS; i++)
601 seq_printf(p, " %u", per_irq_sum[i]);
607 "procs_running %lu\n"
608 "procs_blocked %lu\n",
609 nr_context_switches(),
619 static int stat_open(struct inode *inode, struct file *file)
621 unsigned size = 4096 * (1 + num_possible_cpus() / 32);
626 /* don't ask for more than the kmalloc() max size, currently 128 KB */
627 if (size > 128 * 1024)
629 buf = kmalloc(size, GFP_KERNEL);
633 res = single_open(file, show_stat, NULL);
635 m = file->private_data;
642 static const struct file_operations proc_stat_operations = {
646 .release = single_release,
652 static void *int_seq_start(struct seq_file *f, loff_t *pos)
654 return (*pos <= NR_IRQS) ? pos : NULL;
657 static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
665 static void int_seq_stop(struct seq_file *f, void *v)
671 static const struct seq_operations int_seq_ops = {
672 .start = int_seq_start,
673 .next = int_seq_next,
674 .stop = int_seq_stop,
675 .show = show_interrupts
678 static int interrupts_open(struct inode *inode, struct file *filp)
680 return seq_open(filp, &int_seq_ops);
683 static const struct file_operations proc_interrupts_operations = {
684 .open = interrupts_open,
687 .release = seq_release,
690 static int filesystems_read_proc(char *page, char **start, off_t off,
691 int count, int *eof, void *data)
693 int len = get_filesystem_list(page);
694 return proc_calc_metrics(page, start, off, count, eof, len);
697 static int cmdline_read_proc(char *page, char **start, off_t off,
698 int count, int *eof, void *data)
702 len = sprintf(page, "%s\n", saved_command_line);
703 return proc_calc_metrics(page, start, off, count, eof, len);
706 #ifdef CONFIG_FILE_LOCKING
707 static int locks_open(struct inode *inode, struct file *filp)
709 return seq_open(filp, &locks_seq_operations);
712 static const struct file_operations proc_locks_operations = {
716 .release = seq_release,
718 #endif /* CONFIG_FILE_LOCKING */
720 static int execdomains_read_proc(char *page, char **start, off_t off,
721 int count, int *eof, void *data)
723 int len = get_exec_domain_list(page);
724 return proc_calc_metrics(page, start, off, count, eof, len);
727 #ifdef CONFIG_PROC_PAGE_MONITOR
728 #define KPMSIZE sizeof(u64)
729 #define KPMMASK (KPMSIZE - 1)
730 /* /proc/kpagecount - an array exposing page counts
732 * Each entry is a u64 representing the corresponding
733 * physical page count.
735 static ssize_t kpagecount_read(struct file *file, char __user *buf,
736 size_t count, loff_t *ppos)
738 u64 __user *out = (u64 __user *)buf;
740 unsigned long src = *ppos;
746 count = min_t(size_t, count, (max_pfn * KPMSIZE) - src);
747 if (src & KPMMASK || count & KPMMASK)
753 ppage = pfn_to_page(pfn);
758 pcount = page_mapcount(ppage);
760 if (put_user(pcount, out++)) {
768 *ppos += (char __user *)out - buf;
770 ret = (char __user *)out - buf;
774 static struct file_operations proc_kpagecount_operations = {
776 .read = kpagecount_read,
779 /* /proc/kpageflags - an array exposing page flags
781 * Each entry is a u64 representing the corresponding
782 * physical page flags.
785 /* These macros are used to decouple internal flags from exported ones */
789 #define KPF_REFERENCED 2
790 #define KPF_UPTODATE 3
795 #define KPF_WRITEBACK 8
796 #define KPF_RECLAIM 9
799 #define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos)
801 static ssize_t kpageflags_read(struct file *file, char __user *buf,
802 size_t count, loff_t *ppos)
804 u64 __user *out = (u64 __user *)buf;
806 unsigned long src = *ppos;
812 count = min_t(unsigned long, count, (max_pfn * KPMSIZE) - src);
813 if (src & KPMMASK || count & KPMMASK)
819 ppage = pfn_to_page(pfn);
824 kflags = ppage->flags;
826 uflags = kpf_copy_bit(KPF_LOCKED, PG_locked, kflags) |
827 kpf_copy_bit(kflags, KPF_ERROR, PG_error) |
828 kpf_copy_bit(kflags, KPF_REFERENCED, PG_referenced) |
829 kpf_copy_bit(kflags, KPF_UPTODATE, PG_uptodate) |
830 kpf_copy_bit(kflags, KPF_DIRTY, PG_dirty) |
831 kpf_copy_bit(kflags, KPF_LRU, PG_lru) |
832 kpf_copy_bit(kflags, KPF_ACTIVE, PG_active) |
833 kpf_copy_bit(kflags, KPF_SLAB, PG_slab) |
834 kpf_copy_bit(kflags, KPF_WRITEBACK, PG_writeback) |
835 kpf_copy_bit(kflags, KPF_RECLAIM, PG_reclaim) |
836 kpf_copy_bit(kflags, KPF_BUDDY, PG_buddy);
838 if (put_user(uflags, out++)) {
846 *ppos += (char __user *)out - buf;
848 ret = (char __user *)out - buf;
852 static struct file_operations proc_kpageflags_operations = {
854 .read = kpageflags_read,
856 #endif /* CONFIG_PROC_PAGE_MONITOR */
858 struct proc_dir_entry *proc_root_kcore;
860 void __init proc_misc_init(void)
864 int (*read_proc)(char*,char**,off_t,int,int*,void*);
865 } *p, simple_ones[] = {
866 {"loadavg", loadavg_read_proc},
867 {"uptime", uptime_read_proc},
868 {"meminfo", meminfo_read_proc},
869 {"version", version_read_proc},
870 #ifdef CONFIG_PROC_HARDWARE
871 {"hardware", hardware_read_proc},
873 #ifdef CONFIG_STRAM_PROC
874 {"stram", stram_read_proc},
876 {"filesystems", filesystems_read_proc},
877 {"cmdline", cmdline_read_proc},
878 {"execdomains", execdomains_read_proc},
881 for (p = simple_ones; p->name; p++)
882 create_proc_read_entry(p->name, 0, NULL, p->read_proc, NULL);
884 proc_symlink("mounts", NULL, "self/mounts");
886 /* And now for trickier ones */
888 proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations);
890 #ifdef CONFIG_FILE_LOCKING
891 proc_create("locks", 0, NULL, &proc_locks_operations);
893 proc_create("devices", 0, NULL, &proc_devinfo_operations);
894 proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
896 proc_create("partitions", 0, NULL, &proc_partitions_operations);
898 proc_create("stat", 0, NULL, &proc_stat_operations);
899 proc_create("interrupts", 0, NULL, &proc_interrupts_operations);
900 #ifdef CONFIG_SLABINFO
901 proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
902 #ifdef CONFIG_DEBUG_SLAB_LEAK
903 proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations);
907 proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations);
909 proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);
910 proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops);
911 proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations);
912 proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations);
914 proc_create("diskstats", 0, NULL, &proc_diskstats_operations);
916 #ifdef CONFIG_MODULES
917 proc_create("modules", 0, NULL, &proc_modules_operations);
919 #ifdef CONFIG_SCHEDSTATS
920 proc_create("schedstat", 0, NULL, &proc_schedstat_operations);
922 #ifdef CONFIG_PROC_KCORE
923 proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations);
925 proc_root_kcore->size =
926 (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE;
928 #ifdef CONFIG_PROC_PAGE_MONITOR
929 proc_create("kpagecount", S_IRUSR, NULL, &proc_kpagecount_operations);
930 proc_create("kpageflags", S_IRUSR, NULL, &proc_kpageflags_operations);
932 #ifdef CONFIG_PROC_VMCORE
933 proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &proc_vmcore_operations);