aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/dso.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 7a7c54b42b41..f37548322c9d 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -178,19 +178,15 @@ bool is_kmodule_extension(const char *ext)
178 178
179bool is_kernel_module(const char *pathname, bool *compressed) 179bool is_kernel_module(const char *pathname, bool *compressed)
180{ 180{
181 const char *ext = strrchr(pathname, '.'); 181 struct kmod_path m;
182 182
183 if (ext == NULL) 183 if (kmod_path__parse(&m, pathname))
184 return false; 184 return NULL;
185 185
186 if (is_supported_compression(ext + 1)) { 186 if (compressed)
187 if (compressed) 187 *compressed = m.comp;
188 *compressed = true;
189 ext -= 3;
190 } else if (compressed)
191 *compressed = false;
192 188
193 return is_kmodule_extension(ext + 1); 189 return m.kmod;
194} 190}
195 191
196bool decompress_to_file(const char *ext, const char *filename, int output_fd) 192bool decompress_to_file(const char *ext, const char *filename, int output_fd)