X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flttng-abi.c;h=68ea7ac35805b336ecc006079662dc4f3d981d04;hb=8ced8896fe832af52b749d429b8eceb872a83d1b;hp=775f141714724224c4178e2288acda5da2c66101;hpb=b01155bac7199bfef02b9bc06e85421c28859626;p=lttng-modules.git diff --git a/src/lttng-abi.c b/src/lttng-abi.c index 775f1417..68ea7ac3 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -1711,6 +1711,7 @@ fd_error: static long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { + struct lttng_event_notifier *event_notifier; struct lttng_event_notifier_enabler *event_notifier_enabler; enum lttng_event_type *evtype = file->private_data; @@ -1718,7 +1719,8 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo case LTTNG_KERNEL_ENABLE: switch (*evtype) { case LTTNG_TYPE_EVENT: - return -EINVAL; + event_notifier = file->private_data; + return lttng_event_notifier_enable(event_notifier); case LTTNG_TYPE_ENABLER: event_notifier_enabler = file->private_data; return lttng_event_notifier_enabler_enable(event_notifier_enabler); @@ -1729,7 +1731,8 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo case LTTNG_KERNEL_DISABLE: switch (*evtype) { case LTTNG_TYPE_EVENT: - return -EINVAL; + event_notifier = file->private_data; + return lttng_event_notifier_disable(event_notifier); case LTTNG_TYPE_ENABLER: event_notifier_enabler = file->private_data; return lttng_event_notifier_enabler_disable(event_notifier_enabler); @@ -1749,6 +1752,18 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo WARN_ON_ONCE(1); return -ENOSYS; } + case LTTNG_KERNEL_ADD_CALLSITE: + switch (*evtype) { + case LTTNG_TYPE_EVENT: + event_notifier = file->private_data; + return lttng_event_notifier_add_callsite(event_notifier, + (struct lttng_kernel_event_callsite __user *) arg); + case LTTNG_TYPE_ENABLER: + return -EINVAL; + default: + WARN_ON_ONCE(1); + return -ENOSYS; + } default: return -ENOIOCTLCMD; } @@ -1804,13 +1819,17 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, switch (event_notifier_param->event.instrumentation) { case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_UPROBE: break; case LTTNG_KERNEL_KPROBE: - case LTTNG_KERNEL_UPROBE: + event_notifier_param->event.u.kprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; + break; + case LTTNG_KERNEL_SYSCALL: + break; case LTTNG_KERNEL_KRETPROBE: + /* Placing an event notifier on kretprobe is not supported. */ case LTTNG_KERNEL_FUNCTION: case LTTNG_KERNEL_NOOP: - case LTTNG_KERNEL_SYSCALL: default: ret = -EINVAL; goto inval_instr;