+/**
+ * lttng_wildcard_cmd - lttng control through object descriptors
+ *
+ * @objd: the object descriptor
+ * @cmd: the command
+ * @arg: command arg
+ * @uargs: UST arguments (internal)
+ *
+ * This object descriptor implements lttng commands:
+ * LTTNG_UST_CONTEXT
+ * Prepend a context field to each record of events of this
+ * wildcard.
+ * LTTNG_UST_ENABLE
+ * Enable recording for these wildcard events (weak enable)
+ * LTTNG_UST_DISABLE
+ * Disable recording for these wildcard events (strong disable)
+ */
+static
+long lttng_wildcard_cmd(int objd, unsigned int cmd, unsigned long arg,
+ union ust_args *uargs)
+{
+ struct session_wildcard *wildcard = objd_private(objd);
+
+ switch (cmd) {
+ case LTTNG_UST_CONTEXT:
+ return -ENOSYS; /* not implemented yet */
+#if 0
+ return lttng_abi_add_context(objd,
+ (struct lttng_ust_context *) arg,
+ &wildcard->ctx, wildcard->chan->session);
+#endif
+ case LTTNG_UST_ENABLE:
+ return ltt_wildcard_enable(wildcard);
+ case LTTNG_UST_DISABLE:
+ return ltt_wildcard_disable(wildcard);
+ default:
+ return -EINVAL;
+ }
+}
+
+static
+int lttng_wildcard_release(int objd)
+{
+ struct session_wildcard *wildcard = objd_private(objd);
+
+ if (wildcard)
+ return lttng_ust_objd_unref(wildcard->chan->objd);
+ return 0;
+}
+
+/* TODO: filter control ioctl */
+static const struct lttng_ust_objd_ops lttng_wildcard_ops = {
+ .release = lttng_wildcard_release,
+ .cmd = lttng_wildcard_cmd,
+};
+