Support del-output with an output name
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 850bac508fb4972793c5991050d5c39f56a3f9fd..b2faa41b114177082d49e41570f43d47384f098f 100644 (file)
@@ -2279,14 +2279,11 @@ int cmd_snapshot_del_output(struct ltt_session *session,
                struct lttng_snapshot_output *output)
 {
        int ret;
-       struct snapshot_output *sout;
+       struct snapshot_output *sout = NULL;
 
        assert(session);
        assert(output);
 
-       DBG("Cmd snapshot del output id %" PRIu32 " for session %s", output->id,
-                       session->name);
-
        rcu_read_lock();
 
        /*
@@ -2298,7 +2295,15 @@ int cmd_snapshot_del_output(struct ltt_session *session,
                goto error;
        }
 
-       sout = snapshot_find_output_by_id(output->id, &session->snapshot);
+       if (output->id) {
+               DBG("Cmd snapshot del output id %" PRIu32 " for session %s", output->id,
+                               session->name);
+               sout = snapshot_find_output_by_id(output->id, &session->snapshot);
+       } else if (*output->name != '\0') {
+               DBG("Cmd snapshot del output name %s for session %s", output->name,
+                               session->name);
+               sout = snapshot_find_output_by_name(output->name, &session->snapshot);
+       }
        if (!sout) {
                ret = LTTNG_ERR_INVALID;
                goto error;
This page took 0.023739 seconds and 4 git commands to generate.