chan = zmalloc(sizeof(struct lttng_channel));
if (chan == NULL) {
- perror("malloc channel init");
+ perror("zmalloc channel init");
goto error_alloc;
}
/*
cds_list_for_each_entry(uevent, &src->events.head, list) {
- new_uevent = malloc(sizeof(struct ltt_ust_event));
+ new_uevent = zmalloc(sizeof(struct ltt_ust_event));
if (new_uevent == NULL) {
- perror("malloc ltt_ust_event");
+ perror("zmalloc ltt_ust_event");
goto error;
}
/* This *must* be freed by using lttng_poll_free() */
events->events = zmalloc(size * sizeof(struct epoll_event));
if (events->events == NULL) {
- perror("malloc epoll set");
+ perror("zmalloc epoll set");
goto error_close;
}
/* This *must* be freed by using lttng_poll_free() */
events->events = zmalloc(size * sizeof(struct pollfd));
if (events->events == NULL) {
- perror("malloc struct pollfd");
+ perror("zmalloc struct pollfd");
goto error;
}
new = zmalloc(new_size * sizeof(struct pollfd));
if (new == NULL) {
- perror("malloc poll del");
+ perror("zmalloc poll del");
goto error;
}
goto error;
}
- chan->ctx = malloc(sizeof(struct lttng_kernel_context));
+ chan->ctx = zmalloc(sizeof(struct lttng_kernel_context));
if (chan->ctx == NULL) {
- perror("malloc event context");
+ perror("zmalloc event context");
goto error;
}
goto error;
}
- event->ctx = malloc(sizeof(struct lttng_kernel_context));
+ event->ctx = zmalloc(sizeof(struct lttng_kernel_context));
if (event->ctx == NULL) {
- perror("malloc event context");
+ perror("zmalloc event context");
goto error;
}
* See kernel-ctl.h for explanation of this value
*/
nbmem = KERNEL_EVENT_LIST_SIZE;
- elist = malloc(sizeof(struct lttng_event) * nbmem);
+ elist = zmalloc(sizeof(struct lttng_event) * nbmem);
while ((size = fscanf(fp, "event { name = %m[^;]; };%n\n", &event, &pos)) == 1) {
if (count > nbmem) {
buf_size = size;
- cmd_ctx->llm = malloc(sizeof(struct lttcomm_lttng_msg) + buf_size);
+ cmd_ctx->llm = zmalloc(sizeof(struct lttcomm_lttng_msg) + buf_size);
if (cmd_ctx->llm == NULL) {
- perror("malloc");
+ perror("zmalloc");
ret = -ENOMEM;
goto error;
}
}
/* Create UST registration command for enqueuing */
- ust_cmd = malloc(sizeof(struct ust_command));
+ ust_cmd = zmalloc(sizeof(struct ust_command));
if (ust_cmd == NULL) {
- perror("ust command malloc");
+ perror("ust command zmalloc");
goto error;
}
}
/* Allocate context command to process the client request */
- cmd_ctx = malloc(sizeof(struct command_ctx));
+ cmd_ctx = zmalloc(sizeof(struct command_ctx));
if (cmd_ctx == NULL) {
- perror("malloc cmd_ctx");
+ perror("zmalloc cmd_ctx");
goto error;
}
/* Allocate data buffer for reception */
- cmd_ctx->lsm = malloc(sizeof(struct lttcomm_session_msg));
+ cmd_ctx->lsm = zmalloc(sizeof(struct lttcomm_session_msg));
if (cmd_ctx->lsm == NULL) {
- perror("malloc cmd_ctx->lsm");
+ perror("zmalloc cmd_ctx->lsm");
goto error;
}
if (ret < 0) {
/*
* TODO: Inform client somehow of the fatal error. At
- * this point, ret < 0 means that a malloc failed
+ * this point, ret < 0 means that a zmalloc failed
* (ENOMEM). Error detected but still accept command.
*/
clean_command_ctx(&cmd_ctx);
}
/* Allocate session data structure */
- new_session = malloc(sizeof(struct ltt_session));
+ new_session = zmalloc(sizeof(struct ltt_session));
if (new_session == NULL) {
- perror("malloc");
+ perror("zmalloc");
ret = LTTCOMM_FATAL;
goto error_malloc;
}
struct ltt_kernel_session *lks;
/* Allocate a new ltt kernel session */
- lks = malloc(sizeof(struct ltt_kernel_session));
+ lks = zmalloc(sizeof(struct ltt_kernel_session));
if (lks == NULL) {
- perror("create kernel session malloc");
+ perror("create kernel session zmalloc");
goto error;
}
int ret;
struct ltt_kernel_channel *lkc;
- lkc = malloc(sizeof(struct ltt_kernel_channel));
+ lkc = zmalloc(sizeof(struct ltt_kernel_channel));
if (lkc == NULL) {
- perror("ltt_kernel_channel malloc");
+ perror("ltt_kernel_channel zmalloc");
goto error;
}
- lkc->channel = malloc(sizeof(struct lttng_channel));
+ lkc->channel = zmalloc(sizeof(struct lttng_channel));
if (lkc->channel == NULL) {
- perror("lttng_channel malloc");
+ perror("lttng_channel zmalloc");
goto error;
}
memcpy(lkc->channel, chan, sizeof(struct lttng_channel));
struct ltt_kernel_event *lke;
struct lttng_kernel_event *attr;
- lke = malloc(sizeof(struct ltt_kernel_event));
- attr = malloc(sizeof(struct lttng_kernel_event));
+ lke = zmalloc(sizeof(struct ltt_kernel_event));
+ attr = zmalloc(sizeof(struct lttng_kernel_event));
if (lke == NULL || attr == NULL) {
- perror("kernel event malloc");
+ perror("kernel event zmalloc");
goto error;
}
struct ltt_kernel_metadata *lkm;
struct lttng_channel *chan;
- lkm = malloc(sizeof(struct ltt_kernel_metadata));
- chan = malloc(sizeof(struct lttng_channel));
+ lkm = zmalloc(sizeof(struct ltt_kernel_metadata));
+ chan = zmalloc(sizeof(struct lttng_channel));
if (lkm == NULL || chan == NULL) {
- perror("kernel metadata malloc");
+ perror("kernel metadata zmalloc");
goto error;
}
{
struct ltt_kernel_stream *lks;
- lks = malloc(sizeof(struct ltt_kernel_stream));
+ lks = zmalloc(sizeof(struct ltt_kernel_stream));
if (lks == NULL) {
- perror("kernel stream malloc");
+ perror("kernel stream zmalloc");
goto error;
}
struct ltt_ust_session *lus;
/* Allocate a new ltt ust session */
- lus = malloc(sizeof(struct ltt_ust_session));
+ lus = zmalloc(sizeof(struct ltt_ust_session));
if (lus == NULL) {
- PERROR("create ust session malloc");
+ PERROR("create ust session zmalloc");
goto error;
}
luc = zmalloc(sizeof(struct ltt_ust_channel));
if (luc == NULL) {
- perror("ltt_ust_channel malloc");
+ perror("ltt_ust_channel zmalloc");
goto error;
}
lue = zmalloc(sizeof(struct ltt_ust_event));
if (lue == NULL) {
- PERROR("ust event malloc");
+ PERROR("ust event zmalloc");
goto error;
}
lum = zmalloc(sizeof(struct ltt_ust_metadata));
if (lum == NULL) {
- perror("ust metadata malloc");
+ perror("ust metadata zmalloc");
goto error;
}