Merge pull request #52 from petterreinholdtsen/load-from-pkglib

Look for libcoz.so in the /usr/lib/coz-profiler/ location first.
This commit is contained in:
Charlie Curtsinger 2016-07-14 11:07:14 -05:00 committed by GitHub
commit 669106b3ea

7
coz
View File

@ -39,8 +39,11 @@ def _coz_run(args):
sys.exit(1)
env = copy.deepcopy(os.environ)
coz_prefix = dirname(realpath(sys.argv[0]))
coz_runtime = coz_prefix + path_sep + 'libcoz' + path_sep + 'libcoz.so'
if os.path.exists('/usr/lib/coz-profiler/libcoz.so'):
coz_runtime = '/usr/lib/coz-profiler/libcoz.so'
else:
coz_prefix = dirname(realpath(sys.argv[0]))
coz_runtime = coz_prefix + path_sep + 'libcoz' + path_sep + 'libcoz.so'
if 'LD_PRELOAD' in env:
env['LD_PRELOAD'] += ':' + coz_runtime