Lines Matching defs:comm
16 #include "comm.h"
50 struct comm *comm;
67 comm = comm__new(comm_str, 0, false);
68 if (!comm)
71 list_add(&comm->list, thread__comm_list(thread));
97 struct comm *comm, *tmp_comm;
114 list_for_each_entry_safe(comm, tmp_comm, thread__comm_list(thread), list) {
115 list_del_init(&comm->list);
116 comm__free(comm);
205 static struct comm *__thread__comm(struct thread *thread)
211 return list_first_entry(thread__comm_list(thread), struct comm, list);
214 struct comm *thread__comm(struct thread *thread)
216 struct comm *res = NULL;
224 struct comm *thread__exec_comm(struct thread *thread)
226 struct comm *comm, *last = NULL, *second_last = NULL;
229 list_for_each_entry(comm, thread__comm_list(thread), list) {
230 if (comm->exec) {
232 return comm;
235 last = comm;
240 * 'last' with no start time might be the parent's comm of a synthesized
242 * thread, that is very probably wrong. Prefer a later comm to avoid
255 struct comm *new, *curr = __thread__comm(thread);
291 char *comm = NULL;
295 if (!(snprintf(path, sizeof(path), "%d/task/%d/comm",
297 procfs__read_str(path, &comm, &sz) == 0) {
300 free(comm);
303 comm[sz - 1] = '\0';
304 err = thread__set_comm(thread, comm, 0);
313 const struct comm *comm = __thread__comm(thread);
315 if (!comm)
318 return comm__str(comm);
332 static int __thread__comm_len(struct thread *thread, const char *comm)
334 if (!comm)
336 thread__set_comm_len(thread, strlen(comm));
341 /* CHECKME: it should probably better return the max comm len from its comm list */
347 const char *comm;
350 comm = __thread__comm_str(thread);
351 comm_len = __thread__comm_len(thread, comm);
403 const char *comm = thread__comm_str(parent);
405 if (!comm)
407 err = thread__set_comm(thread, comm, timestamp);