diff options
author | Andy Whitcroft <apw@canonical.com> | 2010-11-12 17:04:41 +0000 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-03-16 15:49:25 -0600 |
commit | 6723c8bb0ddec86314a80bdae99ef55063b65caa (patch) | |
tree | 72ef55edacca0b94bafcd6dc58b37e10e323665d /tools | |
parent | 53e6fa470c49f5f837bc3f140dd70d9142c90d3f (diff) |
Revert "perf probe: Add kernel source path option"
This reverts commit 3543e22c53d289293ab20c20fed16cad57320fb9.
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/probe-finder.c | 58 |
1 files changed, 3 insertions, 55 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index ef0f20cfa8a4..ab83b6ac5d65 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -57,55 +57,6 @@ static int strtailcmp(const char *s1, const char *s2) return 0; } -/* - * Find a src file from a DWARF tag path. Prepend optional source path prefix - * and chop off leading directories that do not exist. Result is passed back as - * a newly allocated path on success. - * Return 0 if file was found and readable, -errno otherwise. - */ -static int get_real_path(const char *raw_path, char **new_path) -{ - if (!symbol_conf.source_prefix) { - if (access(raw_path, R_OK) == 0) { - *new_path = strdup(raw_path); - return 0; - } else - return -errno; - } - - *new_path = malloc((strlen(symbol_conf.source_prefix) + - strlen(raw_path) + 2)); - if (!*new_path) - return -ENOMEM; - - for (;;) { - sprintf(*new_path, "%s/%s", symbol_conf.source_prefix, - raw_path); - - if (access(*new_path, R_OK) == 0) - return 0; - - switch (errno) { - case ENAMETOOLONG: - case ENOENT: - case EROFS: - case EFAULT: - raw_path = strchr(++raw_path, '/'); - if (!raw_path) { - free(*new_path); - *new_path = NULL; - return -ENOENT; - } - continue; - - default: - free(*new_path); - *new_path = NULL; - return -errno; - } - } -} - /* Line number list operations */ /* Add a line to line number list */ @@ -1685,13 +1636,10 @@ static int line_range_add_line(const char *src, unsigned int lineno, struct line_range *lr) { /* Copy source path */ - int ret; - - /* Copy real path */ if (!lr->path) { - ret = get_real_path(src, &lr->path); - if (ret != 0) - return ret; + lr->path = strdup(src); + if (lr->path == NULL) + return -ENOMEM; } return line_list__add_line(&lr->line_list, lineno); } |