X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fprobes%2Flttng-uprobes.c;h=5463251aae982847e441afbbf790565bf9c3501b;hb=HEAD;hp=b6531a71e16df3938e364023c9d767319f71f2c6;hpb=17806c46f59eba37b32bde6543bd5017d154b42d;p=lttng-modules.git diff --git a/src/probes/lttng-uprobes.c b/src/probes/lttng-uprobes.c index b6531a71..5463251a 100644 --- a/src/probes/lttng-uprobes.c +++ b/src/probes/lttng-uprobes.c @@ -10,17 +10,19 @@ */ #include +#include #include #include #include #include #include +#include + #include #include #include #include #include -#include #include static @@ -101,7 +103,7 @@ int lttng_uprobes_event_handler_pre(struct uprobe_consumer *uc, struct pt_regs * static const struct lttng_kernel_event_field *event_fields[] = { lttng_kernel_static_event_field("ip", lttng_kernel_static_type_integer_from_type(unsigned long, __BYTE_ORDER, 16), - false, false, false), + false, false), }; static const struct lttng_kernel_tracepoint_class tp_class = { @@ -152,7 +154,7 @@ static struct inode *get_inode_from_fd(int fd) * Returns the file backing the given fd. Needs to be done inside an RCU * critical section. */ - file = lttng_lookup_fd_rcu(fd); + file = lttng_lookup_fdget_rcu(fd); if (file == NULL) { printk(KERN_WARNING "LTTng: Cannot access file backing the fd(%d)\n", fd); inode = NULL; @@ -163,8 +165,11 @@ static struct inode *get_inode_from_fd(int fd) inode = igrab(file->f_path.dentry->d_inode); if (inode == NULL) printk(KERN_WARNING "LTTng: Cannot grab a reference on the inode.\n"); + error: rcu_read_unlock(); + if (file) + fput(file); return inode; } @@ -201,7 +206,7 @@ int lttng_uprobes_add_callsite(struct lttng_uprobe *uprobe, goto register_error; } - ret = wrapper_uprobe_register(uprobe->inode, + ret = uprobe_register(uprobe->inode, uprobe_handler->offset, &uprobe_handler->up_consumer); if (ret) { printk(KERN_WARNING "LTTng: Error registering probe on inode %lu " @@ -280,7 +285,7 @@ void lttng_uprobes_unregister(struct inode *inode, struct list_head *head) * and free the struct. */ list_for_each_entry_safe(iter, tmp, head, node) { - wrapper_uprobe_unregister(inode, iter->offset, &iter->up_consumer); + uprobe_unregister(inode, iter->offset, &iter->up_consumer); list_del(&iter->node); kfree(iter); } @@ -300,14 +305,6 @@ void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_common *event } EXPORT_SYMBOL_GPL(lttng_uprobes_destroy_event_private); -void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier) -{ - iput(event_notifier->priv->parent.u.uprobe.inode); - kfree(event_notifier->priv->parent.desc->event_name); - kfree(event_notifier->priv->parent.desc); -} -EXPORT_SYMBOL_GPL(lttng_uprobes_destroy_event_notifier_private); - MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Yannick Brosseau"); MODULE_DESCRIPTION("Linux Trace Toolkit Uprobes Support");