Andrew Morton wrote: > On Wed, 07 Feb 2007 10:55:23 +0530 > Srinivasa Ds wrote: > >> --- linux-2.6.20.orig/fs/debugfs/inode.c >> +++ linux-2.6.20/fs/debugfs/inode.c >> @@ -25,6 +25,7 @@ >> >> if (retval) >> subsystem_unregister(&debug_subsys); >> + debugfs_kprobe_init(); >> return retval; >> } > > eww. Didn't it feel bad when you did that? > > > As this module has a dependency upon debugfs, I'd have thought the > approproate way of expressing that would be to run debugfs_kprobe_init() > at a lower initcall priority than debugfs_init() > >> + >> + if (dir == NULL) >> + return; >> + debugfs_create_file("list", 0444, dir , 0 , &proc_kprobes_operations); >> +} >> + >> __initcall(init_kprobes); > > debugfs_init() already runs at core_initcall level, presumably so that > debugfs clients can use plain old module_init(). > >> +static inline void debugfs_kprobe_init(void) >> +{ >> +} > > In which case we don't need this. Updating the patch according to Andrew's comment. This patch lists all active probes in the system by scanning through kprobe_table[]. It takes care of aggregate handlers and prints the type of the probe. Letter "k" for kprobes, "j" for jprobes, "r" for kretprobes. It also lists address of the instruction,its symbolic name(function name + offset) and the module name. One can access this file through /sys/kernel/debug/kprobes/list. Output looks like this ===================== llm40:~/a # cat /sys/kernel/debug/kprobes/list c0169ae3 r sys_read+0x0 c0169ae3 k sys_read+0x0 c01694c8 k vfs_write+0x0 c0167d20 r sys_open+0x0 f8e658a6 k reiserfs_delete_inode+0x0 reiserfs c0120f4a k do_fork+0x0 c0120f4a j do_fork+0x0 c0169b4a r sys_write+0x0 c0169b4a k sys_write+0x0 c0169622 r vfs_read+0x0 ================================= Signed-off-by: Srinivasa DS