diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-10 14:02:50 -0500 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-10 14:51:11 -0500 |
| commit | 7d2a5122ca973cdf3c1469187811ae01dc07f67a (patch) | |
| tree | 0d071a309dce142f1a619ba922e519c9c2d6ff69 /tools/perf | |
| parent | 3344996e4f2980be568ecf0cd59cb85e646da029 (diff) | |
perf symbols: Rename filename argument
The 'file' is more commonly associated with a file descriptor of
some sort, rename it to 'filename' as this is the more common idiom
for a file name argument.
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-0ehaawv5xc83w6ag03c5hi10@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/util/dso.c | 32 | ||||
| -rw-r--r-- | tools/perf/util/dso.h | 2 |
2 files changed, 17 insertions, 17 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index fbc66fde6b30..582b5d344aa3 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
| @@ -29,7 +29,7 @@ char dso__symtab_origin(const struct dso *dso) | |||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type, | 31 | int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type, |
| 32 | char *root_dir, char *file, size_t size) | 32 | char *root_dir, char *filename, size_t size) |
| 33 | { | 33 | { |
| 34 | char build_id_hex[BUILD_ID_SIZE * 2 + 1]; | 34 | char build_id_hex[BUILD_ID_SIZE * 2 + 1]; |
| 35 | int ret = 0; | 35 | int ret = 0; |
| @@ -38,30 +38,30 @@ int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type, | |||
| 38 | case DSO_BINARY_TYPE__DEBUGLINK: { | 38 | case DSO_BINARY_TYPE__DEBUGLINK: { |
| 39 | char *debuglink; | 39 | char *debuglink; |
| 40 | 40 | ||
| 41 | strncpy(file, dso->long_name, size); | 41 | strncpy(filename, dso->long_name, size); |
| 42 | debuglink = file + dso->long_name_len; | 42 | debuglink = filename + dso->long_name_len; |
| 43 | while (debuglink != file && *debuglink != '/') | 43 | while (debuglink != filename && *debuglink != '/') |
| 44 | debuglink--; | 44 | debuglink--; |
| 45 | if (*debuglink == '/') | 45 | if (*debuglink == '/') |
| 46 | debuglink++; | 46 | debuglink++; |
| 47 | filename__read_debuglink(dso->long_name, debuglink, | 47 | filename__read_debuglink(dso->long_name, debuglink, |
| 48 | size - (debuglink - file)); | 48 | size - (debuglink - filename)); |
| 49 | } | 49 | } |
| 50 | break; | 50 | break; |
| 51 | case DSO_BINARY_TYPE__BUILD_ID_CACHE: | 51 | case DSO_BINARY_TYPE__BUILD_ID_CACHE: |
| 52 | /* skip the locally configured cache if a symfs is given */ | 52 | /* skip the locally configured cache if a symfs is given */ |
| 53 | if (symbol_conf.symfs[0] || | 53 | if (symbol_conf.symfs[0] || |
| 54 | (dso__build_id_filename(dso, file, size) == NULL)) | 54 | (dso__build_id_filename(dso, filename, size) == NULL)) |
| 55 | ret = -1; | 55 | ret = -1; |
| 56 | break; | 56 | break; |
| 57 | 57 | ||
| 58 | case DSO_BINARY_TYPE__FEDORA_DEBUGINFO: | 58 | case DSO_BINARY_TYPE__FEDORA_DEBUGINFO: |
| 59 | snprintf(file, size, "%s/usr/lib/debug%s.debug", | 59 | snprintf(filename, size, "%s/usr/lib/debug%s.debug", |
| 60 | symbol_conf.symfs, dso->long_name); | 60 | symbol_conf.symfs, dso->long_name); |
| 61 | break; | 61 | break; |
| 62 | 62 | ||
| 63 | case DSO_BINARY_TYPE__UBUNTU_DEBUGINFO: | 63 | case DSO_BINARY_TYPE__UBUNTU_DEBUGINFO: |
| 64 | snprintf(file, size, "%s/usr/lib/debug%s", | 64 | snprintf(filename, size, "%s/usr/lib/debug%s", |
| 65 | symbol_conf.symfs, dso->long_name); | 65 | symbol_conf.symfs, dso->long_name); |
| 66 | break; | 66 | break; |
| 67 | 67 | ||
| @@ -75,14 +75,14 @@ int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type, | |||
| 75 | while (last_slash != dso->long_name && *last_slash != '/') | 75 | while (last_slash != dso->long_name && *last_slash != '/') |
| 76 | last_slash--; | 76 | last_slash--; |
| 77 | 77 | ||
| 78 | len = scnprintf(file, size, "%s", symbol_conf.symfs); | 78 | len = scnprintf(filename, size, "%s", symbol_conf.symfs); |
| 79 | dir_size = last_slash - dso->long_name + 2; | 79 | dir_size = last_slash - dso->long_name + 2; |
| 80 | if (dir_size > (size - len)) { | 80 | if (dir_size > (size - len)) { |
| 81 | ret = -1; | 81 | ret = -1; |
| 82 | break; | 82 | break; |
| 83 | } | 83 | } |
| 84 | len += scnprintf(file + len, dir_size, "%s", dso->long_name); | 84 | len += scnprintf(filename + len, dir_size, "%s", dso->long_name); |
| 85 | len += scnprintf(file + len , size - len, ".debug%s", | 85 | len += scnprintf(filename + len , size - len, ".debug%s", |
| 86 | last_slash); | 86 | last_slash); |
| 87 | break; | 87 | break; |
| 88 | } | 88 | } |
| @@ -96,7 +96,7 @@ int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type, | |||
| 96 | build_id__sprintf(dso->build_id, | 96 | build_id__sprintf(dso->build_id, |
| 97 | sizeof(dso->build_id), | 97 | sizeof(dso->build_id), |
| 98 | build_id_hex); | 98 | build_id_hex); |
| 99 | snprintf(file, size, | 99 | snprintf(filename, size, |
| 100 | "%s/usr/lib/debug/.build-id/%.2s/%s.debug", | 100 | "%s/usr/lib/debug/.build-id/%.2s/%s.debug", |
| 101 | symbol_conf.symfs, build_id_hex, build_id_hex + 2); | 101 | symbol_conf.symfs, build_id_hex, build_id_hex + 2); |
| 102 | break; | 102 | break; |
| @@ -104,23 +104,23 @@ int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type, | |||
| 104 | case DSO_BINARY_TYPE__VMLINUX: | 104 | case DSO_BINARY_TYPE__VMLINUX: |
| 105 | case DSO_BINARY_TYPE__GUEST_VMLINUX: | 105 | case DSO_BINARY_TYPE__GUEST_VMLINUX: |
| 106 | case DSO_BINARY_TYPE__SYSTEM_PATH_DSO: | 106 | case DSO_BINARY_TYPE__SYSTEM_PATH_DSO: |
| 107 | snprintf(file, size, "%s%s", | 107 | snprintf(filename, size, "%s%s", |
| 108 | symbol_conf.symfs, dso->long_name); | 108 | symbol_conf.symfs, dso->long_name); |
| 109 | break; | 109 | break; |
| 110 | 110 | ||
| 111 | case DSO_BINARY_TYPE__GUEST_KMODULE: | 111 | case DSO_BINARY_TYPE__GUEST_KMODULE: |
| 112 | snprintf(file, size, "%s%s%s", symbol_conf.symfs, | 112 | snprintf(filename, size, "%s%s%s", symbol_conf.symfs, |
| 113 | root_dir, dso->long_name); | 113 | root_dir, dso->long_name); |
| 114 | break; | 114 | break; |
| 115 | 115 | ||
| 116 | case DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE: | 116 | case DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE: |
| 117 | snprintf(file, size, "%s%s", symbol_conf.symfs, | 117 | snprintf(filename, size, "%s%s", symbol_conf.symfs, |
| 118 | dso->long_name); | 118 | dso->long_name); |
| 119 | break; | 119 | break; |
| 120 | 120 | ||
| 121 | case DSO_BINARY_TYPE__KCORE: | 121 | case DSO_BINARY_TYPE__KCORE: |
| 122 | case DSO_BINARY_TYPE__GUEST_KCORE: | 122 | case DSO_BINARY_TYPE__GUEST_KCORE: |
| 123 | snprintf(file, size, "%s", dso->long_name); | 123 | snprintf(filename, size, "%s", dso->long_name); |
| 124 | break; | 124 | break; |
| 125 | 125 | ||
| 126 | default: | 126 | default: |
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index 99f3c647d683..e1cc50698137 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h | |||
| @@ -129,7 +129,7 @@ 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__binary_type_file(const struct dso *dso, enum dso_binary_type type, |
| 132 | char *root_dir, char *file, 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, |
