diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-25 06:06:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 11:22:49 -0500 |
commit | 871751e25d956ad24f129ca972b7851feaa61d53 (patch) | |
tree | c3213a17481f601339ce0c81a22eebca0946c2c7 /fs | |
parent | f52ac8fec8a13e207f675b0c16e0d5f800c1c204 (diff) |
[PATCH] slab: implement /proc/slab_allocators
Implement /proc/slab_allocators. It produces output like:
idr_layer_cache: 80 idr_pre_get+0x33/0x4e
buffer_head: 2555 alloc_buffer_head+0x20/0x75
mm_struct: 9 mm_alloc+0x1e/0x42
mm_struct: 20 dup_mm+0x36/0x370
vm_area_struct: 384 dup_mm+0x18f/0x370
vm_area_struct: 151 do_mmap_pgoff+0x2e0/0x7c3
vm_area_struct: 1 split_vma+0x5a/0x10e
vm_area_struct: 11 do_brk+0x206/0x2e2
vm_area_struct: 2 copy_vma+0xda/0x142
vm_area_struct: 9 setup_arg_pages+0x99/0x214
fs_cache: 8 copy_fs_struct+0x21/0x133
fs_cache: 29 copy_process+0xf38/0x10e3
files_cache: 30 alloc_files+0x1b/0xcf
signal_cache: 81 copy_process+0xbaa/0x10e3
sighand_cache: 77 copy_process+0xe65/0x10e3
sighand_cache: 1 de_thread+0x4d/0x5f8
anon_vma: 241 anon_vma_prepare+0xd9/0xf3
size-2048: 1 add_sect_attrs+0x5f/0x145
size-2048: 2 journal_init_revoke+0x99/0x302
size-2048: 2 journal_init_revoke+0x137/0x302
size-2048: 2 journal_init_inode+0xf9/0x1c4
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Alexander Nyberg <alexn@telia.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Cc: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
DESC
slab-leaks3-locking-fix
EDESC
From: Andrew Morton <akpm@osdl.org>
Update for slab-remove-cachep-spinlock.patch
Cc: Al Viro <viro@ftp.linux.org.uk>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Alexander Nyberg <alexn@telia.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Cc: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/proc_misc.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 826c131994c3..1e9ea37d457e 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -485,6 +485,40 @@ static struct file_operations proc_slabinfo_operations = { | |||
485 | .llseek = seq_lseek, | 485 | .llseek = seq_lseek, |
486 | .release = seq_release, | 486 | .release = seq_release, |
487 | }; | 487 | }; |
488 | |||
489 | #ifdef CONFIG_DEBUG_SLAB_LEAK | ||
490 | extern struct seq_operations slabstats_op; | ||
491 | static int slabstats_open(struct inode *inode, struct file *file) | ||
492 | { | ||
493 | unsigned long *n = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
494 | int ret = -ENOMEM; | ||
495 | if (n) { | ||
496 | ret = seq_open(file, &slabstats_op); | ||
497 | if (!ret) { | ||
498 | struct seq_file *m = file->private_data; | ||
499 | *n = PAGE_SIZE / (2 * sizeof(unsigned long)); | ||
500 | m->private = n; | ||
501 | n = NULL; | ||
502 | } | ||
503 | kfree(n); | ||
504 | } | ||
505 | return ret; | ||
506 | } | ||
507 | |||
508 | static int slabstats_release(struct inode *inode, struct file *file) | ||
509 | { | ||
510 | struct seq_file *m = file->private_data; | ||
511 | kfree(m->private); | ||
512 | return seq_release(inode, file); | ||
513 | } | ||
514 | |||
515 | static struct file_operations proc_slabstats_operations = { | ||
516 | .open = slabstats_open, | ||
517 | .read = seq_read, | ||
518 | .llseek = seq_lseek, | ||
519 | .release = slabstats_release, | ||
520 | }; | ||
521 | #endif | ||
488 | #endif | 522 | #endif |
489 | 523 | ||
490 | static int show_stat(struct seq_file *p, void *v) | 524 | static int show_stat(struct seq_file *p, void *v) |
@@ -744,6 +778,9 @@ void __init proc_misc_init(void) | |||
744 | create_seq_entry("interrupts", 0, &proc_interrupts_operations); | 778 | create_seq_entry("interrupts", 0, &proc_interrupts_operations); |
745 | #ifdef CONFIG_SLAB | 779 | #ifdef CONFIG_SLAB |
746 | create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); | 780 | create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); |
781 | #ifdef CONFIG_DEBUG_SLAB_LEAK | ||
782 | create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations); | ||
783 | #endif | ||
747 | #endif | 784 | #endif |
748 | create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); | 785 | create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); |
749 | create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); | 786 | create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); |