summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/machine.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-05-01 08:24:39 +0200
committerIngo Molnar <mingo@kernel.org>2014-05-01 08:24:39 +0200
commitaeffe2abc894b585acbe0923c0d4f21b4c5c1035 (patch)
treead712872dba8b8b1aa159fdb0f6dc7cc0ab5f9c6 /tools/perf/util/machine.c
parent201131998fbf074b03679afedcc29948e63331ef (diff)
parent399f0c220a0ee97a5a9ea1a699a58fe2aacf2983 (diff)
downloadop-kernel-dev-aeffe2abc894b585acbe0923c0d4f21b4c5c1035.zip
op-kernel-dev-aeffe2abc894b585acbe0923c0d4f21b4c5c1035.tar.gz
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/machine.c')
-rw-r--r--tools/perf/util/machine.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 98ec56d..7409ac8 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)
OpenPOWER on IntegriCloud