static inline void *allocate_probes(int count)
{
- struct tp_probes *p = malloc(count * sizeof(struct probe)
+ struct tp_probes *p = zmalloc(count * sizeof(struct probe)
+ sizeof(struct tp_probes));
return p == NULL ? NULL : p->probes;
}
static inline void release_probes(void *old)
{
if (old) {
- struct tp_probes *tp_probes = container_of(old,
+ struct tp_probes *tp_probes = _ust_container_of(old,
struct tp_probes, probes[0]);
//ust// call_rcu_sched(&tp_probes->u.rcu, rcu_free_old_probes);
synchronize_rcu();
debug_print_probes(entry);
/* (N -> M), (N > 1, M >= 0) probes */
for (nr_probes = 0; old[nr_probes].func; nr_probes++) {
- if ((!probe ||
- old[nr_probes].func == probe &&
+ if (!probe ||
+ (old[nr_probes].func == probe &&
old[nr_probes].data == data))
nr_del++;
}
}
}
/*
- * 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);
{
need_update = 1;
if (old) {
- struct tp_probes *tp_probes = container_of(old,
+ struct tp_probes *tp_probes = _ust_container_of(old,
struct tp_probes, probes[0]);
list_add(&tp_probes->u.list, &old_probes);
}
{
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;