uprobe: Support multiple call sites for the same uprobe event
[lttng-modules.git] / lttng-events.c
index 636a1891be0c188a9619d5a31ee103a4f57e2c86..3964df5fbb2f55b8d98fdb8501023a2c37a2dbab 100644 (file)
@@ -743,10 +743,21 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan,
                }
                break;
        case LTTNG_KERNEL_UPROBE:
+               /*
+                * Needs to be explicitly enabled after creation, since
+                * we may want to apply filters.
+                */
+               event->enabled = 0;
+               event->registered = 1;
+
+               /*
+                * Populate lttng_event structure before event
+                * registration.
+                */
+               smp_wmb();
 
                ret = lttng_uprobes_register(event_param->name,
-                               event_param->u.uprobe.path,
-                               event_param->u.uprobe.offset,
+                               event_param->u.uprobe.fd,
                                event);
                if (ret)
                        goto register_error;
@@ -815,6 +826,7 @@ void register_event(struct lttng_event *event)
                        desc->name);
                break;
        case LTTNG_KERNEL_KPROBE:
+       case LTTNG_KERNEL_UPROBE:
        case LTTNG_KERNEL_KRETPROBE:
        case LTTNG_KERNEL_FUNCTION:
        case LTTNG_KERNEL_NOOP:
@@ -1454,6 +1466,18 @@ error_free:
        return ret;
 }
 
+int lttng_event_add_callsite(struct lttng_event *event,
+               struct lttng_kernel_event_callsite __user *callsite)
+{
+
+       switch (event->instrumentation) {
+       case LTTNG_KERNEL_UPROBE:
+               return lttng_uprobes_add_callsite(event, callsite);
+       default:
+               return -EINVAL;
+       }
+}
+
 int lttng_enabler_attach_context(struct lttng_enabler *enabler,
                struct lttng_kernel_context *context_param)
 {
This page took 0.024121 seconds and 4 git commands to generate.