Home | History | Annotate | Download | only in util

Lines Matching defs:self

12 	struct thread *self = zalloc(sizeof(*self));
14 if (self != NULL) {
15 map_groups__init(&self->mg);
16 self->pid_ = pid;
17 self->tid = tid;
18 self->ppid = -1;
19 self->comm = malloc(32);
20 if (self->comm)
21 snprintf(self->comm, 32, ":%d", self->tid);
24 return self;
27 void thread__delete(struct thread *self)
29 map_groups__exit(&self->mg);
30 free(self->comm);
31 free(self);
34 int thread__set_comm(struct thread *self, const char *comm)
38 if (self->comm)
39 free(self->comm);
40 self->comm = strdup(comm);
41 err = self->comm == NULL ? -ENOMEM : 0;
43 self->comm_set = true;
48 int thread__comm_len(struct thread *self)
50 if (!self->comm_len) {
51 if (!self->comm)
53 self->comm_len = strlen(self->comm);
56 return self->comm_len;
65 void thread__insert_map(struct thread *self, struct map *map)
67 map_groups__fixup_overlappings(&self->mg, map, verbose, stderr);
68 map_groups__insert(&self->mg, map);
71 int thread__fork(struct thread *self, struct thread *parent)
76 if (self->comm)
77 free(self->comm);
78 self->comm = strdup(parent->comm);
79 if (!self->comm)
81 self->comm_set = true;
85 if (map_groups__clone(&self->mg, &parent->mg, i) < 0)
88 self->ppid = parent->tid;