8 #include <linux/refcount.h> 30 if (cs && refcount_dec_and_test(&cs->
refcnt)) {
47 cs->
str = strdup(str);
53 refcount_set(&cs->
refcnt, 1);
61 struct rb_node **p = &root->rb_node;
70 cmp = strcmp(str, iter->
str);
84 rb_link_node(&
new->rb_node, parent, p);
85 rb_insert_color(&
new->rb_node, root);
108 comm->
start = timestamp;
130 comm->
start = timestamp;
struct comm * comm__new(const char *str, u64 timestamp, bool exec)
static struct comm_str * comm_str__get(struct comm_str *cs)
static struct rw_semaphore comm_str_lock
static void comm_str__put(struct comm_str *cs)
static struct comm_str * comm_str__findnew(const char *str, struct rb_root *root)
int up_write(struct rw_semaphore *sem)
const char * comm__str(const struct comm *comm)
static struct comm_str * __comm_str__findnew(const char *str, struct rb_root *root)
int comm__override(struct comm *comm, const char *str, u64 timestamp, bool exec)
void comm__free(struct comm *comm)
static struct rb_root comm_str_root
int down_write(struct rw_semaphore *sem)
static struct comm_str * comm_str__alloc(const char *str)
void static void * zalloc(size_t size)
struct comm_str * comm_str