lkml.org 
[lkml]   [2007]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] [PATCH] To list all active probes in the system
    On Wed, 07 Feb 2007 10:55:23 +0530
    Srinivasa Ds <srinivasa@in.ibm.com> wrote:

    > --- linux-2.6.20.orig/fs/debugfs/inode.c
    > +++ linux-2.6.20/fs/debugfs/inode.c
    > @@ -25,6 +25,7 @@
    > #include <linux/namei.h>
    > #include <linux/debugfs.h>
    > #include <linux/fsnotify.h>
    > +#include <linux/kprobes.h>
    >
    > #define DEBUGFS_MAGIC 0x64626720
    >
    > @@ -320,6 +321,7 @@ static int __init debugfs_init(void)
    > retval = register_filesystem(&debug_fs_type);
    > 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()

    > +void __kprobes debugfs_kprobe_init(void)
    > +{
    > + struct dentry *dir;
    > +
    > + dir = debugfs_create_dir("kprobes", NULL);
    > + 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.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-02-07 23:31    [W:0.037 / U:0.436 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site