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
;
141 * display in kilobytes.
143 #define K(x) ((x) << (PAGE_SHIFT - 10))
146 committed
= atomic_long_read(&vm_committed_space
);
147 allowed
= ((totalram_pages
- hugetlb_total_pages())
148 * sysctl_overcommit_ratio
/ 100) + total_swap_pages
;
150 cached
= global_page_state(NR_FILE_PAGES
) -
151 total_swapcache_pages
- i
.bufferram
;
155 get_vmalloc_info(&vmi
);
158 * Tagged format, for easy grepping and expansion.
161 "MemTotal: %8lu kB\n"
165 "SwapCached: %8lu kB\n"
167 "Inactive: %8lu kB\n"
168 #ifdef CONFIG_HIGHMEM
169 "HighTotal: %8lu kB\n"
170 "HighFree: %8lu kB\n"
171 "LowTotal: %8lu kB\n"
174 "SwapTotal: %8lu kB\n"
175 "SwapFree: %8lu kB\n"
177 "Writeback: %8lu kB\n"
178 "AnonPages: %8lu kB\n"
181 "SReclaimable: %8lu kB\n"
182 "SUnreclaim: %8lu kB\n"
183 "PageTables: %8lu kB\n"
184 #ifdef CONFIG_QUICKLIST
185 "Quicklists: %8lu kB\n"
187 "NFS_Unstable: %8lu kB\n"
189 "WritebackTmp: %8lu kB\n"
190 "CommitLimit: %8lu kB\n"
191 "Committed_AS: %8lu kB\n"
192 "VmallocTotal: %8lu kB\n"
193 "VmallocUsed: %8lu kB\n"
194 "VmallocChunk: %8lu kB\n",
199 K(total_swapcache_pages
),
200 K(global_page_state(NR_ACTIVE
)),
201 K(global_page_state(NR_INACTIVE
)),
202 #ifdef CONFIG_HIGHMEM
205 K(i
.totalram
-i
.totalhigh
),
206 K(i
.freeram
-i
.freehigh
),
210 K(global_page_state(NR_FILE_DIRTY
)),
211 K(global_page_state(NR_WRITEBACK
)),
212 K(global_page_state(NR_ANON_PAGES
)),
213 K(global_page_state(NR_FILE_MAPPED
)),
214 K(global_page_state(NR_SLAB_RECLAIMABLE
) +
215 global_page_state(NR_SLAB_UNRECLAIMABLE
)),
216 K(global_page_state(NR_SLAB_RECLAIMABLE
)),
217 K(global_page_state(NR_SLAB_UNRECLAIMABLE
)),
218 K(global_page_state(NR_PAGETABLE
)),
219 #ifdef CONFIG_QUICKLIST
220 K(quicklist_total_size()),
222 K(global_page_state(NR_UNSTABLE_NFS
)),
223 K(global_page_state(NR_BOUNCE
)),
224 K(global_page_state(NR_WRITEBACK_TEMP
)),
227 (unsigned long)VMALLOC_TOTAL
>> 10,
229 vmi
.largest_chunk
>> 10
232 len
+= hugetlb_report_meminfo(page
+ len
);
234 len
+= arch_report_meminfo(page
+ len
);
236 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
240 static int fragmentation_open(struct inode
*inode
, struct file
*file
)
243 return seq_open(file
, &fragmentation_op
);
246 static const struct file_operations fragmentation_file_operations
= {
247 .open
= fragmentation_open
,
250 .release
= seq_release
,
253 static int pagetypeinfo_open(struct inode
*inode
, struct file
*file
)
255 return seq_open(file
, &pagetypeinfo_op
);
258 static const struct file_operations pagetypeinfo_file_ops
= {
259 .open
= pagetypeinfo_open
,
262 .release
= seq_release
,
265 static int zoneinfo_open(struct inode
*inode
, struct file
*file
)
267 return seq_open(file
, &zoneinfo_op
);
270 static const struct file_operations proc_zoneinfo_file_operations
= {
271 .open
= zoneinfo_open
,
274 .release
= seq_release
,
277 static int version_read_proc(char *page
, char **start
, off_t off
,
278 int count
, int *eof
, void *data
)
282 len
= snprintf(page
, PAGE_SIZE
, linux_proc_banner
,
286 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
289 extern const struct seq_operations cpuinfo_op
;
290 static int cpuinfo_open(struct inode
*inode
, struct file
*file
)
292 return seq_open(file
, &cpuinfo_op
);
295 static const struct file_operations proc_cpuinfo_operations
= {
296 .open
= cpuinfo_open
,
299 .release
= seq_release
,
302 static int devinfo_show(struct seq_file
*f
, void *v
)
304 int i
= *(loff_t
*) v
;
306 if (i
< CHRDEV_MAJOR_HASH_SIZE
) {
308 seq_printf(f
, "Character devices:\n");
313 i
-= CHRDEV_MAJOR_HASH_SIZE
;
315 seq_printf(f
, "\nBlock devices:\n");
322 static void *devinfo_start(struct seq_file
*f
, loff_t
*pos
)
324 if (*pos
< (BLKDEV_MAJOR_HASH_SIZE
+ CHRDEV_MAJOR_HASH_SIZE
))
329 static void *devinfo_next(struct seq_file
*f
, void *v
, loff_t
*pos
)
332 if (*pos
>= (BLKDEV_MAJOR_HASH_SIZE
+ CHRDEV_MAJOR_HASH_SIZE
))
337 static void devinfo_stop(struct seq_file
*f
, void *v
)
342 static const struct seq_operations devinfo_ops
= {
343 .start
= devinfo_start
,
344 .next
= devinfo_next
,
345 .stop
= devinfo_stop
,
349 static int devinfo_open(struct inode
*inode
, struct file
*filp
)
351 return seq_open(filp
, &devinfo_ops
);
354 static const struct file_operations proc_devinfo_operations
= {
355 .open
= devinfo_open
,
358 .release
= seq_release
,
361 static int vmstat_open(struct inode
*inode
, struct file
*file
)
363 return seq_open(file
, &vmstat_op
);
365 static const struct file_operations proc_vmstat_file_operations
= {
369 .release
= seq_release
,
372 #ifdef CONFIG_PROC_HARDWARE
373 static int hardware_read_proc(char *page
, char **start
, off_t off
,
374 int count
, int *eof
, void *data
)
376 int len
= get_hardware_list(page
);
377 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
381 #ifdef CONFIG_STRAM_PROC
382 static int stram_read_proc(char *page
, char **start
, off_t off
,
383 int count
, int *eof
, void *data
)
385 int len
= get_stram_list(page
);
386 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
391 static int partitions_open(struct inode
*inode
, struct file
*file
)
393 return seq_open(file
, &partitions_op
);
395 static const struct file_operations proc_partitions_operations
= {
396 .open
= partitions_open
,
399 .release
= seq_release
,
402 static int diskstats_open(struct inode
*inode
, struct file
*file
)
404 return seq_open(file
, &diskstats_op
);
406 static const struct file_operations proc_diskstats_operations
= {
407 .open
= diskstats_open
,
410 .release
= seq_release
,
414 #ifdef CONFIG_MODULES
415 extern const struct seq_operations modules_op
;
416 static int modules_open(struct inode
*inode
, struct file
*file
)
418 return seq_open(file
, &modules_op
);
420 static const struct file_operations proc_modules_operations
= {
421 .open
= modules_open
,
424 .release
= seq_release
,
428 #ifdef CONFIG_SLABINFO
429 static int slabinfo_open(struct inode
*inode
, struct file
*file
)
431 return seq_open(file
, &slabinfo_op
);
433 static const struct file_operations proc_slabinfo_operations
= {
434 .open
= slabinfo_open
,
436 .write
= slabinfo_write
,
438 .release
= seq_release
,
441 #ifdef CONFIG_DEBUG_SLAB_LEAK
442 extern const struct seq_operations slabstats_op
;
443 static int slabstats_open(struct inode
*inode
, struct file
*file
)
445 unsigned long *n
= kzalloc(PAGE_SIZE
, GFP_KERNEL
);
448 ret
= seq_open(file
, &slabstats_op
);
450 struct seq_file
*m
= file
->private_data
;
451 *n
= PAGE_SIZE
/ (2 * sizeof(unsigned long));
460 static const struct file_operations proc_slabstats_operations
= {
461 .open
= slabstats_open
,
464 .release
= seq_release_private
,
470 static int vmalloc_open(struct inode
*inode
, struct file
*file
)
472 unsigned int *ptr
= NULL
;
476 ptr
= kmalloc(nr_node_ids
* sizeof(unsigned int), GFP_KERNEL
);
477 ret
= seq_open(file
, &vmalloc_op
);
479 struct seq_file
*m
= file
->private_data
;
486 static const struct file_operations proc_vmalloc_operations
= {
487 .open
= vmalloc_open
,
490 .release
= seq_release_private
,
494 #ifndef arch_irq_stat_cpu
495 #define arch_irq_stat_cpu(cpu) 0
497 #ifndef arch_irq_stat
498 #define arch_irq_stat() 0
501 static int show_stat(struct seq_file
*p
, void *v
)
505 cputime64_t user
, nice
, system
, idle
, iowait
, irq
, softirq
, steal
;
508 struct timespec boottime
;
509 unsigned int *per_irq_sum
;
511 per_irq_sum
= kzalloc(sizeof(unsigned int)*NR_IRQS
, GFP_KERNEL
);
515 user
= nice
= system
= idle
= iowait
=
516 irq
= softirq
= steal
= cputime64_zero
;
517 guest
= cputime64_zero
;
518 getboottime(&boottime
);
519 jif
= boottime
.tv_sec
;
521 for_each_possible_cpu(i
) {
524 user
= cputime64_add(user
, kstat_cpu(i
).cpustat
.user
);
525 nice
= cputime64_add(nice
, kstat_cpu(i
).cpustat
.nice
);
526 system
= cputime64_add(system
, kstat_cpu(i
).cpustat
.system
);
527 idle
= cputime64_add(idle
, kstat_cpu(i
).cpustat
.idle
);
528 iowait
= cputime64_add(iowait
, kstat_cpu(i
).cpustat
.iowait
);
529 irq
= cputime64_add(irq
, kstat_cpu(i
).cpustat
.irq
);
530 softirq
= cputime64_add(softirq
, kstat_cpu(i
).cpustat
.softirq
);
531 steal
= cputime64_add(steal
, kstat_cpu(i
).cpustat
.steal
);
532 guest
= cputime64_add(guest
, kstat_cpu(i
).cpustat
.guest
);
533 for (j
= 0; j
< NR_IRQS
; j
++) {
534 unsigned int temp
= kstat_cpu(i
).irqs
[j
];
536 per_irq_sum
[j
] += temp
;
538 sum
+= arch_irq_stat_cpu(i
);
540 sum
+= arch_irq_stat();
542 seq_printf(p
, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
543 (unsigned long long)cputime64_to_clock_t(user
),
544 (unsigned long long)cputime64_to_clock_t(nice
),
545 (unsigned long long)cputime64_to_clock_t(system
),
546 (unsigned long long)cputime64_to_clock_t(idle
),
547 (unsigned long long)cputime64_to_clock_t(iowait
),
548 (unsigned long long)cputime64_to_clock_t(irq
),
549 (unsigned long long)cputime64_to_clock_t(softirq
),
550 (unsigned long long)cputime64_to_clock_t(steal
),
551 (unsigned long long)cputime64_to_clock_t(guest
));
552 for_each_online_cpu(i
) {
554 /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
555 user
= kstat_cpu(i
).cpustat
.user
;
556 nice
= kstat_cpu(i
).cpustat
.nice
;
557 system
= kstat_cpu(i
).cpustat
.system
;
558 idle
= kstat_cpu(i
).cpustat
.idle
;
559 iowait
= kstat_cpu(i
).cpustat
.iowait
;
560 irq
= kstat_cpu(i
).cpustat
.irq
;
561 softirq
= kstat_cpu(i
).cpustat
.softirq
;
562 steal
= kstat_cpu(i
).cpustat
.steal
;
563 guest
= kstat_cpu(i
).cpustat
.guest
;
565 "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
567 (unsigned long long)cputime64_to_clock_t(user
),
568 (unsigned long long)cputime64_to_clock_t(nice
),
569 (unsigned long long)cputime64_to_clock_t(system
),
570 (unsigned long long)cputime64_to_clock_t(idle
),
571 (unsigned long long)cputime64_to_clock_t(iowait
),
572 (unsigned long long)cputime64_to_clock_t(irq
),
573 (unsigned long long)cputime64_to_clock_t(softirq
),
574 (unsigned long long)cputime64_to_clock_t(steal
),
575 (unsigned long long)cputime64_to_clock_t(guest
));
577 seq_printf(p
, "intr %llu", (unsigned long long)sum
);
579 for (i
= 0; i
< NR_IRQS
; i
++)
580 seq_printf(p
, " %u", per_irq_sum
[i
]);
586 "procs_running %lu\n"
587 "procs_blocked %lu\n",
588 nr_context_switches(),
598 static int stat_open(struct inode
*inode
, struct file
*file
)
600 unsigned size
= 4096 * (1 + num_possible_cpus() / 32);
605 /* don't ask for more than the kmalloc() max size, currently 128 KB */
606 if (size
> 128 * 1024)
608 buf
= kmalloc(size
, GFP_KERNEL
);
612 res
= single_open(file
, show_stat
, NULL
);
614 m
= file
->private_data
;
621 static const struct file_operations proc_stat_operations
= {
625 .release
= single_release
,
631 static void *int_seq_start(struct seq_file
*f
, loff_t
*pos
)
633 return (*pos
<= NR_IRQS
) ? pos
: NULL
;
636 static void *int_seq_next(struct seq_file
*f
, void *v
, loff_t
*pos
)
644 static void int_seq_stop(struct seq_file
*f
, void *v
)
650 static const struct seq_operations int_seq_ops
= {
651 .start
= int_seq_start
,
652 .next
= int_seq_next
,
653 .stop
= int_seq_stop
,
654 .show
= show_interrupts
657 static int interrupts_open(struct inode
*inode
, struct file
*filp
)
659 return seq_open(filp
, &int_seq_ops
);
662 static const struct file_operations proc_interrupts_operations
= {
663 .open
= interrupts_open
,
666 .release
= seq_release
,
669 static int filesystems_read_proc(char *page
, char **start
, off_t off
,
670 int count
, int *eof
, void *data
)
672 int len
= get_filesystem_list(page
);
673 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
676 static int cmdline_read_proc(char *page
, char **start
, off_t off
,
677 int count
, int *eof
, void *data
)
681 len
= sprintf(page
, "%s\n", saved_command_line
);
682 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
685 #ifdef CONFIG_FILE_LOCKING
686 static int locks_open(struct inode
*inode
, struct file
*filp
)
688 return seq_open(filp
, &locks_seq_operations
);
691 static const struct file_operations proc_locks_operations
= {
695 .release
= seq_release
,
697 #endif /* CONFIG_FILE_LOCKING */
699 static int execdomains_read_proc(char *page
, char **start
, off_t off
,
700 int count
, int *eof
, void *data
)
702 int len
= get_exec_domain_list(page
);
703 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
706 #ifdef CONFIG_PROC_PAGE_MONITOR
707 #define KPMSIZE sizeof(u64)
708 #define KPMMASK (KPMSIZE - 1)
709 /* /proc/kpagecount - an array exposing page counts
711 * Each entry is a u64 representing the corresponding
712 * physical page count.
714 static ssize_t
kpagecount_read(struct file
*file
, char __user
*buf
,
715 size_t count
, loff_t
*ppos
)
717 u64 __user
*out
= (u64 __user
*)buf
;
719 unsigned long src
= *ppos
;
725 count
= min_t(size_t, count
, (max_pfn
* KPMSIZE
) - src
);
726 if (src
& KPMMASK
|| count
& KPMMASK
)
732 ppage
= pfn_to_page(pfn
);
737 pcount
= page_mapcount(ppage
);
739 if (put_user(pcount
, out
++)) {
747 *ppos
+= (char __user
*)out
- buf
;
749 ret
= (char __user
*)out
- buf
;
753 static struct file_operations proc_kpagecount_operations
= {
755 .read
= kpagecount_read
,
758 /* /proc/kpageflags - an array exposing page flags
760 * Each entry is a u64 representing the corresponding
761 * physical page flags.
764 /* These macros are used to decouple internal flags from exported ones */
768 #define KPF_REFERENCED 2
769 #define KPF_UPTODATE 3
774 #define KPF_WRITEBACK 8
775 #define KPF_RECLAIM 9
778 #define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos)
780 static ssize_t
kpageflags_read(struct file
*file
, char __user
*buf
,
781 size_t count
, loff_t
*ppos
)
783 u64 __user
*out
= (u64 __user
*)buf
;
785 unsigned long src
= *ppos
;
791 count
= min_t(unsigned long, count
, (max_pfn
* KPMSIZE
) - src
);
792 if (src
& KPMMASK
|| count
& KPMMASK
)
798 ppage
= pfn_to_page(pfn
);
803 kflags
= ppage
->flags
;
805 uflags
= kpf_copy_bit(KPF_LOCKED
, PG_locked
, kflags
) |
806 kpf_copy_bit(kflags
, KPF_ERROR
, PG_error
) |
807 kpf_copy_bit(kflags
, KPF_REFERENCED
, PG_referenced
) |
808 kpf_copy_bit(kflags
, KPF_UPTODATE
, PG_uptodate
) |
809 kpf_copy_bit(kflags
, KPF_DIRTY
, PG_dirty
) |
810 kpf_copy_bit(kflags
, KPF_LRU
, PG_lru
) |
811 kpf_copy_bit(kflags
, KPF_ACTIVE
, PG_active
) |
812 kpf_copy_bit(kflags
, KPF_SLAB
, PG_slab
) |
813 kpf_copy_bit(kflags
, KPF_WRITEBACK
, PG_writeback
) |
814 kpf_copy_bit(kflags
, KPF_RECLAIM
, PG_reclaim
) |
815 kpf_copy_bit(kflags
, KPF_BUDDY
, PG_buddy
);
817 if (put_user(uflags
, out
++)) {
825 *ppos
+= (char __user
*)out
- buf
;
827 ret
= (char __user
*)out
- buf
;
831 static struct file_operations proc_kpageflags_operations
= {
833 .read
= kpageflags_read
,
835 #endif /* CONFIG_PROC_PAGE_MONITOR */
837 struct proc_dir_entry
*proc_root_kcore
;
839 void __init
proc_misc_init(void)
843 int (*read_proc
)(char*,char**,off_t
,int,int*,void*);
844 } *p
, simple_ones
[] = {
845 {"loadavg", loadavg_read_proc
},
846 {"uptime", uptime_read_proc
},
847 {"meminfo", meminfo_read_proc
},
848 {"version", version_read_proc
},
849 #ifdef CONFIG_PROC_HARDWARE
850 {"hardware", hardware_read_proc
},
852 #ifdef CONFIG_STRAM_PROC
853 {"stram", stram_read_proc
},
855 {"filesystems", filesystems_read_proc
},
856 {"cmdline", cmdline_read_proc
},
857 {"execdomains", execdomains_read_proc
},
860 for (p
= simple_ones
; p
->name
; p
++)
861 create_proc_read_entry(p
->name
, 0, NULL
, p
->read_proc
, NULL
);
863 proc_symlink("mounts", NULL
, "self/mounts");
865 /* And now for trickier ones */
867 proc_create("kmsg", S_IRUSR
, NULL
, &proc_kmsg_operations
);
869 #ifdef CONFIG_FILE_LOCKING
870 proc_create("locks", 0, NULL
, &proc_locks_operations
);
872 proc_create("devices", 0, NULL
, &proc_devinfo_operations
);
873 proc_create("cpuinfo", 0, NULL
, &proc_cpuinfo_operations
);
875 proc_create("partitions", 0, NULL
, &proc_partitions_operations
);
877 proc_create("stat", 0, NULL
, &proc_stat_operations
);
878 proc_create("interrupts", 0, NULL
, &proc_interrupts_operations
);
879 #ifdef CONFIG_SLABINFO
880 proc_create("slabinfo",S_IWUSR
|S_IRUGO
,NULL
,&proc_slabinfo_operations
);
881 #ifdef CONFIG_DEBUG_SLAB_LEAK
882 proc_create("slab_allocators", 0, NULL
, &proc_slabstats_operations
);
886 proc_create("vmallocinfo", S_IRUSR
, NULL
, &proc_vmalloc_operations
);
888 proc_create("buddyinfo", S_IRUGO
, NULL
, &fragmentation_file_operations
);
889 proc_create("pagetypeinfo", S_IRUGO
, NULL
, &pagetypeinfo_file_ops
);
890 proc_create("vmstat", S_IRUGO
, NULL
, &proc_vmstat_file_operations
);
891 proc_create("zoneinfo", S_IRUGO
, NULL
, &proc_zoneinfo_file_operations
);
893 proc_create("diskstats", 0, NULL
, &proc_diskstats_operations
);
895 #ifdef CONFIG_MODULES
896 proc_create("modules", 0, NULL
, &proc_modules_operations
);
898 #ifdef CONFIG_SCHEDSTATS
899 proc_create("schedstat", 0, NULL
, &proc_schedstat_operations
);
901 #ifdef CONFIG_PROC_KCORE
902 proc_root_kcore
= proc_create("kcore", S_IRUSR
, NULL
, &proc_kcore_operations
);
904 proc_root_kcore
->size
=
905 (size_t)high_memory
- PAGE_OFFSET
+ PAGE_SIZE
;
907 #ifdef CONFIG_PROC_PAGE_MONITOR
908 proc_create("kpagecount", S_IRUSR
, NULL
, &proc_kpagecount_operations
);
909 proc_create("kpageflags", S_IRUSR
, NULL
, &proc_kpageflags_operations
);
911 #ifdef CONFIG_PROC_VMCORE
912 proc_vmcore
= proc_create("vmcore", S_IRUSR
, NULL
, &proc_vmcore_operations
);