X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=dc465173e3521984f48b91f23e1782b83ba22b09;hb=0210bba27680d0bc4278b926cad8b77eaa1b61ae;hp=d00bf1e3bdde5acb6ff81c650c571304f38a66ef;hpb=4634f12e972571bf8ab9cb3892e1d472aa7e0ddc;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index d00bf1e3b..dc465173e 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1439,6 +1439,7 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, assert(usess); /* Create the default JUL tracepoint. */ + memset(&uevent, 0, sizeof(uevent)); uevent.type = LTTNG_EVENT_TRACEPOINT; uevent.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL; strncpy(uevent.name, DEFAULT_JUL_EVENT_NAME, sizeof(uevent.name)); @@ -1460,7 +1461,7 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, /* The wild card * means that everything should be enabled. */ if (strncmp(event->name, "*", 1) == 0 && strlen(event->name) == 1) { - ret = event_jul_enable_all(usess); + ret = event_jul_enable_all(usess, event); } else { ret = event_jul_enable(usess, event); } @@ -1644,7 +1645,7 @@ int cmd_enable_event_all(struct ltt_session *session, } case LTTNG_DOMAIN_JUL: { - struct lttng_event uevent; + struct lttng_event uevent, event; struct lttng_domain tmp_dom; struct ltt_ust_session *usess = session->ust_session; @@ -1670,7 +1671,12 @@ int cmd_enable_event_all(struct ltt_session *session, goto error; } - ret = event_jul_enable_all(usess); + event.loglevel = LTTNG_LOGLEVEL_JUL_ALL; + event.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL; + strncpy(event.name, "*", sizeof(event.name)); + event.name[sizeof(event.name) - 1] = '\0'; + + ret = event_jul_enable_all(usess, &event); if (ret != LTTNG_OK) { goto error; } @@ -2147,7 +2153,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; @@ -2159,7 +2172,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; @@ -2832,12 +2852,17 @@ static int record_ust_snapshot(struct ltt_ust_session *usess, ret = ust_app_snapshot_record(usess, output, wait, nb_streams); if (ret < 0) { - if (ret == -EINVAL) { + switch (-ret) { + case EINVAL: ret = LTTNG_ERR_INVALID; - goto error_snapshot; + break; + case ENODATA: + ret = LTTNG_ERR_SNAPSHOT_NODATA; + break; + default: + ret = LTTNG_ERR_SNAPSHOT_FAIL; + break; } - - ret = LTTNG_ERR_SNAPSHOT_FAIL; goto error_snapshot; }