#include <unistd.h>
#include <common/bytecode/bytecode.h>
+#include <common/align.h>
#include <common/common.h>
#include <common/compat/errno.h>
#include <common/compat/string.h>
storage_req += ext_comm->nb_exclusions *
LTTNG_SYMBOL_NAME_LEN;
/* Padding to ensure the flat probe is aligned. */
- storage_req = ALIGN_TO(storage_req, sizeof(uint64_t));
+ storage_req = lttng_align_ceil(storage_req, sizeof(uint64_t));
storage_req += probe_storage_req;
}
}
/* Insert padding to align to 64-bits. */
ret = lttng_dynamic_buffer_set_size(&listing,
- ALIGN_TO(listing.size,
+ lttng_align_ceil(listing.size,
sizeof(uint64_t)));
if (ret) {
ret = -LTTNG_ERR_NOMEM;
*/
int lttng_set_tracing_group(const char *name)
{
+ int ret = 0;
+ char *new_group;
+
if (name == NULL) {
- return -LTTNG_ERR_INVALID;
+ ret = -LTTNG_ERR_INVALID;
+ goto end;
}
- if (asprintf(&tracing_group, "%s", name) < 0) {
- return -LTTNG_ERR_FATAL;
+ new_group = strdup(name);
+ if (!new_group) {
+ ret = -LTTNG_ERR_FATAL;
+ goto end;
}
- return 0;
+ free(tracing_group);
+ tracing_group = new_group;
+ new_group = NULL;
+
+end:
+ return ret;
}
int lttng_calibrate(struct lttng_handle *handle,