+/*
+ * Stop tracing for all trace of the session.
+ */
+int lttng_stop_tracing(const char *session_name)
+{
+ copy_string(lsm.session.name, session_name, NAME_MAX);
+ return ask_sessiond(LTTNG_STOP_TRACE, NULL);
+}
+
+/*
+ * lttng_add_context
+ */
+int lttng_add_context(struct lttng_domain *domain,
+ struct lttng_event_context *ctx, const char *event_name,
+ const char *channel_name)
+{
+ copy_string(lsm.u.context.channel_name, channel_name, NAME_MAX);
+ copy_string(lsm.u.context.event_name, event_name, NAME_MAX);
+ copy_lttng_domain(domain);
+
+ if (ctx) {
+ memcpy(&lsm.u.context.ctx, ctx, sizeof(struct lttng_event_context));
+ }
+
+ return ask_sessiond(LTTNG_ADD_CONTEXT, NULL);
+}
+
+/*
+ * lttng_enable_event
+ */
+int lttng_enable_event(struct lttng_domain *domain,
+ struct lttng_event *ev, const char *channel_name)
+{
+ int ret = -1;
+
+ if (channel_name == NULL) {
+ copy_string(lsm.u.enable.channel_name, DEFAULT_CHANNEL_NAME, NAME_MAX);
+ } else {
+ copy_string(lsm.u.enable.channel_name, channel_name, NAME_MAX);
+ }
+
+ if (domain) {
+ switch (domain->type) {
+ case LTTNG_DOMAIN_KERNEL:
+ if (ev == NULL) {
+ ret = ask_sessiond(LTTNG_KERNEL_ENABLE_ALL_EVENT, NULL);
+ } else {
+ memcpy(&lsm.u.enable.event, ev, sizeof(struct lttng_event));
+ ret = ask_sessiond(LTTNG_KERNEL_ENABLE_EVENT, NULL);
+ }
+ break;
+ case LTTNG_DOMAIN_UST:
+ ret = LTTCOMM_NOT_IMPLEMENTED;
+ break;
+ default:
+ ret = LTTCOMM_UNKNOWN_DOMAIN;
+ break;
+ };