Skip to content

Commit

Permalink
Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/tip/linux-2.6-tip

* 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf symbols: Avoid resolving [kernel.kallsyms] to real path for buildid cache
  perf symbols: Fix vmlinux path when not using --symfs
  • Loading branch information
Linus Torvalds committed Mar 10, 2011
2 parents ba3820a + 7ee235e commit d959707
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions tools/perf/util/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,15 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
const char *name, bool is_kallsyms)
{
const size_t size = PATH_MAX;
char *realname = realpath(name, NULL),
*filename = malloc(size),
char *realname, *filename = malloc(size),
*linkname = malloc(size), *targetname;
int len, err = -1;

if (is_kallsyms)
realname = (char *)name;
else
realname = realpath(name, NULL);

if (realname == NULL || filename == NULL || linkname == NULL)
goto out_free;

Expand Down Expand Up @@ -306,7 +310,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
if (symlink(targetname, linkname) == 0)
err = 0;
out_free:
free(realname);
if (!is_kallsyms)
free(realname);
free(filename);
free(linkname);
return err;
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ int dso__load_vmlinux(struct dso *self, struct map *map,
int err = -1, fd;
char symfs_vmlinux[PATH_MAX];

snprintf(symfs_vmlinux, sizeof(symfs_vmlinux), "%s/%s",
snprintf(symfs_vmlinux, sizeof(symfs_vmlinux), "%s%s",
symbol_conf.symfs, vmlinux);
fd = open(symfs_vmlinux, O_RDONLY);
if (fd < 0)
Expand Down

0 comments on commit d959707

Please sign in to comment.