Lines Matching refs:map

10 static void perf_thread_map__reset(struct perf_thread_map *map, int start, int nr)  in perf_thread_map__reset()  argument
12 size_t size = (nr - start) * sizeof(map->map[0]); in perf_thread_map__reset()
14 memset(&map->map[start], 0, size); in perf_thread_map__reset()
15 map->err_thread = -1; in perf_thread_map__reset()
18 struct perf_thread_map *perf_thread_map__realloc(struct perf_thread_map *map, int nr) in perf_thread_map__realloc() argument
20 size_t size = sizeof(*map) + sizeof(map->map[0]) * nr; in perf_thread_map__realloc()
21 int start = map ? map->nr : 0; in perf_thread_map__realloc()
23 map = realloc(map, size); in perf_thread_map__realloc()
27 if (map) in perf_thread_map__realloc()
28 perf_thread_map__reset(map, start, nr); in perf_thread_map__realloc()
30 return map; in perf_thread_map__realloc()
35 void perf_thread_map__set_pid(struct perf_thread_map *map, int thread, pid_t pid) in perf_thread_map__set_pid() argument
37 map->map[thread].pid = pid; in perf_thread_map__set_pid()
40 char *perf_thread_map__comm(struct perf_thread_map *map, int thread) in perf_thread_map__comm() argument
42 return map->map[thread].comm; in perf_thread_map__comm()
70 struct perf_thread_map *perf_thread_map__get(struct perf_thread_map *map) in perf_thread_map__get() argument
72 if (map) in perf_thread_map__get()
73 refcount_inc(&map->refcnt); in perf_thread_map__get()
74 return map; in perf_thread_map__get()
77 void perf_thread_map__put(struct perf_thread_map *map) in perf_thread_map__put() argument
79 if (map && refcount_dec_and_test(&map->refcnt)) in perf_thread_map__put()
80 perf_thread_map__delete(map); in perf_thread_map__put()
88 pid_t perf_thread_map__pid(struct perf_thread_map *map, int thread) in perf_thread_map__pid() argument
90 return map->map[thread].pid; in perf_thread_map__pid()