mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 10:10:46 +00:00
module/systrace: Fix platform_tools use
platform_tools is only updated after the very first connection to the target, and it will be None until then. As I understand it, using `from devlib.utils.android import platform_tools` will create a symbol local to the imported systrace module for `platform_tools` that just takes its current value, and it won't be updated when it should be. Changing the `from x import y` statement to a simple `import x` seems to counteract this.
This commit is contained in:
parent
6089eaf40a
commit
75332cf14a
@ -21,7 +21,7 @@ from tempfile import NamedTemporaryFile
|
|||||||
|
|
||||||
from devlib.exception import TargetStableError, HostError
|
from devlib.exception import TargetStableError, HostError
|
||||||
from devlib.trace import TraceCollector
|
from devlib.trace import TraceCollector
|
||||||
from devlib.utils.android import platform_tools
|
import devlib.utils.android
|
||||||
from devlib.utils.misc import memoized
|
from devlib.utils.misc import memoized
|
||||||
|
|
||||||
|
|
||||||
@ -83,6 +83,7 @@ class SystraceCollector(TraceCollector):
|
|||||||
# Try to find a systrace binary
|
# Try to find a systrace binary
|
||||||
self.systrace_binary = None
|
self.systrace_binary = None
|
||||||
|
|
||||||
|
platform_tools = devlib.utils.android.platform_tools
|
||||||
systrace_binary_path = os.path.join(platform_tools, 'systrace', 'systrace.py')
|
systrace_binary_path = os.path.join(platform_tools, 'systrace', 'systrace.py')
|
||||||
if not os.path.isfile(systrace_binary_path):
|
if not os.path.isfile(systrace_binary_path):
|
||||||
raise HostError('Could not find any systrace binary under {}'.format(platform_tools))
|
raise HostError('Could not find any systrace binary under {}'.format(platform_tools))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user