From: David Goulet Date: Mon, 25 Nov 2013 20:06:13 +0000 (-0500) Subject: Fix: implicit conversion of enum types in sessiond X-Git-Tag: v2.3.2~33 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=72b6f5b6dc9fdd0ff4d49df8a9f010644311e863;p=lttng-tools.git Fix: implicit conversion of enum types in sessiond Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index e5b2b7e3c..f997cc79b 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1956,7 +1956,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; @@ -1968,7 +1975,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; diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 7a3423068..cb3a2747b 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -3178,12 +3178,13 @@ int ust_app_list_event_fields(struct lttng_event_field **fields) } memcpy(tmp_event[count].field_name, uiter.field_name, LTTNG_UST_SYM_NAME_LEN); - tmp_event[count].type = uiter.type; + /* Mapping between these enums matches 1 to 1. */ + tmp_event[count].type = (enum lttng_event_field_type) uiter.type; tmp_event[count].nowrite = uiter.nowrite; memcpy(tmp_event[count].event.name, uiter.event_name, LTTNG_UST_SYM_NAME_LEN); tmp_event[count].event.loglevel = uiter.loglevel; - tmp_event[count].event.type = LTTNG_UST_TRACEPOINT; + tmp_event[count].event.type = LTTNG_EVENT_TRACEPOINT; tmp_event[count].event.pid = app->pid; tmp_event[count].event.enabled = -1; count++;