+ int ret = 0;
+ struct lttng_uprobe_handler *uprobe_handler;
+
+ if (!event) {
+ ret = -EINVAL;
+ goto end;
+ }
+
+ uprobe_handler = kzalloc(sizeof(struct lttng_uprobe_handler), GFP_KERNEL);
+ if (!uprobe_handler) {
+ printk(KERN_WARNING "Error allocating uprobe_uprobe_handlers");
+ ret = -ENOMEM;
+ goto end;
+ }
+
+ /* Ensure the memory we just allocated don't trigger page faults. */
+ wrapper_vmalloc_sync_all();
+
+ uprobe_handler->event = event;
+ uprobe_handler->up_consumer.handler = lttng_uprobes_handler_pre;
+
+ ret = copy_from_user(&uprobe_handler->offset, &callsite->u.uprobe.offset, sizeof(uint64_t));
+ if (ret) {
+ goto register_error;
+ }
+
+ ret = wrapper_uprobe_register(event->u.uprobe.inode,
+ uprobe_handler->offset, &uprobe_handler->up_consumer);
+ if (ret) {
+ printk(KERN_WARNING "Error registering probe on inode %lu "
+ "and offset 0x%llx\n", event->u.uprobe.inode->i_ino,
+ uprobe_handler->offset);
+ ret = -1;
+ goto register_error;
+ }
+
+ list_add(&uprobe_handler->node, &event->u.uprobe.head);
+
+ return ret;
+
+register_error:
+ kfree(uprobe_handler);
+end:
+ return ret;
+}
+EXPORT_SYMBOL_GPL(lttng_uprobes_add_callsite);
+
+int lttng_uprobes_register(const char *name, int fd, struct lttng_event *event)
+{
+ int ret = 0;