6

Here's the error message

D:\Programming\Tools\ADT_bundle\sdk\platform-tools\systrace>python systrace.py
Traceback (most recent call last):
  File "systrace.py", line 315, in <module> 
    main()
  File "systrace.py", line 64, in main
    os.execv(legacy_script, sys.argv)
OSError: [Errno 2] No such file or directory

I look into systrace.py, it seems that the legacy_script "systrace-legacy.py" is missing on the file system. I have read several related posts on stackoverflow, and I've already put directory containing adb in the %PATH%. The problem still exists. I'm writting to ask if any way to solve this problem.

Mahendran
  • 2,719
  • 5
  • 28
  • 50
Wei Yang
  • 895
  • 3
  • 15
  • 26

3 Answers3

5

I think is some issue in AOSP You can check this file there: https://android.googlesource.com/platform/external/chromium-trace/+/664f21bcaf14044e5e9b09cb7beb8724d18fb851

you can download from AOSP repository:

git clone https://android.googlesource.com/platform/external/chromium-trace
cd chromium-trace
git checkout 2384642
ls systrace-legacy.py

copy this file to sdk and everything should work

Jacek Marchwicki
  • 1,565
  • 15
  • 17
  • Known issue, will be fixed soon. Downloading the script from AOSP is the recommended workaround. – fadden Jul 25 '13 at 21:50
  • Thanks for your answer Jacek. After copy the files into systrace directory, I got the following error in the same line of code: "OSError: [Errno 8] Exec format error" – Wei Yang Jul 25 '13 at 22:06
  • Do the files look okay? (No brain-damage introduced during download.) – fadden Jul 25 '13 at 22:16
  • The file looks okay. I also use systrace button in eclipse, it throws an exception "Unable to find trace start marker 'TRACE:': error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2)..." I guess it's because something is missing in kernel. I'm using galaxy S3 I747UCDLK3. – Wei Yang Jul 26 '13 at 06:19
  • I've seen similar complaints about the S3, e.g. http://stackoverflow.com/questions/17207841/running-android-systrace-on-device – fadden Jul 28 '13 at 21:03
  • I followed the instructions by Jacek and ended up having the same problem as Wei Young: "OSError: [Errno 8] Exec format error". – Bartek Jul 31 '13 at 11:42
5

This was fixed in SDK tools release 22.0.5... sort of.

The systrace-legacy.py script was added to the platform-tools directory rather than the tools directory, because the script is (gradually) being moved there. So if you continue to follow the old instructions, you will still have the same problem. If you run the script from the platform-tools/systrace directory instead, it should now work.

You can also run it from the Eclipse ADT plugin.

fadden
  • 51,356
  • 5
  • 116
  • 166
  • 3
    Go to /platform-tools/systrace instead of /tools/systrace first. $ chmod +x ./systrace.py If you see - OSError: [Errno 13] Permission denied $chmod +x ./systrace-legacy.py Then it worked for me. – Oleksandr Yefremov Aug 08 '13 at 13:39
0

also you can download it at here: https://dl.google.com/android/repository/platform-tools_r33.0.0-darwin.zip

and change the rVersion to which one you want in https://developer.android.com/studio/releases/platform-tools:

baiiu
  • 77
  • 5