perf symbols: Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE
Instead of using a raw string, use DSO__NAME_KALLSYMS and DSO__NAME_KCORE macros for kallsyms and kcore. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Cc: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Hemant Kumar <hemant@linux.vnet.ibm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20160515031935.4017.50971.stgit@devbox Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
a1f3d56761
commit
0a77582f04
@@ -1662,8 +1662,8 @@ static char *dso__find_kallsyms(struct dso *dso, struct map *map)
|
||||
|
||||
build_id__sprintf(dso->build_id, sizeof(dso->build_id), sbuild_id);
|
||||
|
||||
scnprintf(path, sizeof(path), "%s/[kernel.kcore]/%s", buildid_dir,
|
||||
sbuild_id);
|
||||
scnprintf(path, sizeof(path), "%s/%s/%s", buildid_dir,
|
||||
DSO__NAME_KCORE, sbuild_id);
|
||||
|
||||
/* Use /proc/kallsyms if possible */
|
||||
if (is_host) {
|
||||
@@ -1699,8 +1699,8 @@ static char *dso__find_kallsyms(struct dso *dso, struct map *map)
|
||||
if (!find_matching_kcore(map, path, sizeof(path)))
|
||||
return strdup(path);
|
||||
|
||||
scnprintf(path, sizeof(path), "%s/[kernel.kallsyms]/%s",
|
||||
buildid_dir, sbuild_id);
|
||||
scnprintf(path, sizeof(path), "%s/%s/%s",
|
||||
buildid_dir, DSO__NAME_KALLSYMS, sbuild_id);
|
||||
|
||||
if (access(path, F_OK)) {
|
||||
pr_err("No kallsyms or vmlinux with build-id %s was found\n",
|
||||
@@ -1769,7 +1769,7 @@ do_kallsyms:
|
||||
|
||||
if (err > 0 && !dso__is_kcore(dso)) {
|
||||
dso->binary_type = DSO_BINARY_TYPE__KALLSYMS;
|
||||
dso__set_long_name(dso, "[kernel.kallsyms]", false);
|
||||
dso__set_long_name(dso, DSO__NAME_KALLSYMS, false);
|
||||
map__fixup_start(map);
|
||||
map__fixup_end(map);
|
||||
}
|
||||
|
Reference in New Issue
Block a user