+/**
+ * lttng_loglevel_cmd - lttng control through object descriptors
+ *
+ * @objd: the object descriptor
+ * @cmd: the command
+ * @arg: command arg
+ *
+ * This object descriptor implements lttng commands:
+ * LTTNG_UST_CONTEXT
+ * Prepend a context field to each record of events of this
+ * loglevel.
+ * LTTNG_UST_ENABLE
+ * Enable recording for these loglevel events (weak enable)
+ * LTTNG_UST_DISABLE
+ * Disable recording for these loglevel events (strong disable)
+ */
+static
+long lttng_loglevel_cmd(int objd, unsigned int cmd, unsigned long arg)
+{
+ struct session_loglevel *loglevel = 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,
+ &loglevel->ctx, loglevel->chan->session);
+#endif
+ case LTTNG_UST_ENABLE:
+ return ltt_loglevel_enable(loglevel);
+ case LTTNG_UST_DISABLE:
+ return ltt_loglevel_disable(loglevel);
+ default:
+ return -EINVAL;
+ }
+}
+
+static
+int lttng_loglevel_release(int objd)
+{
+ struct session_loglevel *loglevel = objd_private(objd);
+
+ if (loglevel)
+ return lttng_ust_objd_unref(loglevel->chan->objd);
+ return 0;
+}
+
+/* TODO: filter control ioctl */
+static const struct lttng_ust_objd_ops lttng_loglevel_ops = {
+ .release = lttng_loglevel_release,
+ .cmd = lttng_loglevel_cmd,
+};
+
+/**
+ * lttng_wildcard_cmd - lttng control through object descriptors
+ *
+ * @objd: the object descriptor
+ * @cmd: the command
+ * @arg: command arg
+ *
+ * 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)
+{
+ 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,
+};
+