Commit 805b151a1afd24414706a7f6ae275fbb9649be74

Authored by Kim Phillips
Committed by Arnaldo Carvalho de Melo
1 parent d1f7b0234e

perf tests kmod-path: Don't fail if compressed modules aren't supported

__kmod_path__parse() uses is_supported_compression() to determine and
parse out compressed module file extensions.  On systems without zlib,
this test fails and __kmod_path__parse() continues to strcmp "ko" with
"gz".  Don't do this on those systems.

Signed-off-by: Kim Phillips <kim.phillips@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 3c8a67f50a1e ("perf tools: Add kmod_path__parse function")
Link: http://lkml.kernel.org/r/20170503131402.c66e314460026c80cd787b34@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

tools/perf/tests/kmod-path.c
... ... @@ -61,6 +61,7 @@
61 61 M("/xxxx/xxxx/x-x.ko", PERF_RECORD_MISC_KERNEL, true);
62 62 M("/xxxx/xxxx/x-x.ko", PERF_RECORD_MISC_USER, false);
63 63  
  64 +#ifdef HAVE_ZLIB_SUPPORT
64 65 /* path alloc_name alloc_ext kmod comp name ext */
65 66 T("/xxxx/xxxx/x.ko.gz", true , true , true, true, "[x]", "gz");
66 67 T("/xxxx/xxxx/x.ko.gz", false , true , true, true, NULL , "gz");
... ... @@ -96,6 +97,7 @@
96 97 M("x.ko.gz", PERF_RECORD_MISC_CPUMODE_UNKNOWN, true);
97 98 M("x.ko.gz", PERF_RECORD_MISC_KERNEL, true);
98 99 M("x.ko.gz", PERF_RECORD_MISC_USER, false);
  100 +#endif
99 101  
100 102 /* path alloc_name alloc_ext kmod comp name ext */
101 103 T("[test_module]", true , true , true, false, "[test_module]", NULL);