Lines Matching defs:comm
2 #include "comm.h"
108 struct comm *comm__new(const char *str, u64 timestamp, bool exec)
110 struct comm *comm = zalloc(sizeof(*comm));
112 if (!comm)
115 comm->start = timestamp;
116 comm->exec = exec;
118 comm->comm_str = comm_str__findnew(str, &comm_str_root);
119 if (!comm->comm_str) {
120 free(comm);
124 return comm;
127 int comm__override(struct comm *comm, const char *str, u64 timestamp, bool exec)
129 struct comm_str *new, *old = comm->comm_str;
136 comm->comm_str = new;
137 comm->start = timestamp;
139 comm->exec = true;
144 void comm__free(struct comm *comm)
146 comm_str__put(comm->comm_str);
147 free(comm);
150 const char *comm__str(const struct comm *comm)
152 return comm->comm_str->str;