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>
This commit is contained in:
parent
3344996e4f
commit
7d2a5122ca
@ -29,7 +29,7 @@ char dso__symtab_origin(const struct dso *dso)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type,
|
int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type,
|
||||||
char *root_dir, char *file, size_t size)
|
char *root_dir, char *filename, size_t size)
|
||||||
{
|
{
|
||||||
char build_id_hex[BUILD_ID_SIZE * 2 + 1];
|
char build_id_hex[BUILD_ID_SIZE * 2 + 1];
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -38,30 +38,30 @@ int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type,
|
|||||||
case DSO_BINARY_TYPE__DEBUGLINK: {
|
case DSO_BINARY_TYPE__DEBUGLINK: {
|
||||||
char *debuglink;
|
char *debuglink;
|
||||||
|
|
||||||
strncpy(file, dso->long_name, size);
|
strncpy(filename, dso->long_name, size);
|
||||||
debuglink = file + dso->long_name_len;
|
debuglink = filename + dso->long_name_len;
|
||||||
while (debuglink != file && *debuglink != '/')
|
while (debuglink != filename && *debuglink != '/')
|
||||||
debuglink--;
|
debuglink--;
|
||||||
if (*debuglink == '/')
|
if (*debuglink == '/')
|
||||||
debuglink++;
|
debuglink++;
|
||||||
filename__read_debuglink(dso->long_name, debuglink,
|
filename__read_debuglink(dso->long_name, debuglink,
|
||||||
size - (debuglink - file));
|
size - (debuglink - filename));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DSO_BINARY_TYPE__BUILD_ID_CACHE:
|
case DSO_BINARY_TYPE__BUILD_ID_CACHE:
|
||||||
/* skip the locally configured cache if a symfs is given */
|
/* skip the locally configured cache if a symfs is given */
|
||||||
if (symbol_conf.symfs[0] ||
|
if (symbol_conf.symfs[0] ||
|
||||||
(dso__build_id_filename(dso, file, size) == NULL))
|
(dso__build_id_filename(dso, filename, size) == NULL))
|
||||||
ret = -1;
|
ret = -1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSO_BINARY_TYPE__FEDORA_DEBUGINFO:
|
case DSO_BINARY_TYPE__FEDORA_DEBUGINFO:
|
||||||
snprintf(file, size, "%s/usr/lib/debug%s.debug",
|
snprintf(filename, size, "%s/usr/lib/debug%s.debug",
|
||||||
symbol_conf.symfs, dso->long_name);
|
symbol_conf.symfs, dso->long_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSO_BINARY_TYPE__UBUNTU_DEBUGINFO:
|
case DSO_BINARY_TYPE__UBUNTU_DEBUGINFO:
|
||||||
snprintf(file, size, "%s/usr/lib/debug%s",
|
snprintf(filename, size, "%s/usr/lib/debug%s",
|
||||||
symbol_conf.symfs, dso->long_name);
|
symbol_conf.symfs, dso->long_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -75,14 +75,14 @@ int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type,
|
|||||||
while (last_slash != dso->long_name && *last_slash != '/')
|
while (last_slash != dso->long_name && *last_slash != '/')
|
||||||
last_slash--;
|
last_slash--;
|
||||||
|
|
||||||
len = scnprintf(file, size, "%s", symbol_conf.symfs);
|
len = scnprintf(filename, size, "%s", symbol_conf.symfs);
|
||||||
dir_size = last_slash - dso->long_name + 2;
|
dir_size = last_slash - dso->long_name + 2;
|
||||||
if (dir_size > (size - len)) {
|
if (dir_size > (size - len)) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
len += scnprintf(file + len, dir_size, "%s", dso->long_name);
|
len += scnprintf(filename + len, dir_size, "%s", dso->long_name);
|
||||||
len += scnprintf(file + len , size - len, ".debug%s",
|
len += scnprintf(filename + len , size - len, ".debug%s",
|
||||||
last_slash);
|
last_slash);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type,
|
|||||||
build_id__sprintf(dso->build_id,
|
build_id__sprintf(dso->build_id,
|
||||||
sizeof(dso->build_id),
|
sizeof(dso->build_id),
|
||||||
build_id_hex);
|
build_id_hex);
|
||||||
snprintf(file, size,
|
snprintf(filename, size,
|
||||||
"%s/usr/lib/debug/.build-id/%.2s/%s.debug",
|
"%s/usr/lib/debug/.build-id/%.2s/%s.debug",
|
||||||
symbol_conf.symfs, build_id_hex, build_id_hex + 2);
|
symbol_conf.symfs, build_id_hex, build_id_hex + 2);
|
||||||
break;
|
break;
|
||||||
@ -104,23 +104,23 @@ int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type,
|
|||||||
case DSO_BINARY_TYPE__VMLINUX:
|
case DSO_BINARY_TYPE__VMLINUX:
|
||||||
case DSO_BINARY_TYPE__GUEST_VMLINUX:
|
case DSO_BINARY_TYPE__GUEST_VMLINUX:
|
||||||
case DSO_BINARY_TYPE__SYSTEM_PATH_DSO:
|
case DSO_BINARY_TYPE__SYSTEM_PATH_DSO:
|
||||||
snprintf(file, size, "%s%s",
|
snprintf(filename, size, "%s%s",
|
||||||
symbol_conf.symfs, dso->long_name);
|
symbol_conf.symfs, dso->long_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSO_BINARY_TYPE__GUEST_KMODULE:
|
case DSO_BINARY_TYPE__GUEST_KMODULE:
|
||||||
snprintf(file, size, "%s%s%s", symbol_conf.symfs,
|
snprintf(filename, size, "%s%s%s", symbol_conf.symfs,
|
||||||
root_dir, dso->long_name);
|
root_dir, dso->long_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE:
|
case DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE:
|
||||||
snprintf(file, size, "%s%s", symbol_conf.symfs,
|
snprintf(filename, size, "%s%s", symbol_conf.symfs,
|
||||||
dso->long_name);
|
dso->long_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSO_BINARY_TYPE__KCORE:
|
case DSO_BINARY_TYPE__KCORE:
|
||||||
case DSO_BINARY_TYPE__GUEST_KCORE:
|
case DSO_BINARY_TYPE__GUEST_KCORE:
|
||||||
snprintf(file, size, "%s", dso->long_name);
|
snprintf(filename, size, "%s", dso->long_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -129,7 +129,7 @@ int dso__kernel_module_get_build_id(struct dso *dso, const char *root_dir);
|
|||||||
|
|
||||||
char dso__symtab_origin(const struct dso *dso);
|
char dso__symtab_origin(const struct dso *dso);
|
||||||
int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type,
|
int dso__binary_type_file(const struct dso *dso, enum dso_binary_type type,
|
||||||
char *root_dir, char *file, size_t size);
|
char *root_dir, char *filename, size_t size);
|
||||||
|
|
||||||
int dso__data_fd(struct dso *dso, struct machine *machine);
|
int dso__data_fd(struct dso *dso, struct machine *machine);
|
||||||
ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine,
|
ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine,
|
||||||
|
Loading…
Reference in New Issue
Block a user