perf scripts python: exported-sql-viewer.py: Fall back to /usr/local/lib/libxed.so
authorAdrian Hunter <adrian.hunter@intel.com>
Sun, 4 Nov 2018 15:12:35 +0000 (17:12 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 5 Nov 2018 17:51:31 +0000 (14:51 -0300)
Fall back to /usr/local/lib/libxed.so to cater for distributions that do
not have /usr/local/lib in the library path by default.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20181104151238.15947-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/scripts/python/exported-sql-viewer.py

index 24cb0bd..20cc8e7 100755 (executable)
@@ -1929,7 +1929,12 @@ class XEDInstruction():
 class LibXED():
 
        def __init__(self):
-               self.libxed = CDLL("libxed.so")
+               try:
+                       self.libxed = CDLL("libxed.so")
+               except:
+                       self.libxed = None
+               if not self.libxed:
+                       self.libxed = CDLL("/usr/local/lib/libxed.so")
 
                self.xed_tables_init = self.libxed.xed_tables_init
                self.xed_tables_init.restype = None