This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug kprobes/2152] jprobe variant to run handler instead of probed function


------- Additional Comments From srinivasa at in dot ibm dot com  2007-02-17 11:39 -------
Jprobe module should have jprobe_nop_retun in its function and "return" is
also required.

An example is here

 
int jversion_read_proc(char *page, char **start, off_t off,
                                 int count, int *eof, void *data)
{
        jprobe_nop_return();
        return 0;
}

static struct jprobe my_jprobe = {
        .entry = JPROBE_ENTRY(jversion_read_proc)
};

static int __init jprobe_init(void)
{
        int ret;
        my_jprobe.kp.symbol_name = "version_read_proc";

        if ((ret = register_jprobe(&my_jprobe)) <0) {
                printk("register_jprobe failed, returned %d\n", ret);
                return -1;
        }
        printk("Planted jprobe at %p, handler addr %p\n",
               my_jprobe.kp.addr, my_jprobe.entry);
        return 0;
}

static void __exit jprobe_exit(void)
{
        unregister_jprobe(&my_jprobe);
        printk("jprobe unregistered\n");
}

module_init(jprobe_init)
module_exit(jprobe_exit)
MODULE_LICENSE("GPL");



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2152

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]