Lines Matching defs:cgrp
80 struct cgroup_sel *cgrp = NULL;
83 * check if cgrp is already defined, if so we reuse it
86 cgrp = counter->cgrp;
87 if (!cgrp)
89 if (!strcmp(cgrp->name, str))
92 cgrp = NULL;
95 if (!cgrp) {
96 cgrp = zalloc(sizeof(*cgrp));
97 if (!cgrp)
100 cgrp->name = str;
102 cgrp->fd = open_cgroup(str);
103 if (cgrp->fd == -1) {
104 free(cgrp);
119 if (cgrp->refcnt == 0)
120 free(cgrp);
124 cgrp->refcnt++;
125 counter->cgrp = cgrp;
129 void close_cgroup(struct cgroup_sel *cgrp)
131 if (!cgrp)
135 if (--cgrp->refcnt == 0) {
136 close(cgrp->fd);
137 free(cgrp->name);
138 free(cgrp);