This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug kprobes/2152] jprobe variant to run handler instead of probed function
- From: "srinivasa at in dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 17 Feb 2007 11:39:51 -0000
- Subject: [Bug kprobes/2152] jprobe variant to run handler instead of probed function
- References: <20060113232600.2152.jkenisto@us.ibm.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.