X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libust%2Ftracepoint.c;h=16b4819b88e686f01a6f3ad08a6de3cecf783f0c;hb=c66428ac9ee17d0724baf4430e29887aeed5f259;hp=620a009cf333539fe5bd263fadd4ba0f762351ba;hpb=9dec086e052cf7f583a3afaa3aab48a6de8d38ac;p=ust.git diff --git a/libust/tracepoint.c b/libust/tracepoint.c index 620a009..16b4819 100644 --- a/libust/tracepoint.c +++ b/libust/tracepoint.c @@ -74,7 +74,7 @@ struct tp_probes { 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; } @@ -154,8 +154,8 @@ tracepoint_entry_remove_probe(struct tracepoint_entry *entry, void *probe, 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++; } @@ -225,10 +225,10 @@ static struct tracepoint_entry *add_tracepoint(const char *name) } } /* - * 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); @@ -661,7 +661,7 @@ int tracepoint_register_lib(struct tracepoint *tracepoints_start, int tracepoint { 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;