Lines Matching refs:cmdlines
163 struct cmdline *cmdlines; in cmdline_init() local
166 cmdlines = malloc(sizeof(*cmdlines) * pevent->cmdline_count); in cmdline_init()
167 if (!cmdlines) in cmdline_init()
172 cmdlines[i].pid = cmdlist->pid; in cmdline_init()
173 cmdlines[i].comm = cmdlist->comm; in cmdline_init()
180 qsort(cmdlines, pevent->cmdline_count, sizeof(*cmdlines), cmdline_cmp); in cmdline_init()
182 pevent->cmdlines = cmdlines; in cmdline_init()
196 if (!pevent->cmdlines && cmdline_init(pevent)) in find_cmdline()
201 comm = bsearch(&key, pevent->cmdlines, pevent->cmdline_count, in find_cmdline()
202 sizeof(*pevent->cmdlines), cmdline_cmp); in find_cmdline()
225 if (!pevent->cmdlines && cmdline_init(pevent)) in pevent_pid_is_registered()
230 comm = bsearch(&key, pevent->cmdlines, pevent->cmdline_count, in pevent_pid_is_registered()
231 sizeof(*pevent->cmdlines), cmdline_cmp); in pevent_pid_is_registered()
245 struct cmdline *cmdlines = pevent->cmdlines; in add_new_comm() local
255 cmdline = bsearch(&key, pevent->cmdlines, pevent->cmdline_count, in add_new_comm()
256 sizeof(*pevent->cmdlines), cmdline_cmp); in add_new_comm()
262 cmdlines = realloc(cmdlines, sizeof(*cmdlines) * (pevent->cmdline_count + 1)); in add_new_comm()
263 if (!cmdlines) { in add_new_comm()
268 cmdlines[pevent->cmdline_count].comm = strdup(comm); in add_new_comm()
269 if (!cmdlines[pevent->cmdline_count].comm) { in add_new_comm()
270 free(cmdlines); in add_new_comm()
275 cmdlines[pevent->cmdline_count].pid = pid; in add_new_comm()
277 if (cmdlines[pevent->cmdline_count].comm) in add_new_comm()
280 qsort(cmdlines, pevent->cmdline_count, sizeof(*cmdlines), cmdline_cmp); in add_new_comm()
281 pevent->cmdlines = cmdlines; in add_new_comm()
299 if (pevent->cmdlines) in pevent_register_comm()
5975 if (pevent->cmdlines) { in pevent_free()
5977 free(pevent->cmdlines[i].comm); in pevent_free()
5978 free(pevent->cmdlines); in pevent_free()