Skip to contentSkip to conversation

perf cgroup: Rename 'struct cgroup_sel' to 'struct cgroup'

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Mar 9, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  3ca32f69592be4d667c701763335fa496a0ede1d
Gitweb:     https://git.kernel.org/tip/3ca32f69592be4d667c701763335fa496a0ede1d
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 6 Mar 2018 09:51:48 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 7 Mar 2018 10:22:25 -0300

perf cgroup: Rename 'struct cgroup_sel' to 'struct cgroup'

That name isn't used, is shorter, lets switch to it.

---
 tools/perf/util/cgroup.c | 6 +++---
 tools/perf/util/cgroup.h | 5 +++--
 tools/perf/util/evsel.h  | 4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)
tools/perf/util/cgroup.c +3 -3
index 2e2aa6c86107..6ce291f45f2d 100644
@@ -93,7 +93,7 @@ static int open_cgroup(char *name)
 static int add_cgroup(struct perf_evlist *evlist, char *str)
 {
 	struct perf_evsel *counter;
-	struct cgroup_sel *cgrp = NULL;
+	struct cgroup *cgrp = NULL;
 	int n;
 	/*
 	 * check if cgrp is already defined, if so we reuse it
@@ -144,7 +144,7 @@ found:
 	return 0;
 }
 
-void close_cgroup(struct cgroup_sel *cgrp)
+void close_cgroup(struct cgroup *cgrp)
 {
 	if (cgrp && refcount_dec_and_test(&cgrp->refcnt)) {
 		close(cgrp->fd);
@@ -158,7 +158,7 @@ int parse_cgroups(const struct option *opt, const char *str,
 {
 	struct perf_evlist *evlist = *(struct perf_evlist **)opt->value;
 	struct perf_evsel *counter;
-	struct cgroup_sel *cgrp = NULL;
+	struct cgroup *cgrp = NULL;
 	const char *p, *e, *eos = str + strlen(str);
 	char *s;
 	int ret, i;
tools/perf/util/cgroup.h +3 -2
index afafc87e9201..934daa8e4c19 100644
@@ -6,7 +6,7 @@
 
 struct option;
 
-struct cgroup_sel {
+struct cgroup {
 	char *name;
 	int fd;
 	refcount_t refcnt;
@@ -14,7 +14,8 @@ struct cgroup_sel {
 
 
 extern int nr_cgroups; /* number of explicit cgroups defined */
-void close_cgroup(struct cgroup_sel *cgrp);
+void close_cgroup(struct cgroup *cgrp);
+
 int parse_cgroups(const struct option *opt, const char *str, int unset);
 
 #endif /* __CGROUP_H__ */
tools/perf/util/evsel.h +2 -2
index a7487c6d1866..92ba001b627f 100644
@@ -30,7 +30,7 @@ struct perf_sample_id {
 	u64			period;
 };
 
-struct cgroup_sel;
+struct cgroup;
 
 /*
  * The 'struct perf_evsel_config_term' is used to pass event
@@ -107,7 +107,7 @@ struct perf_evsel {
 	struct perf_stat_evsel  *stats;
 	void			*priv;
 	u64			db_id;
-	struct cgroup_sel	*cgrp;
+	struct cgroup		*cgrp;
 	void			*handler;
 	struct cpu_map		*cpus;
 	struct cpu_map		*own_cpus;