- * lttng_event_cmd - lttng control through object descriptors
- *
- * @objd: the object descriptor
- * @cmd: the command
- * @arg: command arg
- * @uargs: UST arguments (internal)
- * @owner: objd owner
- *
- * This object descriptor implements lttng commands:
- * LTTNG_UST_CONTEXT
- * Prepend a context field to each record of this event
- * LTTNG_UST_ENABLE
- * Enable recording for this event (weak enable)
- * LTTNG_UST_DISABLE
- * Disable recording for this event (strong disable)
- * LTTNG_UST_FILTER
- * Attach a filter to an event.
- */
-static
-long lttng_event_cmd(int objd, unsigned int cmd, unsigned long arg,
- union ust_args *uargs, void *owner)
-{
- struct ltt_event *event = objd_private(objd);
-
- switch (cmd) {
- case LTTNG_UST_CONTEXT:
- return lttng_abi_add_context(objd,
- (struct lttng_ust_context *) arg,
- &event->ctx, event->chan->session);
- case LTTNG_UST_ENABLE:
- return ltt_event_enable(event);
- case LTTNG_UST_DISABLE:
- return ltt_event_disable(event);
- case LTTNG_UST_FILTER:
- {
- int ret;
- ret = lttng_filter_event_attach_bytecode(event,
- (struct lttng_ust_filter_bytecode_node *) arg);
- if (ret)
- return ret;
- lttng_filter_event_link_bytecode(event);
- return 0;
- }
- default:
- return -EINVAL;
- }
-}
-
-static
-int lttng_event_release(int objd)
-{
- struct ltt_event *event = objd_private(objd);
-
- if (event)
- return lttng_ust_objd_unref(event->chan->objd);
- return 0;
-}
-
-/* TODO: filter control ioctl */
-static const struct lttng_ust_objd_ops lttng_event_ops = {
- .release = lttng_event_release,
- .cmd = lttng_event_cmd,
-};
-
-/**
- * lttng_wildcard_cmd - lttng control through object descriptors