diff options
author | Ingo Molnar <mingo@kernel.org> | 2014-05-01 08:24:39 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-05-01 08:24:39 +0200 |
commit | aeffe2abc894b585acbe0923c0d4f21b4c5c1035 (patch) | |
tree | ad712872dba8b8b1aa159fdb0f6dc7cc0ab5f9c6 /tools/perf/util | |
parent | Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/... (diff) | |
parent | Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kerne... (diff) | |
download | linux-aeffe2abc894b585acbe0923c0d4f21b4c5c1035.tar.xz linux-aeffe2abc894b585acbe0923c0d4f21b4c5c1035.zip |
Merge branch 'perf/urgent' into perf/core, to resolve conflict
Conflicts:
tools/perf/arch/x86/tests/dwarf-unwind.c
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/machine.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 98ec56dc890b..7409ac8de51c 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -728,7 +728,7 @@ static char *get_kernel_version(const char *root_dir) } static int map_groups__set_modules_path_dir(struct map_groups *mg, - const char *dir_name) + const char *dir_name, int depth) { struct dirent *dent; DIR *dir = opendir(dir_name); @@ -753,7 +753,15 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, !strcmp(dent->d_name, "..")) continue; - ret = map_groups__set_modules_path_dir(mg, path); + /* Do not follow top-level source and build symlinks */ + if (depth == 0) { + if (!strcmp(dent->d_name, "source") || + !strcmp(dent->d_name, "build")) + continue; + } + + ret = map_groups__set_modules_path_dir(mg, path, + depth + 1); if (ret < 0) goto out; } else { @@ -797,11 +805,11 @@ static int machine__set_modules_path(struct machine *machine) if (!version) return -1; - snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s/kernel", + snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s", machine->root_dir, version); free(version); - return map_groups__set_modules_path_dir(&machine->kmaps, modules_path); + return map_groups__set_modules_path_dir(&machine->kmaps, modules_path, 0); } static int machine__create_module(void *arg, const char *name, u64 start) |