3

New to android and wanted to do a little debugging with the systrace tool however I am unable to run the tool on the emulator (tried running the python script with python 2.0.1, 2.7.x, 3.x) as well as using ADT.

However they all produce different errors: Developers | Systrace claims that it requires 2.x so using Python 2.x and executing python command systrace.py --help, I get:

C:\Development\Android\sdk\platform-tools\systrace>python systrace.py --help
Traceback (most recent call last):
  File "systrace.py", line 286, in <module>
    main()
  File "systrace.py", line 60, in main
    device_sdk_version = get_device_sdk_version()
  File "systrace.py", line 44, in get_device_sdk_version
    stderr=subprocess.PIPE)
  File "C:\Reuben\Softwares\Python 2.7.6\Lib\subprocess.py", line 709, in __init__
    errread, errwrite)
  File "C:\Reuben\Softwares\Python 2.7.6\Lib\subprocess.py", line 957, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

C:\Development\Android\sdk\platform-tools\systrace>python systrace.py --help
  File "systrace.py", line 135
    css = '\n'.join(linked_css_tag % (os.path.join(src_dir, f)) for f in css_files)
                                                                  ^
SyntaxError: invalid syntax

But with Admin permission:

C:\Development\Android\sdk\platform-tools\systrace>systrace.py --help
  File "C:\Development\Android\sdk\platform-tools\systrace\systrace.py", line 135
    css = '\n'.join(linked_css_tag % (os.path.join(src_dir, f)) for f in css_files)
                                                                  ^
SyntaxError: invalid syntax

With ADT settings

Snapshot of ADT settings

Error dialog Snapshot of ADT error dialog

Other Relevant Information:

  • Enabled: Android Debugging, Profile GPU rendering
  • Enable OpenGL traces: Systrace (Graphics)
  • Enable traces: Graphics,Input
  • Tried Other solution but got "mount: Device or resource busy"
Community
  • 1
  • 1
reubenjohn
  • 1,351
  • 1
  • 18
  • 43
  • 1
    I can't speak to the Python issues, but the error dialog with the complaint about being unable to open the /sys/kernel/tracing file suggests that your device may not support systrace. – fadden May 15 '14 at 16:32
  • @fadden Granted this may be true but please refer related query. I will try a new ROM, however my current ROM actually does has the option to enable traces in developer options will post my results here – reubenjohn May 15 '14 at 16:43
  • @fadden Yes, it was the JellyBam fault! It does not support systrace, however the Python errors are still a mystery to me – reubenjohn May 15 '14 at 17:33
  • According to the [docs](https://developer.android.com/tools/debugging/systrace.html) `Some types of trace information, specifically disk activity and kernel work queues, require that you have root access to the device.` So one of those errors (the /sys/kernel) bug could be because you are enabling some of the traces that require root. – Max Worg Oct 10 '15 at 01:44

0 Answers0