LTTNG_ERR_PROBE_LOCATION_INVAL = 138, /* Invalid userspace probe location. */
LTTNG_ERR_ELF_PARSING = 139, /* ELF parsing error. */
LTTNG_ERR_SDT_PROBE_SEMAPHORE = 140, /* SDT probe guarded by a semaphore. */
+ LTTNG_ERR_ROTATION_FAIL_CONSUMER = 141, /* Rotation failure on consumer */
+ LTTNG_ERR_ROTATE_RENAME_FAIL_CONSUMER = 142, /* Rotation rename failure on consumer */
+ LTTNG_ERR_ROTATION_PENDING_LOCAL_FAIL_CONSUMER = 143, /* Rotation pending check (local) failure on consumer */
+ LTTNG_ERR_ROTATION_PENDING_RELAY_FAIL_CONSUMER = 144, /* Rotation pending check (relay) failure on consumer */
+ LTTNG_ERR_MKDIR_FAIL_CONSUMER = 145, /* mkdir failure on consumer */
+ LTTNG_ERR_CHAN_NOT_FOUND = 146, /* Channel not found */
+
/* MUST be last element */
LTTNG_ERR_NR, /* Last element */
output->chunk_path, domain_path);
if (ret < 0 || ret == sizeof(msg.u.rotate_channel.pathname)) {
ERR("Failed to format channel path name when asking consumer to rotate channel");
- ret = -1;
+ ret = -LTTNG_ERR_INVALID;
goto error;
}
} else {
output->chunk_path, domain_path);
if (ret < 0 || ret == sizeof(msg.u.rotate_channel.pathname)) {
ERR("Failed to format channel path name when asking consumer to rotate channel");
- ret = -1;
+ ret = -LTTNG_ERR_INVALID;
goto error;
}
}
health_code_update();
ret = consumer_send_msg(socket, &msg);
if (ret < 0) {
+ switch (-ret) {
+ case LTTCOMM_CONSUMERD_CHAN_NOT_FOUND:
+ ret = -LTTNG_ERR_CHAN_NOT_FOUND;
+ break;
+ default:
+ ret = -LTTNG_ERR_ROTATION_FAIL_CONSUMER;
+ break;
+ }
goto error;
}
-
error:
pthread_mutex_unlock(socket->lock);
health_code_update();
if (old_path_length >= sizeof(msg.u.rotate_rename.old_path)) {
ERR("consumer_rotate_rename: old path length (%zu bytes) exceeds the maximal length allowed by the consumer protocol (%zu bytes)",
old_path_length + 1, sizeof(msg.u.rotate_rename.old_path));
- ret = -1;
+ ret = -LTTNG_ERR_INVALID;
goto error;
}
if (new_path_length >= sizeof(msg.u.rotate_rename.new_path)) {
ERR("consumer_rotate_rename: new path length (%zu bytes) exceeds the maximal length allowed by the consumer protocol (%zu bytes)",
new_path_length + 1, sizeof(msg.u.rotate_rename.new_path));
- ret = -1;
+ ret = -LTTNG_ERR_INVALID;
goto error;
}
health_code_update();
ret = consumer_send_msg(socket, &msg);
if (ret < 0) {
+ ret = -LTTNG_ERR_ROTATE_RENAME_FAIL_CONSUMER;
goto error;
}
health_code_update();
ret = consumer_send_msg(socket, &msg);
if (ret < 0) {
+ ret = -LTTNG_ERR_ROTATION_PENDING_LOCAL_FAIL_CONSUMER;
goto error;
}
health_code_update();
ret = consumer_send_msg(socket, &msg);
if (ret < 0) {
+ ret = -LTTNG_ERR_ROTATION_PENDING_RELAY_FAIL_CONSUMER;
goto error;
}
ret = snprintf(msg.u.mkdir.path, sizeof(msg.u.mkdir.path), "%s", path);
if (ret < 0 || ret >= sizeof(msg.u.mkdir.path)) {
ERR("Format path");
- ret = -1;
+ ret = -LTTNG_ERR_INVALID;
goto error;
}
health_code_update();
ret = consumer_send_msg(socket, &msg);
if (ret < 0) {
+ ret = -LTTNG_ERR_MKDIR_FAIL_CONSUMER;
goto error;
}
[ ERROR_INDEX(LTTNG_ERR_PROBE_LOCATION_INVAL) ] = "Invalid userspace probe location",
[ ERROR_INDEX(LTTNG_ERR_ELF_PARSING) ] = "ELF parsing error",
[ ERROR_INDEX(LTTNG_ERR_SDT_PROBE_SEMAPHORE) ] = "SDT probe guarded by a semaphore",
+ [ ERROR_INDEX(LTTNG_ERR_ROTATION_FAIL_CONSUMER) ] = "Rotation failure on consumer",
+ [ ERROR_INDEX(LTTNG_ERR_ROTATE_RENAME_FAIL_CONSUMER) ] = "Rotation rename failure on consumer",
+ [ ERROR_INDEX(LTTNG_ERR_ROTATION_PENDING_LOCAL_FAIL_CONSUMER) ] = "Rotation pending check (local) failure on consumer",
+ [ ERROR_INDEX(LTTNG_ERR_ROTATION_PENDING_RELAY_FAIL_CONSUMER) ] = "Rotation pending check (relay) failure on consumer",
+ [ ERROR_INDEX(LTTNG_ERR_MKDIR_FAIL_CONSUMER) ] = "mkdir failure on consumer",
+ [ ERROR_INDEX(LTTNG_ERR_CHAN_NOT_FOUND) ] = "Channel not found",
/* Last element */
[ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code"