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/genhd.h>
36 #include <linux/smp.h>
37 #include <linux/signal.h>
38 #include <linux/module.h>
39 #include <linux/init.h>
40 #include <linux/seq_file.h>
41 #include <linux/times.h>
42 #include <linux/profile.h>
43 #include <linux/utsname.h>
44 #include <linux/blkdev.h>
45 #include <linux/hugetlb.h>
46 #include <linux/jiffies.h>
47 #include <linux/sysrq.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 *);
70 extern int get_dma_list(char *);
72 static int proc_calc_metrics(char *page, char **start, off_t off,
73 int count, int *eof, int len)
75 if (len <= off+count) *eof = 1;
78 if (len>count) len = count;
83 static int loadavg_read_proc(char *page, char **start, off_t off,
84 int count, int *eof, void *data)
91 seq = read_seqbegin(&xtime_lock);
92 a = avenrun[0] + (FIXED_1/200);
93 b = avenrun[1] + (FIXED_1/200);
94 c = avenrun[2] + (FIXED_1/200);
95 } while (read_seqretry(&xtime_lock, seq));
97 len = sprintf(page,"%d.%02d %d.%02d %d.%02d %ld/%d %d\n",
98 LOAD_INT(a), LOAD_FRAC(a),
99 LOAD_INT(b), LOAD_FRAC(b),
100 LOAD_INT(c), LOAD_FRAC(c),
101 nr_running(), nr_threads,
102 task_active_pid_ns(current)->last_pid);
103 return proc_calc_metrics(page, start, off, count, eof, len);
106 static int uptime_read_proc(char *page, char **start, off_t off,
107 int count, int *eof, void *data)
109 struct timespec uptime;
110 struct timespec idle;
112 cputime_t idletime = cputime_add(init_task.utime, init_task.stime);
114 do_posix_clock_monotonic_gettime(&uptime);
115 monotonic_to_bootbased(&uptime);
116 cputime_to_timespec(idletime, &idle);
117 len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
118 (unsigned long) uptime.tv_sec,
119 (uptime.tv_nsec / (NSEC_PER_SEC / 100)),
120 (unsigned long) idle.tv_sec,
121 (idle.tv_nsec / (NSEC_PER_SEC / 100)));
123 return proc_calc_metrics(page, start, off, count, eof, len);
126 static int meminfo_read_proc(char *page, char **start, off_t off,
127 int count, int *eof, void *data)
131 unsigned long committed;
132 unsigned long allowed;
133 struct vmalloc_info vmi;
137 * display in kilobytes.
139 #define K(x) ((x) << (PAGE_SHIFT - 10))
142 committed = atomic_read(&vm_committed_space);
143 allowed = ((totalram_pages - hugetlb_total_pages())
144 * sysctl_overcommit_ratio / 100) + total_swap_pages;
146 cached = global_page_state(NR_FILE_PAGES) -
147 total_swapcache_pages - i.bufferram;
151 get_vmalloc_info(&vmi);
154 * Tagged format, for easy grepping and expansion.
157 "MemTotal: %8lu kB\n"
161 "SwapCached: %8lu kB\n"
163 "Inactive: %8lu kB\n"
164 #ifdef CONFIG_HIGHMEM
165 "HighTotal: %8lu kB\n"
166 "HighFree: %8lu kB\n"
167 "LowTotal: %8lu kB\n"
170 "SwapTotal: %8lu kB\n"
171 "SwapFree: %8lu kB\n"
173 "Writeback: %8lu kB\n"
174 "AnonPages: %8lu kB\n"
177 "SReclaimable: %8lu kB\n"
178 "SUnreclaim: %8lu kB\n"
179 "PageTables: %8lu kB\n"
180 "NFS_Unstable: %8lu kB\n"
182 "CommitLimit: %8lu kB\n"
183 "Committed_AS: %8lu kB\n"
184 "VmallocTotal: %8lu kB\n"
185 "VmallocUsed: %8lu kB\n"
186 "VmallocChunk: %8lu kB\n",
191 K(total_swapcache_pages),
192 K(global_page_state(NR_ACTIVE)),
193 K(global_page_state(NR_INACTIVE)),
194 #ifdef CONFIG_HIGHMEM
197 K(i.totalram-i.totalhigh),
198 K(i.freeram-i.freehigh),
202 K(global_page_state(NR_FILE_DIRTY)),
203 K(global_page_state(NR_WRITEBACK)),
204 K(global_page_state(NR_ANON_PAGES)),
205 K(global_page_state(NR_FILE_MAPPED)),
206 K(global_page_state(NR_SLAB_RECLAIMABLE) +
207 global_page_state(NR_SLAB_UNRECLAIMABLE)),
208 K(global_page_state(NR_SLAB_RECLAIMABLE)),
209 K(global_page_state(NR_SLAB_UNRECLAIMABLE)),
210 K(global_page_state(NR_PAGETABLE)),
211 K(global_page_state(NR_UNSTABLE_NFS)),
212 K(global_page_state(NR_BOUNCE)),
215 (unsigned long)VMALLOC_TOTAL >> 10,
217 vmi.largest_chunk >> 10
220 len += hugetlb_report_meminfo(page + len);
222 return proc_calc_metrics(page, start, off, count, eof, len);
226 extern const struct seq_operations fragmentation_op;
227 static int fragmentation_open(struct inode *inode, struct file *file)
230 return seq_open(file, &fragmentation_op);
233 static const struct file_operations fragmentation_file_operations = {
234 .open = fragmentation_open,
237 .release = seq_release,
240 extern const struct seq_operations pagetypeinfo_op;
241 static int pagetypeinfo_open(struct inode *inode, struct file *file)
243 return seq_open(file, &pagetypeinfo_op);
246 static const struct file_operations pagetypeinfo_file_ops = {
247 .open = pagetypeinfo_open,
250 .release = seq_release,
253 extern const struct seq_operations zoneinfo_op;
254 static int zoneinfo_open(struct inode *inode, struct file *file)
256 return seq_open(file, &zoneinfo_op);
259 static const struct file_operations proc_zoneinfo_file_operations = {
260 .open = zoneinfo_open,
263 .release = seq_release,
266 static int version_read_proc(char *page, char **start, off_t off,
267 int count, int *eof, void *data)
271 len = snprintf(page, PAGE_SIZE, linux_proc_banner,
275 return proc_calc_metrics(page, start, off, count, eof, len);
278 extern const struct seq_operations cpuinfo_op;
279 static int cpuinfo_open(struct inode *inode, struct file *file)
281 return seq_open(file, &cpuinfo_op);
284 static const struct file_operations proc_cpuinfo_operations = {
285 .open = cpuinfo_open,
288 .release = seq_release,
291 static int devinfo_show(struct seq_file *f, void *v)
293 int i = *(loff_t *) v;
295 if (i < CHRDEV_MAJOR_HASH_SIZE) {
297 seq_printf(f, "Character devices:\n");
302 i -= CHRDEV_MAJOR_HASH_SIZE;
304 seq_printf(f, "\nBlock devices:\n");
311 static void *devinfo_start(struct seq_file *f, loff_t *pos)
313 if (*pos < (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE))
318 static void *devinfo_next(struct seq_file *f, void *v, loff_t *pos)
321 if (*pos >= (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE))
326 static void devinfo_stop(struct seq_file *f, void *v)
331 static const struct seq_operations devinfo_ops = {
332 .start = devinfo_start,
333 .next = devinfo_next,
334 .stop = devinfo_stop,
338 static int devinfo_open(struct inode *inode, struct file *filp)
340 return seq_open(filp, &devinfo_ops);
343 static const struct file_operations proc_devinfo_operations = {
344 .open = devinfo_open,
347 .release = seq_release,
350 extern const struct seq_operations vmstat_op;
351 static int vmstat_open(struct inode *inode, struct file *file)
353 return seq_open(file, &vmstat_op);
355 static const struct file_operations proc_vmstat_file_operations = {
359 .release = seq_release,
362 #ifdef CONFIG_PROC_HARDWARE
363 static int hardware_read_proc(char *page, char **start, off_t off,
364 int count, int *eof, void *data)
366 int len = get_hardware_list(page);
367 return proc_calc_metrics(page, start, off, count, eof, len);
371 #ifdef CONFIG_STRAM_PROC
372 static int stram_read_proc(char *page, char **start, off_t off,
373 int count, int *eof, void *data)
375 int len = get_stram_list(page);
376 return proc_calc_metrics(page, start, off, count, eof, len);
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 static int diskstats_open(struct inode *inode, struct file *file)
394 return seq_open(file, &diskstats_op);
396 static const struct file_operations proc_diskstats_operations = {
397 .open = diskstats_open,
400 .release = seq_release,
404 #ifdef CONFIG_MODULES
405 extern const struct seq_operations modules_op;
406 static int modules_open(struct inode *inode, struct file *file)
408 return seq_open(file, &modules_op);
410 static const struct file_operations proc_modules_operations = {
411 .open = modules_open,
414 .release = seq_release,
418 #ifdef CONFIG_SLABINFO
419 static int slabinfo_open(struct inode *inode, struct file *file)
421 return seq_open(file, &slabinfo_op);
423 static const struct file_operations proc_slabinfo_operations = {
424 .open = slabinfo_open,
426 .write = slabinfo_write,
428 .release = seq_release,
431 #ifdef CONFIG_DEBUG_SLAB_LEAK
432 extern const struct seq_operations slabstats_op;
433 static int slabstats_open(struct inode *inode, struct file *file)
435 unsigned long *n = kzalloc(PAGE_SIZE, GFP_KERNEL);
438 ret = seq_open(file, &slabstats_op);
440 struct seq_file *m = file->private_data;
441 *n = PAGE_SIZE / (2 * sizeof(unsigned long));
450 static const struct file_operations proc_slabstats_operations = {
451 .open = slabstats_open,
454 .release = seq_release_private,
460 static int vmalloc_open(struct inode *inode, struct file *file)
462 return seq_open(file, &vmalloc_op);
465 static const struct file_operations proc_vmalloc_operations = {
466 .open = vmalloc_open,
469 .release = seq_release,
473 static int show_stat(struct seq_file *p, void *v)
477 cputime64_t user, nice, system, idle, iowait, irq, softirq, steal;
480 struct timespec boottime;
481 unsigned int *per_irq_sum;
483 per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL);
487 user = nice = system = idle = iowait =
488 irq = softirq = steal = cputime64_zero;
489 guest = cputime64_zero;
490 getboottime(&boottime);
491 jif = boottime.tv_sec;
493 for_each_possible_cpu(i) {
496 user = cputime64_add(user, kstat_cpu(i).cpustat.user);
497 nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice);
498 system = cputime64_add(system, kstat_cpu(i).cpustat.system);
499 idle = cputime64_add(idle, kstat_cpu(i).cpustat.idle);
500 iowait = cputime64_add(iowait, kstat_cpu(i).cpustat.iowait);
501 irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq);
502 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
503 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
504 guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
505 for (j = 0; j < NR_IRQS; j++) {
506 unsigned int temp = kstat_cpu(i).irqs[j];
508 per_irq_sum[j] += temp;
512 seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
513 (unsigned long long)cputime64_to_clock_t(user),
514 (unsigned long long)cputime64_to_clock_t(nice),
515 (unsigned long long)cputime64_to_clock_t(system),
516 (unsigned long long)cputime64_to_clock_t(idle),
517 (unsigned long long)cputime64_to_clock_t(iowait),
518 (unsigned long long)cputime64_to_clock_t(irq),
519 (unsigned long long)cputime64_to_clock_t(softirq),
520 (unsigned long long)cputime64_to_clock_t(steal),
521 (unsigned long long)cputime64_to_clock_t(guest));
522 for_each_online_cpu(i) {
524 /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
525 user = kstat_cpu(i).cpustat.user;
526 nice = kstat_cpu(i).cpustat.nice;
527 system = kstat_cpu(i).cpustat.system;
528 idle = kstat_cpu(i).cpustat.idle;
529 iowait = kstat_cpu(i).cpustat.iowait;
530 irq = kstat_cpu(i).cpustat.irq;
531 softirq = kstat_cpu(i).cpustat.softirq;
532 steal = kstat_cpu(i).cpustat.steal;
533 guest = kstat_cpu(i).cpustat.guest;
535 "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
537 (unsigned long long)cputime64_to_clock_t(user),
538 (unsigned long long)cputime64_to_clock_t(nice),
539 (unsigned long long)cputime64_to_clock_t(system),
540 (unsigned long long)cputime64_to_clock_t(idle),
541 (unsigned long long)cputime64_to_clock_t(iowait),
542 (unsigned long long)cputime64_to_clock_t(irq),
543 (unsigned long long)cputime64_to_clock_t(softirq),
544 (unsigned long long)cputime64_to_clock_t(steal),
545 (unsigned long long)cputime64_to_clock_t(guest));
547 seq_printf(p, "intr %llu", (unsigned long long)sum);
549 for (i = 0; i < NR_IRQS; i++)
550 seq_printf(p, " %u", per_irq_sum[i]);
556 "procs_running %lu\n"
557 "procs_blocked %lu\n",
558 nr_context_switches(),
568 static int stat_open(struct inode *inode, struct file *file)
570 unsigned size = 4096 * (1 + num_possible_cpus() / 32);
575 /* don't ask for more than the kmalloc() max size, currently 128 KB */
576 if (size > 128 * 1024)
578 buf = kmalloc(size, GFP_KERNEL);
582 res = single_open(file, show_stat, NULL);
584 m = file->private_data;
591 static const struct file_operations proc_stat_operations = {
595 .release = single_release,
601 static void *int_seq_start(struct seq_file *f, loff_t *pos)
603 return (*pos <= NR_IRQS) ? pos : NULL;
606 static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
614 static void int_seq_stop(struct seq_file *f, void *v)
620 static const struct seq_operations int_seq_ops = {
621 .start = int_seq_start,
622 .next = int_seq_next,
623 .stop = int_seq_stop,
624 .show = show_interrupts
627 static int interrupts_open(struct inode *inode, struct file *filp)
629 return seq_open(filp, &int_seq_ops);
632 static const struct file_operations proc_interrupts_operations = {
633 .open = interrupts_open,
636 .release = seq_release,
639 static int filesystems_read_proc(char *page, char **start, off_t off,
640 int count, int *eof, void *data)
642 int len = get_filesystem_list(page);
643 return proc_calc_metrics(page, start, off, count, eof, len);
646 static int cmdline_read_proc(char *page, char **start, off_t off,
647 int count, int *eof, void *data)
651 len = sprintf(page, "%s\n", saved_command_line);
652 return proc_calc_metrics(page, start, off, count, eof, len);
655 static int locks_open(struct inode *inode, struct file *filp)
657 return seq_open(filp, &locks_seq_operations);
660 static const struct file_operations proc_locks_operations = {
664 .release = seq_release,
667 static int execdomains_read_proc(char *page, char **start, off_t off,
668 int count, int *eof, void *data)
670 int len = get_exec_domain_list(page);
671 return proc_calc_metrics(page, start, off, count, eof, len);
674 #ifdef CONFIG_MAGIC_SYSRQ
676 * writing 'C' to /proc/sysrq-trigger is like sysrq-C
678 static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
679 size_t count, loff_t *ppos)
684 if (get_user(c, buf))
686 __handle_sysrq(c, NULL, 0);
691 static const struct file_operations proc_sysrq_trigger_operations = {
692 .write = write_sysrq_trigger,
696 #ifdef CONFIG_PROC_PAGE_MONITOR
697 #define KPMSIZE sizeof(u64)
698 #define KPMMASK (KPMSIZE - 1)
699 /* /proc/kpagecount - an array exposing page counts
701 * Each entry is a u64 representing the corresponding
702 * physical page count.
704 static ssize_t kpagecount_read(struct file *file, char __user *buf,
705 size_t count, loff_t *ppos)
707 u64 __user *out = (u64 __user *)buf;
709 unsigned long src = *ppos;
715 count = min_t(size_t, count, (max_pfn * KPMSIZE) - src);
716 if (src & KPMMASK || count & KPMMASK)
722 ppage = pfn_to_page(pfn);
727 pcount = atomic_read(&ppage->_count);
729 if (put_user(pcount, out++)) {
737 *ppos += (char __user *)out - buf;
739 ret = (char __user *)out - buf;
743 static struct file_operations proc_kpagecount_operations = {
745 .read = kpagecount_read,
748 /* /proc/kpageflags - an array exposing page flags
750 * Each entry is a u64 representing the corresponding
751 * physical page flags.
754 /* These macros are used to decouple internal flags from exported ones */
758 #define KPF_REFERENCED 2
759 #define KPF_UPTODATE 3
764 #define KPF_WRITEBACK 8
765 #define KPF_RECLAIM 9
768 #define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos)
770 static ssize_t kpageflags_read(struct file *file, char __user *buf,
771 size_t count, loff_t *ppos)
773 u64 __user *out = (u64 __user *)buf;
775 unsigned long src = *ppos;
781 count = min_t(unsigned long, count, (max_pfn * KPMSIZE) - src);
782 if (src & KPMMASK || count & KPMMASK)
788 ppage = pfn_to_page(pfn);
793 kflags = ppage->flags;
795 uflags = kpf_copy_bit(KPF_LOCKED, PG_locked, kflags) |
796 kpf_copy_bit(kflags, KPF_ERROR, PG_error) |
797 kpf_copy_bit(kflags, KPF_REFERENCED, PG_referenced) |
798 kpf_copy_bit(kflags, KPF_UPTODATE, PG_uptodate) |
799 kpf_copy_bit(kflags, KPF_DIRTY, PG_dirty) |
800 kpf_copy_bit(kflags, KPF_LRU, PG_lru) |
801 kpf_copy_bit(kflags, KPF_ACTIVE, PG_active) |
802 kpf_copy_bit(kflags, KPF_SLAB, PG_slab) |
803 kpf_copy_bit(kflags, KPF_WRITEBACK, PG_writeback) |
804 kpf_copy_bit(kflags, KPF_RECLAIM, PG_reclaim) |
805 kpf_copy_bit(kflags, KPF_BUDDY, PG_buddy);
807 if (put_user(uflags, out++)) {
815 *ppos += (char __user *)out - buf;
817 ret = (char __user *)out - buf;
821 static struct file_operations proc_kpageflags_operations = {
823 .read = kpageflags_read,
825 #endif /* CONFIG_PROC_PAGE_MONITOR */
827 struct proc_dir_entry *proc_root_kcore;
829 void create_seq_entry(char *name, mode_t mode, const struct file_operations *f)
831 struct proc_dir_entry *entry;
832 entry = create_proc_entry(name, mode, NULL);
834 entry->proc_fops = f;
837 void __init proc_misc_init(void)
841 int (*read_proc)(char*,char**,off_t,int,int*,void*);
842 } *p, simple_ones[] = {
843 {"loadavg", loadavg_read_proc},
844 {"uptime", uptime_read_proc},
845 {"meminfo", meminfo_read_proc},
846 {"version", version_read_proc},
847 #ifdef CONFIG_PROC_HARDWARE
848 {"hardware", hardware_read_proc},
850 #ifdef CONFIG_STRAM_PROC
851 {"stram", stram_read_proc},
853 {"filesystems", filesystems_read_proc},
854 {"cmdline", cmdline_read_proc},
855 {"execdomains", execdomains_read_proc},
858 for (p = simple_ones; p->name; p++)
859 create_proc_read_entry(p->name, 0, NULL, p->read_proc, NULL);
861 proc_symlink("mounts", NULL, "self/mounts");
863 /* And now for trickier ones */
866 struct proc_dir_entry *entry;
867 entry = create_proc_entry("kmsg", S_IRUSR, &proc_root);
869 entry->proc_fops = &proc_kmsg_operations;
872 create_seq_entry("locks", 0, &proc_locks_operations);
873 create_seq_entry("devices", 0, &proc_devinfo_operations);
874 create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations);
876 create_seq_entry("partitions", 0, &proc_partitions_operations);
878 create_seq_entry("stat", 0, &proc_stat_operations);
879 create_seq_entry("interrupts", 0, &proc_interrupts_operations);
880 #ifdef CONFIG_SLABINFO
881 create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations);
882 #ifdef CONFIG_DEBUG_SLAB_LEAK
883 create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations);
887 proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations);
889 create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations);
890 create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops);
891 create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations);
892 create_seq_entry("zoneinfo",S_IRUGO, &proc_zoneinfo_file_operations);
894 create_seq_entry("diskstats", 0, &proc_diskstats_operations);
896 #ifdef CONFIG_MODULES
897 create_seq_entry("modules", 0, &proc_modules_operations);
899 #ifdef CONFIG_SCHEDSTATS
900 create_seq_entry("schedstat", 0, &proc_schedstat_operations);
902 #ifdef CONFIG_PROC_KCORE
903 proc_root_kcore = create_proc_entry("kcore", S_IRUSR, NULL);
904 if (proc_root_kcore) {
905 proc_root_kcore->proc_fops = &proc_kcore_operations;
906 proc_root_kcore->size =
907 (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE;
910 #ifdef CONFIG_PROC_PAGE_MONITOR
911 create_seq_entry("kpagecount", S_IRUSR, &proc_kpagecount_operations);
912 create_seq_entry("kpageflags", S_IRUSR, &proc_kpageflags_operations);
914 #ifdef CONFIG_PROC_VMCORE
915 proc_vmcore = create_proc_entry("vmcore", S_IRUSR, NULL);
917 proc_vmcore->proc_fops = &proc_vmcore_operations;
919 #ifdef CONFIG_MAGIC_SYSRQ
921 struct proc_dir_entry *entry;
922 entry = create_proc_entry("sysrq-trigger", S_IWUSR, NULL);
924 entry->proc_fops = &proc_sysrq_trigger_operations;