diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-16 15:03:18 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-16 15:03:18 -0500 |
commit | ee4e9625c8d4ec3a35322a882f7b6e035d2a1ad5 (patch) | |
tree | ea3149c4bcc00cb344bd2c5c986bad864e5a2e04 | |
parent | 631d34b5626a8de828f3ab8da54013293097e678 (diff) |
perf symbols: Clarify method to get DSO binary_type filename
Using dso__binary_type_file() make it look like this function will
return a file, not just its filename, so rename it to:
dso__read_binary_type_filename()
to make its purpose clear, just like we have:
dso__read_running_kernel_build_id()
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: Namhyung Kim <namhyung@kernel.org>
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-vkf3upzrfrxtr01wueej4xw4@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/dso.c | 14 | ||||
-rw-r--r-- | tools/perf/util/dso.h | 4 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index e7f4449088e4..eef166212324 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
@@ -28,8 +28,9 @@ char dso__symtab_origin(const struct dso *dso) | |||
28 | return origin[dso->symtab_type]; | 28 | return origin[dso->symtab_type]; |
29 | } | 29 | } |
30 | 30 | ||
31 | int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type, | 31 | int dso__read_binary_type_filename(const struct dso *dso, |
32 | char *root_dir, char *filename, size_t size) | 32 | enum dso_binary_type type, |
33 | char *root_dir, char *filename, size_t size) | ||
33 | { | 34 | { |
34 | char build_id_hex[BUILD_ID_SIZE * 2 + 1]; | 35 | char build_id_hex[BUILD_ID_SIZE * 2 + 1]; |
35 | int ret = 0; | 36 | int ret = 0; |
@@ -137,19 +138,18 @@ int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type, | |||
137 | 138 | ||
138 | static int open_dso(struct dso *dso, struct machine *machine) | 139 | static int open_dso(struct dso *dso, struct machine *machine) |
139 | { | 140 | { |
140 | char *root_dir = (char *) ""; | ||
141 | char *name; | ||
142 | int fd; | 141 | int fd; |
142 | char *root_dir = (char *)""; | ||
143 | char *name = malloc(PATH_MAX); | ||
143 | 144 | ||
144 | name = malloc(PATH_MAX); | ||
145 | if (!name) | 145 | if (!name) |
146 | return -ENOMEM; | 146 | return -ENOMEM; |
147 | 147 | ||
148 | if (machine) | 148 | if (machine) |
149 | root_dir = machine->root_dir; | 149 | root_dir = machine->root_dir; |
150 | 150 | ||
151 | if (dso__binary_type_file(dso, dso->data_type, | 151 | if (dso__read_binary_type_filename(dso, dso->data_type, |
152 | root_dir, name, PATH_MAX)) { | 152 | root_dir, name, PATH_MAX)) { |
153 | free(name); | 153 | free(name); |
154 | return -EINVAL; | 154 | return -EINVAL; |
155 | } | 155 | } |
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index e1cc50698137..aa3384745d75 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h | |||
@@ -128,8 +128,8 @@ void dso__read_running_kernel_build_id(struct dso *dso, | |||
128 | int dso__kernel_module_get_build_id(struct dso *dso, const char *root_dir); | 128 | int dso__kernel_module_get_build_id(struct dso *dso, const char *root_dir); |
129 | 129 | ||
130 | char dso__symtab_origin(const struct dso *dso); | 130 | char dso__symtab_origin(const struct dso *dso); |
131 | int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type, | 131 | int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type type, |
132 | char *root_dir, char *filename, size_t size); | 132 | char *root_dir, char *filename, size_t size); |
133 | 133 | ||
134 | int dso__data_fd(struct dso *dso, struct machine *machine); | 134 | int dso__data_fd(struct dso *dso, struct machine *machine); |
135 | ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine, | 135 | ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine, |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 61eb1cddf01a..9ee4b80dac57 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1258,8 +1258,8 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter) | |||
1258 | 1258 | ||
1259 | enum dso_binary_type symtab_type = binary_type_symtab[i]; | 1259 | enum dso_binary_type symtab_type = binary_type_symtab[i]; |
1260 | 1260 | ||
1261 | if (dso__binary_type_file(dso, symtab_type, | 1261 | if (dso__read_binary_type_filename(dso, symtab_type, |
1262 | root_dir, name, PATH_MAX)) | 1262 | root_dir, name, PATH_MAX)) |
1263 | continue; | 1263 | continue; |
1264 | 1264 | ||
1265 | /* Name is now the name of the next image to try */ | 1265 | /* Name is now the name of the next image to try */ |