break;
if (h->ms.map == NULL && verbose > 1) {
- __map_groups__fprintf_maps(&h->thread->mg,
+ __map_groups__fprintf_maps(h->thread->mg,
MAP__FUNCTION, verbose, fp);
fprintf(fp, "%.10s end\n", graph_dotted_line);
}
struct thread *thread = zalloc(sizeof(*thread));
if (thread != NULL) {
- map_groups__init(&thread->mg);
+ thread->mg = map_groups__new();
+ if (thread->mg == NULL)
+ goto out_free;
+
thread->pid_ = pid;
thread->tid = tid;
thread->ppid = -1;
return thread;
err_thread:
+ map_groups__delete(thread->mg);
+out_free:
free(thread);
return NULL;
}
{
struct comm *comm, *tmp;
- map_groups__exit(&thread->mg);
+ map_groups__delete(thread->mg);
+ thread->mg = NULL;
list_for_each_entry_safe(comm, tmp, &thread->comm_list, list) {
list_del(&comm->list);
comm__free(comm);
size_t thread__fprintf(struct thread *thread, FILE *fp)
{
return fprintf(fp, "Thread %d %s\n", thread->tid, thread__comm_str(thread)) +
- map_groups__fprintf(&thread->mg, verbose, fp);
+ map_groups__fprintf(thread->mg, verbose, fp);
}
void thread__insert_map(struct thread *thread, struct map *map)
{
- map_groups__fixup_overlappings(&thread->mg, map, verbose, stderr);
- map_groups__insert(&thread->mg, map);
+ map_groups__fixup_overlappings(thread->mg, map, verbose, stderr);
+ map_groups__insert(thread->mg, map);
}
int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp)
}
for (i = 0; i < MAP__NR_TYPES; ++i)
- if (map_groups__clone(&thread->mg, &parent->mg, i) < 0)
+ if (map_groups__clone(thread->mg, parent->mg, i) < 0)
return -ENOMEM;
thread->ppid = parent->tid;