diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-05 12:48:50 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-05 13:15:00 -0500 |
commit | cf38fadade52df937521dd70d4437df1a9354cd9 (patch) | |
tree | e40d0b9b949de86c395bd189b9810790b28edc69 /tools/perf/util/pmu.c | |
parent | 4299a549979783668d787959d61ba22b6b200877 (diff) |
perf fs: Rename NAME_find_mountpoint() to NAME__mountpoint()
Shorten it, "finding" it is an implementation detail, what callers want
is the pathname, not to ask for it to _always_ do the lookup.
And the existing implementation already caches it, i.e. it doesn't
"finds" it on every call.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-r24wa4bvtccg7mnkessrbbdj@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/pmu.c')
-rw-r--r-- | tools/perf/util/pmu.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 45b42dffcd70..c232d8dd410b 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c | |||
@@ -77,9 +77,8 @@ static int pmu_format(const char *name, struct list_head *format) | |||
77 | { | 77 | { |
78 | struct stat st; | 78 | struct stat st; |
79 | char path[PATH_MAX]; | 79 | char path[PATH_MAX]; |
80 | const char *sysfs; | 80 | const char *sysfs = sysfs__mountpoint(); |
81 | 81 | ||
82 | sysfs = sysfs_find_mountpoint(); | ||
83 | if (!sysfs) | 82 | if (!sysfs) |
84 | return -1; | 83 | return -1; |
85 | 84 | ||
@@ -166,9 +165,8 @@ static int pmu_aliases(const char *name, struct list_head *head) | |||
166 | { | 165 | { |
167 | struct stat st; | 166 | struct stat st; |
168 | char path[PATH_MAX]; | 167 | char path[PATH_MAX]; |
169 | const char *sysfs; | 168 | const char *sysfs = sysfs__mountpoint(); |
170 | 169 | ||
171 | sysfs = sysfs_find_mountpoint(); | ||
172 | if (!sysfs) | 170 | if (!sysfs) |
173 | return -1; | 171 | return -1; |
174 | 172 | ||
@@ -212,11 +210,10 @@ static int pmu_type(const char *name, __u32 *type) | |||
212 | { | 210 | { |
213 | struct stat st; | 211 | struct stat st; |
214 | char path[PATH_MAX]; | 212 | char path[PATH_MAX]; |
215 | const char *sysfs; | ||
216 | FILE *file; | 213 | FILE *file; |
217 | int ret = 0; | 214 | int ret = 0; |
215 | const char *sysfs = sysfs__mountpoint(); | ||
218 | 216 | ||
219 | sysfs = sysfs_find_mountpoint(); | ||
220 | if (!sysfs) | 217 | if (!sysfs) |
221 | return -1; | 218 | return -1; |
222 | 219 | ||
@@ -241,11 +238,10 @@ static int pmu_type(const char *name, __u32 *type) | |||
241 | static void pmu_read_sysfs(void) | 238 | static void pmu_read_sysfs(void) |
242 | { | 239 | { |
243 | char path[PATH_MAX]; | 240 | char path[PATH_MAX]; |
244 | const char *sysfs; | ||
245 | DIR *dir; | 241 | DIR *dir; |
246 | struct dirent *dent; | 242 | struct dirent *dent; |
243 | const char *sysfs = sysfs__mountpoint(); | ||
247 | 244 | ||
248 | sysfs = sysfs_find_mountpoint(); | ||
249 | if (!sysfs) | 245 | if (!sysfs) |
250 | return; | 246 | return; |
251 | 247 | ||
@@ -270,11 +266,10 @@ static struct cpu_map *pmu_cpumask(const char *name) | |||
270 | { | 266 | { |
271 | struct stat st; | 267 | struct stat st; |
272 | char path[PATH_MAX]; | 268 | char path[PATH_MAX]; |
273 | const char *sysfs; | ||
274 | FILE *file; | 269 | FILE *file; |
275 | struct cpu_map *cpus; | 270 | struct cpu_map *cpus; |
271 | const char *sysfs = sysfs__mountpoint(); | ||
276 | 272 | ||
277 | sysfs = sysfs_find_mountpoint(); | ||
278 | if (!sysfs) | 273 | if (!sysfs) |
279 | return NULL; | 274 | return NULL; |
280 | 275 | ||