Fix: implicit conversion of enum types in sessiond
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 8dd3fcc60c914c9df4979ac46150aea1c518c147..4343fb114191352dbdaf13ee7a928fc283119c08 100644 (file)
@@ -305,6 +305,9 @@ static int list_lttng_ust_global_events(char *channel_name,
                if (uevent->filter) {
                        tmp[i].filter = 1;
                }
+               if (uevent->exclusion) {
+                       tmp[i].exclusion = 1;
+               }
                i++;
        }
 
@@ -1306,7 +1309,9 @@ error:
  */
 int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain,
                char *channel_name, struct lttng_event *event,
-               struct lttng_filter_bytecode *filter, int wpipe)
+               struct lttng_filter_bytecode *filter,
+               struct lttng_event_exclusion *exclusion,
+               int wpipe)
 {
        int ret, channel_created = 0;
        struct lttng_channel *attr;
@@ -1419,7 +1424,7 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain,
                }
 
                /* At this point, the session and channel exist on the tracer */
-               ret = event_ust_enable_tracepoint(usess, uchan, event, filter);
+               ret = event_ust_enable_tracepoint(usess, uchan, event, filter, exclusion);
                if (ret != LTTNG_OK) {
                        goto error;
                }
@@ -1448,7 +1453,7 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain,
                tmp_dom.type = LTTNG_DOMAIN_UST;
 
                ret = cmd_enable_event(session, &tmp_dom, DEFAULT_JUL_CHANNEL_NAME,
-                               &uevent, NULL, wpipe);
+                               &uevent, NULL, NULL, wpipe);
                if (ret != LTTNG_OK && ret != LTTNG_ERR_UST_EVENT_ENABLED) {
                        goto error;
                }
@@ -1660,7 +1665,7 @@ int cmd_enable_event_all(struct ltt_session *session,
                tmp_dom.type = LTTNG_DOMAIN_UST;
 
                ret = cmd_enable_event(session, &tmp_dom, DEFAULT_JUL_CHANNEL_NAME,
-                               &uevent, NULL, wpipe);
+                               &uevent, NULL, NULL, wpipe);
                if (ret != LTTNG_OK && ret != LTTNG_ERR_UST_EVENT_ENABLED) {
                        goto error;
                }
@@ -2142,7 +2147,14 @@ int cmd_calibrate(int domain, struct lttng_calibrate *calibrate)
        {
                struct lttng_kernel_calibrate kcalibrate;
 
-               kcalibrate.type = calibrate->type;
+               switch (calibrate->type) {
+               case LTTNG_CALIBRATE_FUNCTION:
+               default:
+                       /* Default and only possible calibrate option. */
+                       kcalibrate.type = LTTNG_KERNEL_CALIBRATE_KRETPROBE;
+                       break;
+               }
+
                ret = kernel_calibrate(kernel_tracer_fd, &kcalibrate);
                if (ret < 0) {
                        ret = LTTNG_ERR_KERN_ENABLE_FAIL;
@@ -2154,7 +2166,14 @@ int cmd_calibrate(int domain, struct lttng_calibrate *calibrate)
        {
                struct lttng_ust_calibrate ucalibrate;
 
-               ucalibrate.type = calibrate->type;
+               switch (calibrate->type) {
+               case LTTNG_CALIBRATE_FUNCTION:
+               default:
+                       /* Default and only possible calibrate option. */
+                       ucalibrate.type = LTTNG_UST_CALIBRATE_TRACEPOINT;
+                       break;
+               }
+
                ret = ust_app_calibrate_glb(&ucalibrate);
                if (ret < 0) {
                        ret = LTTNG_ERR_UST_CALIBRATE_FAIL;
@@ -2738,7 +2757,7 @@ error:
 /*
  * Record a kernel snapshot.
  *
- * Return 0 on success or a LTTNG_ERR code.
+ * Return LTTNG_OK on success or a LTTNG_ERR code.
  */
 static int record_kernel_snapshot(struct ltt_kernel_session *ksess,
                struct snapshot_output *output, struct ltt_session *session,
This page took 0.025644 seconds and 5 git commands to generate.