[PATCH] mm: add /proc/zoneinfo
Add /proc/zoneinfo file to display information about memory zones. Useful to analyze VM behaviour. Signed-off-by: Nikita Danilov <nikita@clusterfs.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
05b7438475
commit
295ab93497
@@ -219,6 +219,19 @@ static struct file_operations fragmentation_file_operations = {
|
||||
.release = seq_release,
|
||||
};
|
||||
|
||||
extern struct seq_operations zoneinfo_op;
|
||||
static int zoneinfo_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return seq_open(file, &zoneinfo_op);
|
||||
}
|
||||
|
||||
static struct file_operations proc_zoneinfo_file_operations = {
|
||||
.open = zoneinfo_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release,
|
||||
};
|
||||
|
||||
static int version_read_proc(char *page, char **start, off_t off,
|
||||
int count, int *eof, void *data)
|
||||
{
|
||||
@@ -589,6 +602,7 @@ void __init proc_misc_init(void)
|
||||
create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations);
|
||||
create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations);
|
||||
create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations);
|
||||
create_seq_entry("zoneinfo",S_IRUGO, &proc_zoneinfo_file_operations);
|
||||
create_seq_entry("diskstats", 0, &proc_diskstats_operations);
|
||||
#ifdef CONFIG_MODULES
|
||||
create_seq_entry("modules", 0, &proc_modules_operations);
|
||||
|
Reference in New Issue
Block a user