[PATCH 1/3] perf tools: Update symtab_type with _KMODULE_COMP

From: Jiri Olsa
Date: Fri Jan 30 2015 - 05:22:55 EST


We are missing update of dso->symtab_type when we actualize
modules paths in map_groups__set_modules_path_dir.

Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/machine.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 1bca3a9f2b16..e750f829e84e 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -869,14 +869,17 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
dso_name[PATH_MAX];
struct map *map;
char *long_name;
+ bool compressed = false;

if (dot == NULL)
continue;

/* On some system, modules are compressed like .ko.gz */
if (is_supported_compression(dot + 1) &&
- is_kmodule_extension(dot - 2))
+ is_kmodule_extension(dot - 2)) {
dot -= 3;
+ compressed = true;
+ }

snprintf(dso_name, sizeof(dso_name), "[%.*s]",
(int)(dot - dent->d_name), dent->d_name);
@@ -894,6 +897,10 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
}
dso__set_long_name(map->dso, long_name, true);
dso__kernel_module_get_build_id(map->dso, "");
+
+ /* _KMODULE_COMP should be next to _KMODULE */
+ if (compressed)
+ map->dso->symtab_type++;
}
}

--
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/