ltt_chan->commit_count_mask = (~0UL >> ltt_chan->n_subbufs_order);
ltt_chan->n_cpus = get_n_cpus();
//ust// ltt_chan->buf = percpu_alloc_mask(sizeof(struct ltt_channel_buf_struct), GFP_KERNEL, cpu_possible_map);
- ltt_chan->buf = (void *) malloc(ltt_chan->n_cpus * sizeof(void *));
+ ltt_chan->buf = (void *) zmalloc(ltt_chan->n_cpus * sizeof(void *));
if(ltt_chan->buf == NULL) {
goto error;
}
- ltt_chan->buf_struct_shmids = (int *) malloc(ltt_chan->n_cpus * sizeof(int));
+ ltt_chan->buf_struct_shmids = (int *) zmalloc(ltt_chan->n_cpus * sizeof(int));
if(ltt_chan->buf_struct_shmids == NULL)
goto free_buf;
}
}
/*
- * Using malloc here to allocate a variable length element. Could
+ * Using zmalloc here to allocate a variable length element. Could
* cause some memory fragmentation if overused.
*/
- e = malloc(sizeof(struct marker_entry)
+ e = zmalloc(sizeof(struct marker_entry)
+ channel_len + name_len + format_len);
if (!e)
return ERR_PTR(-ENOMEM);
{
struct lib *pl;
- pl = (struct lib *) malloc(sizeof(struct lib));
+ pl = (struct lib *) zmalloc(sizeof(struct lib));
pl->markers_start = markers_start;
pl->markers_count = markers_count;
found = 1;
- bc = (struct blocked_consumer *) malloc(sizeof(struct blocked_consumer));
+ bc = (struct blocked_consumer *) zmalloc(sizeof(struct blocked_consumer));
if(bc == NULL) {
- ERR("malloc returned NULL");
+ ERR("zmalloc returned NULL");
goto unlock_traces;
}
bc->fd_consumer = src->fd;
static inline void *allocate_probes(int count)
{
- struct tp_probes *p = malloc(count * sizeof(struct probe)
+ struct tp_probes *p = zmalloc(count * sizeof(void *)
+ sizeof(struct tp_probes));
return p == NULL ? NULL : p->probes;
}
}
}
/*
- * Using kmalloc here to allocate a variable length element. Could
+ * Using zmalloc here to allocate a variable length element. Could
* cause some memory fragmentation if overused.
*/
- e = malloc(sizeof(struct tracepoint_entry) + name_len);
+ e = zmalloc(sizeof(struct tracepoint_entry) + name_len);
if (!e)
return ERR_PTR(-ENOMEM);
memcpy(&e->name[0], name, name_len);
{
struct tracepoint_lib *pl;
- pl = (struct tracepoint_lib *) malloc(sizeof(struct tracepoint_lib));
+ pl = (struct tracepoint_lib *) zmalloc(sizeof(struct tracepoint_lib));
pl->tracepoints_start = tracepoints_start;
pl->tracepoints_count = tracepoints_count;