thread.c (7d50d07da23995a18ac449636cb42aec2cb2808d) thread.c (591765fdaf7ea1888157f342b67b0461f2e5ed9b)
1#include "../perf.h"
2#include <stdlib.h>
3#include <stdio.h>
4#include <string.h>
5#include "session.h"
6#include "thread.h"
7#include "util.h"
8#include "debug.h"

--- 48 unchanged lines hidden (view full) ---

57 self->comm = malloc(32);
58 if (self->comm)
59 snprintf(self->comm, 32, ":%d", self->pid);
60 }
61
62 return self;
63}
64
1#include "../perf.h"
2#include <stdlib.h>
3#include <stdio.h>
4#include <string.h>
5#include "session.h"
6#include "thread.h"
7#include "util.h"
8#include "debug.h"

--- 48 unchanged lines hidden (view full) ---

57 self->comm = malloc(32);
58 if (self->comm)
59 snprintf(self->comm, 32, ":%d", self->pid);
60 }
61
62 return self;
63}
64
65void thread__delete(struct thread *self)
66{
67 map_groups__exit(&self->mg);
68 free(self->comm);
69 free(self);
70}
71
65int thread__set_comm(struct thread *self, const char *comm)
66{
67 int err;
68
69 if (self->comm)
70 free(self->comm);
71 self->comm = strdup(comm);
72 err = self->comm == NULL ? -ENOMEM : 0;

--- 101 unchanged lines hidden ---
72int thread__set_comm(struct thread *self, const char *comm)
73{
74 int err;
75
76 if (self->comm)
77 free(self->comm);
78 self->comm = strdup(comm);
79 err = self->comm == NULL ? -ENOMEM : 0;

--- 101 unchanged lines hidden ---