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.
Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all
Unified · Split
| @@ -1929,7 +1929,12 @@ class XEDInstruction(): · 1928 unmodified lines | ||
| 1929 | 1929 | class LibXED(): |
| 1930 | 1930 | |
| 1931 | 1931 | def __init__(self): |
| 1932 | − self.libxed = CDLL("libxed.so") | |
| 1932 | + try: | |
| 1933 | + self.libxed = CDLL("libxed.so") | |
| 1934 | + except: | |
| 1935 | + self.libxed = None | |
| 1936 | + if not self.libxed: | |
| 1937 | + self.libxed = CDLL("/usr/local/lib/libxed.so") | |
| 1933 | 1938 | |
| 1934 | 1939 | self.xed_tables_init = self.libxed.xed_tables_init |
| 1935 | 1940 | self.xed_tables_init.restype = None |