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/proc_fs.h>
28 #include <linux/ioport.h>
30 #include <linux/mmzone.h>
31 #include <linux/pagemap.h>
32 #include <linux/interrupt.h>
33 #include <linux/swap.h>
34 #include <linux/slab.h>
35 #include <linux/smp.h>
36 #include <linux/signal.h>
37 #include <linux/module.h>
38 #include <linux/init.h>
39 #include <linux/seq_file.h>
40 #include <linux/times.h>
41 #include <linux/profile.h>
42 #include <linux/utsname.h>
43 #include <linux/blkdev.h>
44 #include <linux/hugetlb.h>
45 #include <linux/jiffies.h>
46 #include <linux/sysrq.h>
47 #include <linux/vmalloc.h>
48 #include <linux/crash_dump.h>
49 #include <linux/pid_namespace.h>
50 #include <linux/bootmem.h>
51 #include <asm/uaccess.h>
52 #include <asm/pgtable.h>
55 #include <asm/div64.h>
58 #define LOAD_INT(x) ((x) >> FSHIFT)
59 #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
61 * Warning: stuff below (imported functions) assumes that its output will fit
62 * into one page. For some of those functions it may be wrong. Moreover, we
63 * have a way to deal with that gracefully. Right now I used straightforward
64 * wrappers, but this needs further analysis wrt potential overflows.
66 extern int get_hardware_list(char *);
67 extern int get_stram_list(char *);
68 extern int get_exec_domain_list(char *);
69 extern int get_dma_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 static int meminfo_read_proc(char *page
, char **start
, off_t off
,
126 int count
, int *eof
, void *data
)
130 unsigned long committed
;
131 unsigned long allowed
;
132 struct vmalloc_info vmi
;
136 * display in kilobytes.
138 #define K(x) ((x) << (PAGE_SHIFT - 10))
141 committed
= atomic_read(&vm_committed_space
);
142 allowed
= ((totalram_pages
- hugetlb_total_pages())
143 * sysctl_overcommit_ratio
/ 100) + total_swap_pages
;
145 cached
= global_page_state(NR_FILE_PAGES
) -
146 total_swapcache_pages
- i
.bufferram
;
150 get_vmalloc_info(&vmi
);
153 * Tagged format, for easy grepping and expansion.
156 "MemTotal: %8lu kB\n"
160 "SwapCached: %8lu kB\n"
162 "Inactive: %8lu kB\n"
163 #ifdef CONFIG_HIGHMEM
164 "HighTotal: %8lu kB\n"
165 "HighFree: %8lu kB\n"
166 "LowTotal: %8lu kB\n"
169 "SwapTotal: %8lu kB\n"
170 "SwapFree: %8lu kB\n"
172 "Writeback: %8lu kB\n"
173 "AnonPages: %8lu kB\n"
176 "SReclaimable: %8lu kB\n"
177 "SUnreclaim: %8lu kB\n"
178 "PageTables: %8lu kB\n"
179 "NFS_Unstable: %8lu kB\n"
181 "CommitLimit: %8lu kB\n"
182 "Committed_AS: %8lu kB\n"
183 "VmallocTotal: %8lu kB\n"
184 "VmallocUsed: %8lu kB\n"
185 "VmallocChunk: %8lu kB\n",
190 K(total_swapcache_pages
),
191 K(global_page_state(NR_ACTIVE
)),
192 K(global_page_state(NR_INACTIVE
)),
193 #ifdef CONFIG_HIGHMEM
196 K(i
.totalram
-i
.totalhigh
),
197 K(i
.freeram
-i
.freehigh
),
201 K(global_page_state(NR_FILE_DIRTY
)),
202 K(global_page_state(NR_WRITEBACK
)),
203 K(global_page_state(NR_ANON_PAGES
)),
204 K(global_page_state(NR_FILE_MAPPED
)),
205 K(global_page_state(NR_SLAB_RECLAIMABLE
) +
206 global_page_state(NR_SLAB_UNRECLAIMABLE
)),
207 K(global_page_state(NR_SLAB_RECLAIMABLE
)),
208 K(global_page_state(NR_SLAB_UNRECLAIMABLE
)),
209 K(global_page_state(NR_PAGETABLE
)),
210 K(global_page_state(NR_UNSTABLE_NFS
)),
211 K(global_page_state(NR_BOUNCE
)),
214 (unsigned long)VMALLOC_TOTAL
>> 10,
216 vmi
.largest_chunk
>> 10
219 len
+= hugetlb_report_meminfo(page
+ len
);
221 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
225 extern const struct seq_operations fragmentation_op
;
226 static int fragmentation_open(struct inode
*inode
, struct file
*file
)
229 return seq_open(file
, &fragmentation_op
);
232 static const struct file_operations fragmentation_file_operations
= {
233 .open
= fragmentation_open
,
236 .release
= seq_release
,
239 extern const struct seq_operations pagetypeinfo_op
;
240 static int pagetypeinfo_open(struct inode
*inode
, struct file
*file
)
242 return seq_open(file
, &pagetypeinfo_op
);
245 static const struct file_operations pagetypeinfo_file_ops
= {
246 .open
= pagetypeinfo_open
,
249 .release
= seq_release
,
252 extern const struct seq_operations zoneinfo_op
;
253 static int zoneinfo_open(struct inode
*inode
, struct file
*file
)
255 return seq_open(file
, &zoneinfo_op
);
258 static const struct file_operations proc_zoneinfo_file_operations
= {
259 .open
= zoneinfo_open
,
262 .release
= seq_release
,
265 static int version_read_proc(char *page
, char **start
, off_t off
,
266 int count
, int *eof
, void *data
)
270 len
= snprintf(page
, PAGE_SIZE
, linux_proc_banner
,
274 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
277 extern const struct seq_operations cpuinfo_op
;
278 static int cpuinfo_open(struct inode
*inode
, struct file
*file
)
280 return seq_open(file
, &cpuinfo_op
);
283 static const struct file_operations proc_cpuinfo_operations
= {
284 .open
= cpuinfo_open
,
287 .release
= seq_release
,
290 static int devinfo_show(struct seq_file
*f
, void *v
)
292 int i
= *(loff_t
*) v
;
294 if (i
< CHRDEV_MAJOR_HASH_SIZE
) {
296 seq_printf(f
, "Character devices:\n");
301 i
-= CHRDEV_MAJOR_HASH_SIZE
;
303 seq_printf(f
, "\nBlock devices:\n");
310 static void *devinfo_start(struct seq_file
*f
, loff_t
*pos
)
312 if (*pos
< (BLKDEV_MAJOR_HASH_SIZE
+ CHRDEV_MAJOR_HASH_SIZE
))
317 static void *devinfo_next(struct seq_file
*f
, void *v
, loff_t
*pos
)
320 if (*pos
>= (BLKDEV_MAJOR_HASH_SIZE
+ CHRDEV_MAJOR_HASH_SIZE
))
325 static void devinfo_stop(struct seq_file
*f
, void *v
)
330 static const struct seq_operations devinfo_ops
= {
331 .start
= devinfo_start
,
332 .next
= devinfo_next
,
333 .stop
= devinfo_stop
,
337 static int devinfo_open(struct inode
*inode
, struct file
*filp
)
339 return seq_open(filp
, &devinfo_ops
);
342 static const struct file_operations proc_devinfo_operations
= {
343 .open
= devinfo_open
,
346 .release
= seq_release
,
349 extern const struct seq_operations vmstat_op
;
350 static int vmstat_open(struct inode
*inode
, struct file
*file
)
352 return seq_open(file
, &vmstat_op
);
354 static const struct file_operations proc_vmstat_file_operations
= {
358 .release
= seq_release
,
361 #ifdef CONFIG_PROC_HARDWARE
362 static int hardware_read_proc(char *page
, char **start
, off_t off
,
363 int count
, int *eof
, void *data
)
365 int len
= get_hardware_list(page
);
366 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
370 #ifdef CONFIG_STRAM_PROC
371 static int stram_read_proc(char *page
, char **start
, off_t off
,
372 int count
, int *eof
, void *data
)
374 int len
= get_stram_list(page
);
375 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
380 extern const struct seq_operations partitions_op
;
381 static int partitions_open(struct inode
*inode
, struct file
*file
)
383 return seq_open(file
, &partitions_op
);
385 static const struct file_operations proc_partitions_operations
= {
386 .open
= partitions_open
,
389 .release
= seq_release
,
392 extern const struct seq_operations diskstats_op
;
393 static int diskstats_open(struct inode
*inode
, struct file
*file
)
395 return seq_open(file
, &diskstats_op
);
397 static const struct file_operations proc_diskstats_operations
= {
398 .open
= diskstats_open
,
401 .release
= seq_release
,
405 #ifdef CONFIG_MODULES
406 extern const struct seq_operations modules_op
;
407 static int modules_open(struct inode
*inode
, struct file
*file
)
409 return seq_open(file
, &modules_op
);
411 static const struct file_operations proc_modules_operations
= {
412 .open
= modules_open
,
415 .release
= seq_release
,
419 #ifdef CONFIG_SLABINFO
420 static int slabinfo_open(struct inode
*inode
, struct file
*file
)
422 return seq_open(file
, &slabinfo_op
);
424 static const struct file_operations proc_slabinfo_operations
= {
425 .open
= slabinfo_open
,
427 .write
= slabinfo_write
,
429 .release
= seq_release
,
432 #ifdef CONFIG_DEBUG_SLAB_LEAK
433 extern const struct seq_operations slabstats_op
;
434 static int slabstats_open(struct inode
*inode
, struct file
*file
)
436 unsigned long *n
= kzalloc(PAGE_SIZE
, GFP_KERNEL
);
439 ret
= seq_open(file
, &slabstats_op
);
441 struct seq_file
*m
= file
->private_data
;
442 *n
= PAGE_SIZE
/ (2 * sizeof(unsigned long));
451 static const struct file_operations proc_slabstats_operations
= {
452 .open
= slabstats_open
,
455 .release
= seq_release_private
,
460 static int show_stat(struct seq_file
*p
, void *v
)
464 cputime64_t user
, nice
, system
, idle
, iowait
, irq
, softirq
, steal
;
467 struct timespec boottime
;
468 unsigned int *per_irq_sum
;
470 per_irq_sum
= kzalloc(sizeof(unsigned int)*NR_IRQS
, GFP_KERNEL
);
474 user
= nice
= system
= idle
= iowait
=
475 irq
= softirq
= steal
= cputime64_zero
;
476 guest
= cputime64_zero
;
477 getboottime(&boottime
);
478 jif
= boottime
.tv_sec
;
480 for_each_possible_cpu(i
) {
483 user
= cputime64_add(user
, kstat_cpu(i
).cpustat
.user
);
484 nice
= cputime64_add(nice
, kstat_cpu(i
).cpustat
.nice
);
485 system
= cputime64_add(system
, kstat_cpu(i
).cpustat
.system
);
486 idle
= cputime64_add(idle
, kstat_cpu(i
).cpustat
.idle
);
487 iowait
= cputime64_add(iowait
, kstat_cpu(i
).cpustat
.iowait
);
488 irq
= cputime64_add(irq
, kstat_cpu(i
).cpustat
.irq
);
489 softirq
= cputime64_add(softirq
, kstat_cpu(i
).cpustat
.softirq
);
490 steal
= cputime64_add(steal
, kstat_cpu(i
).cpustat
.steal
);
491 guest
= cputime64_add(guest
, kstat_cpu(i
).cpustat
.guest
);
492 for (j
= 0; j
< NR_IRQS
; j
++) {
493 unsigned int temp
= kstat_cpu(i
).irqs
[j
];
495 per_irq_sum
[j
] += temp
;
499 seq_printf(p
, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
500 (unsigned long long)cputime64_to_clock_t(user
),
501 (unsigned long long)cputime64_to_clock_t(nice
),
502 (unsigned long long)cputime64_to_clock_t(system
),
503 (unsigned long long)cputime64_to_clock_t(idle
),
504 (unsigned long long)cputime64_to_clock_t(iowait
),
505 (unsigned long long)cputime64_to_clock_t(irq
),
506 (unsigned long long)cputime64_to_clock_t(softirq
),
507 (unsigned long long)cputime64_to_clock_t(steal
),
508 (unsigned long long)cputime64_to_clock_t(guest
));
509 for_each_online_cpu(i
) {
511 /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
512 user
= kstat_cpu(i
).cpustat
.user
;
513 nice
= kstat_cpu(i
).cpustat
.nice
;
514 system
= kstat_cpu(i
).cpustat
.system
;
515 idle
= kstat_cpu(i
).cpustat
.idle
;
516 iowait
= kstat_cpu(i
).cpustat
.iowait
;
517 irq
= kstat_cpu(i
).cpustat
.irq
;
518 softirq
= kstat_cpu(i
).cpustat
.softirq
;
519 steal
= kstat_cpu(i
).cpustat
.steal
;
520 guest
= kstat_cpu(i
).cpustat
.guest
;
522 "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
524 (unsigned long long)cputime64_to_clock_t(user
),
525 (unsigned long long)cputime64_to_clock_t(nice
),
526 (unsigned long long)cputime64_to_clock_t(system
),
527 (unsigned long long)cputime64_to_clock_t(idle
),
528 (unsigned long long)cputime64_to_clock_t(iowait
),
529 (unsigned long long)cputime64_to_clock_t(irq
),
530 (unsigned long long)cputime64_to_clock_t(softirq
),
531 (unsigned long long)cputime64_to_clock_t(steal
),
532 (unsigned long long)cputime64_to_clock_t(guest
));
534 seq_printf(p
, "intr %llu", (unsigned long long)sum
);
536 for (i
= 0; i
< NR_IRQS
; i
++)
537 seq_printf(p
, " %u", per_irq_sum
[i
]);
543 "procs_running %lu\n"
544 "procs_blocked %lu\n",
545 nr_context_switches(),
555 static int stat_open(struct inode
*inode
, struct file
*file
)
557 unsigned size
= 4096 * (1 + num_possible_cpus() / 32);
562 /* don't ask for more than the kmalloc() max size, currently 128 KB */
563 if (size
> 128 * 1024)
565 buf
= kmalloc(size
, GFP_KERNEL
);
569 res
= single_open(file
, show_stat
, NULL
);
571 m
= file
->private_data
;
578 static const struct file_operations proc_stat_operations
= {
582 .release
= single_release
,
588 static void *int_seq_start(struct seq_file
*f
, loff_t
*pos
)
590 return (*pos
<= NR_IRQS
) ? pos
: NULL
;
593 static void *int_seq_next(struct seq_file
*f
, void *v
, loff_t
*pos
)
601 static void int_seq_stop(struct seq_file
*f
, void *v
)
607 static const struct seq_operations int_seq_ops
= {
608 .start
= int_seq_start
,
609 .next
= int_seq_next
,
610 .stop
= int_seq_stop
,
611 .show
= show_interrupts
614 static int interrupts_open(struct inode
*inode
, struct file
*filp
)
616 return seq_open(filp
, &int_seq_ops
);
619 static const struct file_operations proc_interrupts_operations
= {
620 .open
= interrupts_open
,
623 .release
= seq_release
,
626 static int filesystems_read_proc(char *page
, char **start
, off_t off
,
627 int count
, int *eof
, void *data
)
629 int len
= get_filesystem_list(page
);
630 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
633 static int cmdline_read_proc(char *page
, char **start
, off_t off
,
634 int count
, int *eof
, void *data
)
638 len
= sprintf(page
, "%s\n", saved_command_line
);
639 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
642 static int locks_open(struct inode
*inode
, struct file
*filp
)
644 return seq_open(filp
, &locks_seq_operations
);
647 static const struct file_operations proc_locks_operations
= {
651 .release
= seq_release
,
654 static int execdomains_read_proc(char *page
, char **start
, off_t off
,
655 int count
, int *eof
, void *data
)
657 int len
= get_exec_domain_list(page
);
658 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
661 #ifdef CONFIG_MAGIC_SYSRQ
663 * writing 'C' to /proc/sysrq-trigger is like sysrq-C
665 static ssize_t
write_sysrq_trigger(struct file
*file
, const char __user
*buf
,
666 size_t count
, loff_t
*ppos
)
671 if (get_user(c
, buf
))
673 __handle_sysrq(c
, NULL
, 0);
678 static const struct file_operations proc_sysrq_trigger_operations
= {
679 .write
= write_sysrq_trigger
,
683 #ifdef CONFIG_PROC_PAGE_MONITOR
684 #define KPMSIZE sizeof(u64)
685 #define KPMMASK (KPMSIZE - 1)
686 /* /proc/kpagecount - an array exposing page counts
688 * Each entry is a u64 representing the corresponding
689 * physical page count.
691 static ssize_t
kpagecount_read(struct file
*file
, char __user
*buf
,
692 size_t count
, loff_t
*ppos
)
694 u64 __user
*out
= (u64 __user
*)buf
;
696 unsigned long src
= *ppos
;
702 count
= min_t(size_t, count
, (max_pfn
* KPMSIZE
) - src
);
703 if (src
& KPMMASK
|| count
& KPMMASK
)
709 ppage
= pfn_to_page(pfn
);
714 pcount
= atomic_read(&ppage
->_count
);
716 if (put_user(pcount
, out
++)) {
724 *ppos
+= (char __user
*)out
- buf
;
726 ret
= (char __user
*)out
- buf
;
730 static struct file_operations proc_kpagecount_operations
= {
732 .read
= kpagecount_read
,
735 /* /proc/kpageflags - an array exposing page flags
737 * Each entry is a u64 representing the corresponding
738 * physical page flags.
741 /* These macros are used to decouple internal flags from exported ones */
745 #define KPF_REFERENCED 2
746 #define KPF_UPTODATE 3
751 #define KPF_WRITEBACK 8
752 #define KPF_RECLAIM 9
755 #define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos)
757 static ssize_t
kpageflags_read(struct file
*file
, char __user
*buf
,
758 size_t count
, loff_t
*ppos
)
760 u64 __user
*out
= (u64 __user
*)buf
;
762 unsigned long src
= *ppos
;
768 count
= min_t(unsigned long, count
, (max_pfn
* KPMSIZE
) - src
);
769 if (src
& KPMMASK
|| count
& KPMMASK
)
775 ppage
= pfn_to_page(pfn
);
780 kflags
= ppage
->flags
;
782 uflags
= kpf_copy_bit(KPF_LOCKED
, PG_locked
, kflags
) |
783 kpf_copy_bit(kflags
, KPF_ERROR
, PG_error
) |
784 kpf_copy_bit(kflags
, KPF_REFERENCED
, PG_referenced
) |
785 kpf_copy_bit(kflags
, KPF_UPTODATE
, PG_uptodate
) |
786 kpf_copy_bit(kflags
, KPF_DIRTY
, PG_dirty
) |
787 kpf_copy_bit(kflags
, KPF_LRU
, PG_lru
) |
788 kpf_copy_bit(kflags
, KPF_ACTIVE
, PG_active
) |
789 kpf_copy_bit(kflags
, KPF_SLAB
, PG_slab
) |
790 kpf_copy_bit(kflags
, KPF_WRITEBACK
, PG_writeback
) |
791 kpf_copy_bit(kflags
, KPF_RECLAIM
, PG_reclaim
) |
792 kpf_copy_bit(kflags
, KPF_BUDDY
, PG_buddy
);
794 if (put_user(uflags
, out
++)) {
802 *ppos
+= (char __user
*)out
- buf
;
804 ret
= (char __user
*)out
- buf
;
808 static struct file_operations proc_kpageflags_operations
= {
810 .read
= kpageflags_read
,
812 #endif /* CONFIG_PROC_PAGE_MONITOR */
814 struct proc_dir_entry
*proc_root_kcore
;
816 void create_seq_entry(char *name
, mode_t mode
, const struct file_operations
*f
)
818 struct proc_dir_entry
*entry
;
819 entry
= create_proc_entry(name
, mode
, NULL
);
821 entry
->proc_fops
= f
;
824 void __init
proc_misc_init(void)
828 int (*read_proc
)(char*,char**,off_t
,int,int*,void*);
829 } *p
, simple_ones
[] = {
830 {"loadavg", loadavg_read_proc
},
831 {"uptime", uptime_read_proc
},
832 {"meminfo", meminfo_read_proc
},
833 {"version", version_read_proc
},
834 #ifdef CONFIG_PROC_HARDWARE
835 {"hardware", hardware_read_proc
},
837 #ifdef CONFIG_STRAM_PROC
838 {"stram", stram_read_proc
},
840 {"filesystems", filesystems_read_proc
},
841 {"cmdline", cmdline_read_proc
},
842 {"execdomains", execdomains_read_proc
},
845 for (p
= simple_ones
; p
->name
; p
++)
846 create_proc_read_entry(p
->name
, 0, NULL
, p
->read_proc
, NULL
);
848 proc_symlink("mounts", NULL
, "self/mounts");
850 /* And now for trickier ones */
853 struct proc_dir_entry
*entry
;
854 entry
= create_proc_entry("kmsg", S_IRUSR
, &proc_root
);
856 entry
->proc_fops
= &proc_kmsg_operations
;
859 create_seq_entry("locks", 0, &proc_locks_operations
);
860 create_seq_entry("devices", 0, &proc_devinfo_operations
);
861 create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations
);
863 create_seq_entry("partitions", 0, &proc_partitions_operations
);
865 create_seq_entry("stat", 0, &proc_stat_operations
);
866 create_seq_entry("interrupts", 0, &proc_interrupts_operations
);
867 #ifdef CONFIG_SLABINFO
868 create_seq_entry("slabinfo",S_IWUSR
|S_IRUGO
,&proc_slabinfo_operations
);
869 #ifdef CONFIG_DEBUG_SLAB_LEAK
870 create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations
);
873 create_seq_entry("buddyinfo",S_IRUGO
, &fragmentation_file_operations
);
874 create_seq_entry("pagetypeinfo", S_IRUGO
, &pagetypeinfo_file_ops
);
875 create_seq_entry("vmstat",S_IRUGO
, &proc_vmstat_file_operations
);
876 create_seq_entry("zoneinfo",S_IRUGO
, &proc_zoneinfo_file_operations
);
878 create_seq_entry("diskstats", 0, &proc_diskstats_operations
);
880 #ifdef CONFIG_MODULES
881 create_seq_entry("modules", 0, &proc_modules_operations
);
883 #ifdef CONFIG_SCHEDSTATS
884 create_seq_entry("schedstat", 0, &proc_schedstat_operations
);
886 #ifdef CONFIG_PROC_KCORE
887 proc_root_kcore
= create_proc_entry("kcore", S_IRUSR
, NULL
);
888 if (proc_root_kcore
) {
889 proc_root_kcore
->proc_fops
= &proc_kcore_operations
;
890 proc_root_kcore
->size
=
891 (size_t)high_memory
- PAGE_OFFSET
+ PAGE_SIZE
;
894 #ifdef CONFIG_PROC_PAGE_MONITOR
895 create_seq_entry("kpagecount", S_IRUSR
, &proc_kpagecount_operations
);
896 create_seq_entry("kpageflags", S_IRUSR
, &proc_kpageflags_operations
);
898 #ifdef CONFIG_PROC_VMCORE
899 proc_vmcore
= create_proc_entry("vmcore", S_IRUSR
, NULL
);
901 proc_vmcore
->proc_fops
= &proc_vmcore_operations
;
903 #ifdef CONFIG_MAGIC_SYSRQ
905 struct proc_dir_entry
*entry
;
906 entry
= create_proc_entry("sysrq-trigger", S_IWUSR
, NULL
);
908 entry
->proc_fops
= &proc_sysrq_trigger_operations
;