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/sysrq.h>
49 #include <linux/vmalloc.h>
50 #include <linux/crash_dump.h>
51 #include <linux/pid_namespace.h>
52 #include <linux/bootmem.h>
53 #include <asm/uaccess.h>
54 #include <asm/pgtable.h>
57 #include <asm/div64.h>
60 #define LOAD_INT(x) ((x) >> FSHIFT)
61 #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
63 * Warning: stuff below (imported functions) assumes that its output will fit
64 * into one page. For some of those functions it may be wrong. Moreover, we
65 * have a way to deal with that gracefully. Right now I used straightforward
66 * wrappers, but this needs further analysis wrt potential overflows.
68 extern int get_hardware_list(char *);
69 extern int get_stram_list(char *);
70 extern int get_exec_domain_list(char *);
71 extern int get_dma_list(char *);
73 static int proc_calc_metrics(char *page
, char **start
, off_t off
,
74 int count
, int *eof
, int len
)
76 if (len
<= off
+count
) *eof
= 1;
79 if (len
>count
) len
= count
;
84 static int loadavg_read_proc(char *page
, char **start
, off_t off
,
85 int count
, int *eof
, void *data
)
92 seq
= read_seqbegin(&xtime_lock
);
93 a
= avenrun
[0] + (FIXED_1
/200);
94 b
= avenrun
[1] + (FIXED_1
/200);
95 c
= avenrun
[2] + (FIXED_1
/200);
96 } while (read_seqretry(&xtime_lock
, seq
));
98 len
= sprintf(page
,"%d.%02d %d.%02d %d.%02d %ld/%d %d\n",
99 LOAD_INT(a
), LOAD_FRAC(a
),
100 LOAD_INT(b
), LOAD_FRAC(b
),
101 LOAD_INT(c
), LOAD_FRAC(c
),
102 nr_running(), nr_threads
,
103 task_active_pid_ns(current
)->last_pid
);
104 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
107 static int uptime_read_proc(char *page
, char **start
, off_t off
,
108 int count
, int *eof
, void *data
)
110 struct timespec uptime
;
111 struct timespec idle
;
113 cputime_t idletime
= cputime_add(init_task
.utime
, init_task
.stime
);
115 do_posix_clock_monotonic_gettime(&uptime
);
116 monotonic_to_bootbased(&uptime
);
117 cputime_to_timespec(idletime
, &idle
);
118 len
= sprintf(page
,"%lu.%02lu %lu.%02lu\n",
119 (unsigned long) uptime
.tv_sec
,
120 (uptime
.tv_nsec
/ (NSEC_PER_SEC
/ 100)),
121 (unsigned long) idle
.tv_sec
,
122 (idle
.tv_nsec
/ (NSEC_PER_SEC
/ 100)));
124 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
127 int __attribute__((weak
)) arch_report_meminfo(char *page
)
132 static int meminfo_read_proc(char *page
, char **start
, off_t off
,
133 int count
, int *eof
, void *data
)
137 unsigned long committed
;
138 unsigned long allowed
;
139 struct vmalloc_info vmi
;
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
);
160 * Tagged format, for easy grepping and expansion.
163 "MemTotal: %8lu kB\n"
167 "SwapCached: %8lu kB\n"
169 "Inactive: %8lu kB\n"
170 #ifdef CONFIG_HIGHMEM
171 "HighTotal: %8lu kB\n"
172 "HighFree: %8lu kB\n"
173 "LowTotal: %8lu kB\n"
176 "SwapTotal: %8lu kB\n"
177 "SwapFree: %8lu kB\n"
179 "Writeback: %8lu kB\n"
180 "AnonPages: %8lu kB\n"
183 "SReclaimable: %8lu kB\n"
184 "SUnreclaim: %8lu kB\n"
185 "PageTables: %8lu kB\n"
186 "NFS_Unstable: %8lu kB\n"
188 "WritebackTmp: %8lu kB\n"
189 "CommitLimit: %8lu kB\n"
190 "Committed_AS: %8lu kB\n"
191 "VmallocTotal: %8lu kB\n"
192 "VmallocUsed: %8lu kB\n"
193 "VmallocChunk: %8lu kB\n"
194 "Quicklists: %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 K(global_page_state(NR_UNSTABLE_NFS
)),
220 K(global_page_state(NR_BOUNCE
)),
221 K(global_page_state(NR_WRITEBACK_TEMP
)),
224 (unsigned long)VMALLOC_TOTAL
>> 10,
226 vmi
.largest_chunk
>> 10,
227 K(quicklist_total_size())
230 len
+= hugetlb_report_meminfo(page
+ len
);
232 len
+= arch_report_meminfo(page
+ len
);
234 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
238 static int fragmentation_open(struct inode
*inode
, struct file
*file
)
241 return seq_open(file
, &fragmentation_op
);
244 static const struct file_operations fragmentation_file_operations
= {
245 .open
= fragmentation_open
,
248 .release
= seq_release
,
251 static int pagetypeinfo_open(struct inode
*inode
, struct file
*file
)
253 return seq_open(file
, &pagetypeinfo_op
);
256 static const struct file_operations pagetypeinfo_file_ops
= {
257 .open
= pagetypeinfo_open
,
260 .release
= seq_release
,
263 static int zoneinfo_open(struct inode
*inode
, struct file
*file
)
265 return seq_open(file
, &zoneinfo_op
);
268 static const struct file_operations proc_zoneinfo_file_operations
= {
269 .open
= zoneinfo_open
,
272 .release
= seq_release
,
275 static int version_read_proc(char *page
, char **start
, off_t off
,
276 int count
, int *eof
, void *data
)
280 len
= snprintf(page
, PAGE_SIZE
, linux_proc_banner
,
284 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
287 extern const struct seq_operations cpuinfo_op
;
288 static int cpuinfo_open(struct inode
*inode
, struct file
*file
)
290 return seq_open(file
, &cpuinfo_op
);
293 static const struct file_operations proc_cpuinfo_operations
= {
294 .open
= cpuinfo_open
,
297 .release
= seq_release
,
300 static int devinfo_show(struct seq_file
*f
, void *v
)
302 int i
= *(loff_t
*) v
;
304 if (i
< CHRDEV_MAJOR_HASH_SIZE
) {
306 seq_printf(f
, "Character devices:\n");
311 i
-= CHRDEV_MAJOR_HASH_SIZE
;
313 seq_printf(f
, "\nBlock devices:\n");
320 static void *devinfo_start(struct seq_file
*f
, loff_t
*pos
)
322 if (*pos
< (BLKDEV_MAJOR_HASH_SIZE
+ CHRDEV_MAJOR_HASH_SIZE
))
327 static void *devinfo_next(struct seq_file
*f
, void *v
, loff_t
*pos
)
330 if (*pos
>= (BLKDEV_MAJOR_HASH_SIZE
+ CHRDEV_MAJOR_HASH_SIZE
))
335 static void devinfo_stop(struct seq_file
*f
, void *v
)
340 static const struct seq_operations devinfo_ops
= {
341 .start
= devinfo_start
,
342 .next
= devinfo_next
,
343 .stop
= devinfo_stop
,
347 static int devinfo_open(struct inode
*inode
, struct file
*filp
)
349 return seq_open(filp
, &devinfo_ops
);
352 static const struct file_operations proc_devinfo_operations
= {
353 .open
= devinfo_open
,
356 .release
= seq_release
,
359 static int vmstat_open(struct inode
*inode
, struct file
*file
)
361 return seq_open(file
, &vmstat_op
);
363 static const struct file_operations proc_vmstat_file_operations
= {
367 .release
= seq_release
,
370 #ifdef CONFIG_PROC_HARDWARE
371 static int hardware_read_proc(char *page
, char **start
, off_t off
,
372 int count
, int *eof
, void *data
)
374 int len
= get_hardware_list(page
);
375 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
379 #ifdef CONFIG_STRAM_PROC
380 static int stram_read_proc(char *page
, char **start
, off_t off
,
381 int count
, int *eof
, void *data
)
383 int len
= get_stram_list(page
);
384 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
389 static int partitions_open(struct inode
*inode
, struct file
*file
)
391 return seq_open(file
, &partitions_op
);
393 static const struct file_operations proc_partitions_operations
= {
394 .open
= partitions_open
,
397 .release
= seq_release
,
400 static int diskstats_open(struct inode
*inode
, struct file
*file
)
402 return seq_open(file
, &diskstats_op
);
404 static const struct file_operations proc_diskstats_operations
= {
405 .open
= diskstats_open
,
408 .release
= seq_release
,
412 #ifdef CONFIG_MODULES
413 extern const struct seq_operations modules_op
;
414 static int modules_open(struct inode
*inode
, struct file
*file
)
416 return seq_open(file
, &modules_op
);
418 static const struct file_operations proc_modules_operations
= {
419 .open
= modules_open
,
422 .release
= seq_release
,
426 #ifdef CONFIG_SLABINFO
427 static int slabinfo_open(struct inode
*inode
, struct file
*file
)
429 return seq_open(file
, &slabinfo_op
);
431 static const struct file_operations proc_slabinfo_operations
= {
432 .open
= slabinfo_open
,
434 .write
= slabinfo_write
,
436 .release
= seq_release
,
439 #ifdef CONFIG_DEBUG_SLAB_LEAK
440 extern const struct seq_operations slabstats_op
;
441 static int slabstats_open(struct inode
*inode
, struct file
*file
)
443 unsigned long *n
= kzalloc(PAGE_SIZE
, GFP_KERNEL
);
446 ret
= seq_open(file
, &slabstats_op
);
448 struct seq_file
*m
= file
->private_data
;
449 *n
= PAGE_SIZE
/ (2 * sizeof(unsigned long));
458 static const struct file_operations proc_slabstats_operations
= {
459 .open
= slabstats_open
,
462 .release
= seq_release_private
,
468 static int vmalloc_open(struct inode
*inode
, struct file
*file
)
470 unsigned int *ptr
= NULL
;
474 ptr
= kmalloc(nr_node_ids
* sizeof(unsigned int), GFP_KERNEL
);
475 ret
= seq_open(file
, &vmalloc_op
);
477 struct seq_file
*m
= file
->private_data
;
484 static const struct file_operations proc_vmalloc_operations
= {
485 .open
= vmalloc_open
,
488 .release
= seq_release_private
,
492 #ifndef arch_irq_stat_cpu
493 #define arch_irq_stat_cpu(cpu) 0
495 #ifndef arch_irq_stat
496 #define arch_irq_stat() 0
499 static int show_stat(struct seq_file
*p
, void *v
)
503 cputime64_t user
, nice
, system
, idle
, iowait
, irq
, softirq
, steal
;
506 struct timespec boottime
;
507 unsigned int *per_irq_sum
;
509 per_irq_sum
= kzalloc(sizeof(unsigned int)*NR_IRQS
, GFP_KERNEL
);
513 user
= nice
= system
= idle
= iowait
=
514 irq
= softirq
= steal
= cputime64_zero
;
515 guest
= cputime64_zero
;
516 getboottime(&boottime
);
517 jif
= boottime
.tv_sec
;
519 for_each_possible_cpu(i
) {
522 user
= cputime64_add(user
, kstat_cpu(i
).cpustat
.user
);
523 nice
= cputime64_add(nice
, kstat_cpu(i
).cpustat
.nice
);
524 system
= cputime64_add(system
, kstat_cpu(i
).cpustat
.system
);
525 idle
= cputime64_add(idle
, kstat_cpu(i
).cpustat
.idle
);
526 iowait
= cputime64_add(iowait
, kstat_cpu(i
).cpustat
.iowait
);
527 irq
= cputime64_add(irq
, kstat_cpu(i
).cpustat
.irq
);
528 softirq
= cputime64_add(softirq
, kstat_cpu(i
).cpustat
.softirq
);
529 steal
= cputime64_add(steal
, kstat_cpu(i
).cpustat
.steal
);
530 guest
= cputime64_add(guest
, kstat_cpu(i
).cpustat
.guest
);
531 for (j
= 0; j
< NR_IRQS
; j
++) {
532 unsigned int temp
= kstat_cpu(i
).irqs
[j
];
534 per_irq_sum
[j
] += temp
;
536 sum
+= arch_irq_stat_cpu(i
);
538 sum
+= arch_irq_stat();
540 seq_printf(p
, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
541 (unsigned long long)cputime64_to_clock_t(user
),
542 (unsigned long long)cputime64_to_clock_t(nice
),
543 (unsigned long long)cputime64_to_clock_t(system
),
544 (unsigned long long)cputime64_to_clock_t(idle
),
545 (unsigned long long)cputime64_to_clock_t(iowait
),
546 (unsigned long long)cputime64_to_clock_t(irq
),
547 (unsigned long long)cputime64_to_clock_t(softirq
),
548 (unsigned long long)cputime64_to_clock_t(steal
),
549 (unsigned long long)cputime64_to_clock_t(guest
));
550 for_each_online_cpu(i
) {
552 /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
553 user
= kstat_cpu(i
).cpustat
.user
;
554 nice
= kstat_cpu(i
).cpustat
.nice
;
555 system
= kstat_cpu(i
).cpustat
.system
;
556 idle
= kstat_cpu(i
).cpustat
.idle
;
557 iowait
= kstat_cpu(i
).cpustat
.iowait
;
558 irq
= kstat_cpu(i
).cpustat
.irq
;
559 softirq
= kstat_cpu(i
).cpustat
.softirq
;
560 steal
= kstat_cpu(i
).cpustat
.steal
;
561 guest
= kstat_cpu(i
).cpustat
.guest
;
563 "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
565 (unsigned long long)cputime64_to_clock_t(user
),
566 (unsigned long long)cputime64_to_clock_t(nice
),
567 (unsigned long long)cputime64_to_clock_t(system
),
568 (unsigned long long)cputime64_to_clock_t(idle
),
569 (unsigned long long)cputime64_to_clock_t(iowait
),
570 (unsigned long long)cputime64_to_clock_t(irq
),
571 (unsigned long long)cputime64_to_clock_t(softirq
),
572 (unsigned long long)cputime64_to_clock_t(steal
),
573 (unsigned long long)cputime64_to_clock_t(guest
));
575 seq_printf(p
, "intr %llu", (unsigned long long)sum
);
577 for (i
= 0; i
< NR_IRQS
; i
++)
578 seq_printf(p
, " %u", per_irq_sum
[i
]);
584 "procs_running %lu\n"
585 "procs_blocked %lu\n",
586 nr_context_switches(),
596 static int stat_open(struct inode
*inode
, struct file
*file
)
598 unsigned size
= 4096 * (1 + num_possible_cpus() / 32);
603 /* don't ask for more than the kmalloc() max size, currently 128 KB */
604 if (size
> 128 * 1024)
606 buf
= kmalloc(size
, GFP_KERNEL
);
610 res
= single_open(file
, show_stat
, NULL
);
612 m
= file
->private_data
;
619 static const struct file_operations proc_stat_operations
= {
623 .release
= single_release
,
629 static void *int_seq_start(struct seq_file
*f
, loff_t
*pos
)
631 return (*pos
<= NR_IRQS
) ? pos
: NULL
;
634 static void *int_seq_next(struct seq_file
*f
, void *v
, loff_t
*pos
)
642 static void int_seq_stop(struct seq_file
*f
, void *v
)
648 static const struct seq_operations int_seq_ops
= {
649 .start
= int_seq_start
,
650 .next
= int_seq_next
,
651 .stop
= int_seq_stop
,
652 .show
= show_interrupts
655 static int interrupts_open(struct inode
*inode
, struct file
*filp
)
657 return seq_open(filp
, &int_seq_ops
);
660 static const struct file_operations proc_interrupts_operations
= {
661 .open
= interrupts_open
,
664 .release
= seq_release
,
667 static int filesystems_read_proc(char *page
, char **start
, off_t off
,
668 int count
, int *eof
, void *data
)
670 int len
= get_filesystem_list(page
);
671 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
674 static int cmdline_read_proc(char *page
, char **start
, off_t off
,
675 int count
, int *eof
, void *data
)
679 len
= sprintf(page
, "%s\n", saved_command_line
);
680 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
683 static int locks_open(struct inode
*inode
, struct file
*filp
)
685 return seq_open(filp
, &locks_seq_operations
);
688 static const struct file_operations proc_locks_operations
= {
692 .release
= seq_release
,
695 static int execdomains_read_proc(char *page
, char **start
, off_t off
,
696 int count
, int *eof
, void *data
)
698 int len
= get_exec_domain_list(page
);
699 return proc_calc_metrics(page
, start
, off
, count
, eof
, len
);
702 #ifdef CONFIG_MAGIC_SYSRQ
704 * writing 'C' to /proc/sysrq-trigger is like sysrq-C
706 static ssize_t
write_sysrq_trigger(struct file
*file
, const char __user
*buf
,
707 size_t count
, loff_t
*ppos
)
712 if (get_user(c
, buf
))
714 __handle_sysrq(c
, NULL
, 0);
719 static const struct file_operations proc_sysrq_trigger_operations
= {
720 .write
= write_sysrq_trigger
,
724 #ifdef CONFIG_PROC_PAGE_MONITOR
725 #define KPMSIZE sizeof(u64)
726 #define KPMMASK (KPMSIZE - 1)
727 /* /proc/kpagecount - an array exposing page counts
729 * Each entry is a u64 representing the corresponding
730 * physical page count.
732 static ssize_t
kpagecount_read(struct file
*file
, char __user
*buf
,
733 size_t count
, loff_t
*ppos
)
735 u64 __user
*out
= (u64 __user
*)buf
;
737 unsigned long src
= *ppos
;
743 count
= min_t(size_t, count
, (max_pfn
* KPMSIZE
) - src
);
744 if (src
& KPMMASK
|| count
& KPMMASK
)
750 ppage
= pfn_to_page(pfn
);
755 pcount
= page_mapcount(ppage
);
757 if (put_user(pcount
, out
++)) {
765 *ppos
+= (char __user
*)out
- buf
;
767 ret
= (char __user
*)out
- buf
;
771 static struct file_operations proc_kpagecount_operations
= {
773 .read
= kpagecount_read
,
776 /* /proc/kpageflags - an array exposing page flags
778 * Each entry is a u64 representing the corresponding
779 * physical page flags.
782 /* These macros are used to decouple internal flags from exported ones */
786 #define KPF_REFERENCED 2
787 #define KPF_UPTODATE 3
792 #define KPF_WRITEBACK 8
793 #define KPF_RECLAIM 9
796 #define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos)
798 static ssize_t
kpageflags_read(struct file
*file
, char __user
*buf
,
799 size_t count
, loff_t
*ppos
)
801 u64 __user
*out
= (u64 __user
*)buf
;
803 unsigned long src
= *ppos
;
809 count
= min_t(unsigned long, count
, (max_pfn
* KPMSIZE
) - src
);
810 if (src
& KPMMASK
|| count
& KPMMASK
)
816 ppage
= pfn_to_page(pfn
);
821 kflags
= ppage
->flags
;
823 uflags
= kpf_copy_bit(KPF_LOCKED
, PG_locked
, kflags
) |
824 kpf_copy_bit(kflags
, KPF_ERROR
, PG_error
) |
825 kpf_copy_bit(kflags
, KPF_REFERENCED
, PG_referenced
) |
826 kpf_copy_bit(kflags
, KPF_UPTODATE
, PG_uptodate
) |
827 kpf_copy_bit(kflags
, KPF_DIRTY
, PG_dirty
) |
828 kpf_copy_bit(kflags
, KPF_LRU
, PG_lru
) |
829 kpf_copy_bit(kflags
, KPF_ACTIVE
, PG_active
) |
830 kpf_copy_bit(kflags
, KPF_SLAB
, PG_slab
) |
831 kpf_copy_bit(kflags
, KPF_WRITEBACK
, PG_writeback
) |
832 kpf_copy_bit(kflags
, KPF_RECLAIM
, PG_reclaim
) |
833 kpf_copy_bit(kflags
, KPF_BUDDY
, PG_buddy
);
835 if (put_user(uflags
, out
++)) {
843 *ppos
+= (char __user
*)out
- buf
;
845 ret
= (char __user
*)out
- buf
;
849 static struct file_operations proc_kpageflags_operations
= {
851 .read
= kpageflags_read
,
853 #endif /* CONFIG_PROC_PAGE_MONITOR */
855 struct proc_dir_entry
*proc_root_kcore
;
857 void __init
proc_misc_init(void)
861 int (*read_proc
)(char*,char**,off_t
,int,int*,void*);
862 } *p
, simple_ones
[] = {
863 {"loadavg", loadavg_read_proc
},
864 {"uptime", uptime_read_proc
},
865 {"meminfo", meminfo_read_proc
},
866 {"version", version_read_proc
},
867 #ifdef CONFIG_PROC_HARDWARE
868 {"hardware", hardware_read_proc
},
870 #ifdef CONFIG_STRAM_PROC
871 {"stram", stram_read_proc
},
873 {"filesystems", filesystems_read_proc
},
874 {"cmdline", cmdline_read_proc
},
875 {"execdomains", execdomains_read_proc
},
878 for (p
= simple_ones
; p
->name
; p
++)
879 create_proc_read_entry(p
->name
, 0, NULL
, p
->read_proc
, NULL
);
881 proc_symlink("mounts", NULL
, "self/mounts");
883 /* And now for trickier ones */
885 proc_create("kmsg", S_IRUSR
, NULL
, &proc_kmsg_operations
);
887 proc_create("locks", 0, NULL
, &proc_locks_operations
);
888 proc_create("devices", 0, NULL
, &proc_devinfo_operations
);
889 proc_create("cpuinfo", 0, NULL
, &proc_cpuinfo_operations
);
891 proc_create("partitions", 0, NULL
, &proc_partitions_operations
);
893 proc_create("stat", 0, NULL
, &proc_stat_operations
);
894 proc_create("interrupts", 0, NULL
, &proc_interrupts_operations
);
895 #ifdef CONFIG_SLABINFO
896 proc_create("slabinfo",S_IWUSR
|S_IRUGO
,NULL
,&proc_slabinfo_operations
);
897 #ifdef CONFIG_DEBUG_SLAB_LEAK
898 proc_create("slab_allocators", 0, NULL
, &proc_slabstats_operations
);
902 proc_create("vmallocinfo", S_IRUSR
, NULL
, &proc_vmalloc_operations
);
904 proc_create("buddyinfo", S_IRUGO
, NULL
, &fragmentation_file_operations
);
905 proc_create("pagetypeinfo", S_IRUGO
, NULL
, &pagetypeinfo_file_ops
);
906 proc_create("vmstat", S_IRUGO
, NULL
, &proc_vmstat_file_operations
);
907 proc_create("zoneinfo", S_IRUGO
, NULL
, &proc_zoneinfo_file_operations
);
909 proc_create("diskstats", 0, NULL
, &proc_diskstats_operations
);
911 #ifdef CONFIG_MODULES
912 proc_create("modules", 0, NULL
, &proc_modules_operations
);
914 #ifdef CONFIG_SCHEDSTATS
915 proc_create("schedstat", 0, NULL
, &proc_schedstat_operations
);
917 #ifdef CONFIG_PROC_KCORE
918 proc_root_kcore
= proc_create("kcore", S_IRUSR
, NULL
, &proc_kcore_operations
);
920 proc_root_kcore
->size
=
921 (size_t)high_memory
- PAGE_OFFSET
+ PAGE_SIZE
;
923 #ifdef CONFIG_PROC_PAGE_MONITOR
924 proc_create("kpagecount", S_IRUSR
, NULL
, &proc_kpagecount_operations
);
925 proc_create("kpageflags", S_IRUSR
, NULL
, &proc_kpageflags_operations
);
927 #ifdef CONFIG_PROC_VMCORE
928 proc_vmcore
= proc_create("vmcore", S_IRUSR
, NULL
, &proc_vmcore_operations
);
930 #ifdef CONFIG_MAGIC_SYSRQ
931 proc_create("sysrq-trigger", S_IWUSR
, NULL
, &proc_sysrq_trigger_operations
);