I use Facebook's Infer to check my android code
infer -- ./gradlew build
after 8 minutes
Fatal error: exception Sys_error("/Users/lm/project/android_workplace/******/app/build/intermediates/exploded-aar/com.mogujie/user/1.2.17/jars/classes.jar: Too many open files")
Traceback (most recent call last):
File "/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/infer", line 180, in <module>
main()
File "/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/infer", line 144, in main
capture_exitcode = imported_module.gen_instance(args, cmd).capture()
File "/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/../lib/capture/gradle.py", line 83, in capture
return util.run_commands(cmds)
File "/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/../lib/capture/util.py", line 40, in run_commands
if not cmd.start():
File "/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/inferlib.py", line 692, in start
if self.capture() == os.EX_OK:
File "/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/inferlib.py", line 478, in capture
return self.run_infer_frontend()
File "/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/inferlib.py", line 469, in run_infer_frontend
self.args.analyzer
File "/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/inferlib.py", line 385, in run_command
raise e
subprocess.CalledProcessError: Command '[u'/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/InferJava', u'-project_root', '/Users/lm/project/android_workplace/Minicooper4android', u'-results_dir', u'/Users/lm/project/android_workplace/Minicooper4android/infer-out', u'-verbose_out', '/var/folders/2r/7hc18jz1091_jg7_8jcnqlhr0000gn/T/javac_qWbfkP.out', u'-models', u'/Users/lm/project/infer_workplace/infer-osx-v0.4.0/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2
From http://fbinfer.com/support
The maximum number of files a program can simultaneously hold open is a bit low on MacOs. You can increase the limit by running these commands for example:
sysctl -w kern.maxfiles=20480
sysctl -w kern.maxfilesperproc=22480
ulimit -S -n 2048
Related
I want to capture a system trace, using the systrace tool.
I have this device (not-rooted) :
Pixi 4.5 Alcatel
Android 6.0 (API 23)
And I use Android Studio 4.2.2 and I have installed Python 2.7.18, as required (the version 3+ does not match).
Here is the command line to view the list of available categories on my device :
C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace>C:\Users\myUser\AppData\Local\Programs\Python27\python systrace.py -l
I chose this command with the -l option for my here question because it results (see below) in the expected list plus an extra set of lines which suggests that the error CommandFailedError is related to an exception on HasRoot :
gfx - Graphics
input - Input
view - View System
webview - WebView
wm - Window Manager
am - Activity Manager
sm - Sync Manager
audio - Audio
video - Video
camera - Camera
hal - Hardware Modules
app - Application
res - Resource Loading
dalvik - Dalvik VM
rs - RenderScript
hwui - HWUI
perf - Performance
bionic - Bionic C Library
power - Power Management
sched - CPU Scheduling
freq - CPU Frequency
idle - CPU Idle
load - CPU Load
CRITICAL:root:(TimeoutThread-1-for-MainThread) Exception on HasRoot(myDeviceId, retries=3, timeout=30), attempt 1 of 4: CommandFailedError("(device: myDeviceId) one line of output was expected, but got: ['uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcar
d_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats) context=u:r:shell:s0', '']",)
CRITICAL:root:(TimeoutThread-2-for-MainThread) Exception on HasRoot(myDeviceId, retries=3, timeout=30), attempt 2 of 4: CommandFailedError("(device: myDeviceId) one line of output was expected, but got: ['uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcar
d_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats) context=u:r:shell:s0', '']",)
CRITICAL:root:(TimeoutThread-3-for-MainThread) Exception on HasRoot(myDeviceId, retries=3, timeout=30), attempt 3 of 4: CommandFailedError("(device: myDeviceId) one line of output was expected, but got: ['uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcar
d_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats) context=u:r:shell:s0', '']",)
Traceback (most recent call last):
File "systrace.py", line 49, in <module>
sys.exit(run_systrace.main())
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 205, in main
main_impl(sys.argv)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 177, in main_impl
atrace_agent.list_categories(options)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\tracing_agents\atrace_agent.py", line 65, in list_categories
if not devutils.HasRoot():
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\decorators.py", line 63, in timeout_r
etry_wrapper
impl, timeout, retries, desc=desc, retry_if_func=retry_if_func)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\timeout_retry.py", line 164, in Run
error_log_func=error_log_func)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\reraiser_thread.py", line 199, in JoinA
ll
self._JoinAll(watcher, timeout)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\reraiser_thread.py", line 171, in _Join
All
thread.ReraiseIfException()
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\reraiser_thread.py", line 94, in run
self._ret = self._func(*self._args, **self._kwargs)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\timeout_retry.py", line 156, in <lambda
>
lambda: func(*args, **kwargs), name=thread_name)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\decorators.py", line 51, in impl
return f(*args, **kwargs)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\device_utils.py", line 562, in HasRoo
t
output = self.RunShellCommand(['id'], single_line=True)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\decorators.py", line 56, in timeout_r
etry_wrapper
return impl()
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\decorators.py", line 51, in impl
return f(*args, **kwargs)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\device_utils.py", line 1556, in RunSh
ellCommand
raise device_errors.CommandFailedError(msg % output, str(self))
devil.android.device_errors.CommandFailedError: (device: myDeviceId) one line of output was expected, but got: ['uid=2000(shell) gid=2000(shell) groups=2000(
shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats) context=u:r:shell:s0', '']
By comparison, here is the error CommandFailedError obtained with a command which should generate an html report :
C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace>C:\Users\myUser\AppData\Local\Programs\Python27\python systrace.py
Traceback (most recent call last):
File "systrace.py", line 49, in <module>
sys.exit(run_systrace.main())
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 205, in main
main_impl(sys.argv)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 185, in main_impl
controller.StartTracing()
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\systrace_runner.py", line 46, in StartTracing
self._tracing_controller.StartTracing()
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\tracing_controller.py", line 156, in StartTracing
timeout=self._controller_config.timeout):
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\common\py_utils\py_utils\__init__.py", line 103, in RunWithTimeout
return timeout_retry.Run(func, timeout, 0, args=args)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\timeout_retry.py", line 164, in Run
error_log_func=error_log_func)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\reraiser_thread.py", line 199, in JoinA
ll
self._JoinAll(watcher, timeout)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\reraiser_thread.py", line 171, in _Join
All
thread.ReraiseIfException()
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\reraiser_thread.py", line 94, in run
self._ret = self._func(*self._args, **self._kwargs)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\utils\timeout_retry.py", line 156, in <lambda
>
lambda: func(*args, **kwargs), name=thread_name)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\tracing_agents\android_cgroup_agent.py", line 59, in StartAgent
Tracing
if not self._device_utils.HasRoot():
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\decorators.py", line 56, in timeout_r
etry_wrapper
return impl()
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\decorators.py", line 51, in impl
return f(*args, **kwargs)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\device_utils.py", line 562, in HasRoo
t
output = self.RunShellCommand(['id'], single_line=True)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\decorators.py", line 56, in timeout_r
etry_wrapper
return impl()
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\decorators.py", line 51, in impl
return f(*args, **kwargs)
File "C:\Users\myUser\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\android\device_utils.py", line 1556, in RunSh
ellCommand
raise device_errors.CommandFailedError(msg % output, str(self))
devil.android.device_errors.CommandFailedError: (device: deviceId) one line of output was expected, but got: ['uid=2000(shell) gid=2000(shell) groups=2000(
shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats) context=u:r:shell:s0', '']
I am sure that there is a proper way to run systrace on an old unrooted device but I just didn't find it.
Does anyone have a clue or a solution? Thanks.
EDIT :
Thanks a lot for your analysis and your answer #yi-yang.
As you recommended, I set single_line to False in the RunShellCommand call. Furthermore, I also modified the return line, which gives the final code in the device_utils.py file, lines 562-563 :
output = self.RunShellCommand(['id'], single_line=False)
return output[0].startswith('uid=0(root)')
Note that I select the first line because there are still two lines, which means that some optional newline at the end needs to be stripped somehow...
Now it works but only for a few categories, as in the following example:
systrace.py -o mynewtrace.html perf idle load
However, for any atrace data, including the very helpful "sched" (see atrace_agent.py), the cpu profiling not possible, as shown by the following messages:
Warning: Only 2 of 3 tracing agents started.
IOError('Unable to get atrace data. Did you forget adb root?')
So the root privileges do matter, despite what the file comments (l. 556-558) claim :-(.
I guess rooting is a must for the full experience!
I try to do a systrace of a react native app running on android:
/home/a/Android/Sdk/platform-tools/systrace/systrace.py --time=5 -o trace.html sched gfx view -a com.mypackage
This is the error I get, but trace_markers seem to be defect:
These categories are unavailable: sched
Starting tracing (5 seconds)
Tracing completed. Collecting output...
/system/bin/sh: <stdin>[2]: can't create /sys/kernel/debug/tracing/trace_marker: No such file or directory
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 194, in _collect_and_preprocess
trace_data = self._collect_trace_data()
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 259, in _collect_trace_data
raise IOError('Unable to get atrace data. Did you forget adb root?')
IOError: Unable to get atrace data. Did you forget adb root?
Outputting Systrace results...
Tracing complete, writing results
Traceback (most recent call last):
File "/home/r/Android/Sdk/platform-tools/systrace/systrace.py", line 49, in <module>
sys.exit(run_systrace.main())
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 194, in main
main_impl(sys.argv)
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 191, in main_impl
controller.OutputSystraceResults(write_json=options.write_json)
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/systrace_runner.py", line 67, in OutputSystraceResults
self._out_filename)
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 70, in GenerateHTMLOutput
html_file.write(_ConvertToHtmlString(result.raw_data))
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 92, in _ConvertToHtmlString
raise ValueError('Invalid trace result format for HTML output')
ValueError: Invalid trace result format for HTML output
How could I fix this?
React: 16.0.0-alpha.12
React Native: 0.48.2
Android: 7.1.2 (LineageOS 14.1-20170607)
The problem is:
IOError: Unable to get atrace data. Did you forget adb root?
Try this cmd:
python systrace.py -a com.example.myapp -b 16384 \
-o my_systrace_report.html sched freq idle am wm gfx view binder_driver hal \
dalvik camera input res
When I try to run Systrace, i get this stacktrace:
python systrace.py --app=com.mydebug.app view gfx sched dalvik wm
Starting tracing (stop with enter)
Tracing completed. Collecting output...
CRITICAL:root:(TimeoutThread-1-for-Thread-1) Exception on ReadFile(1829d365, /sys/kernel/debug/tracing/tracing_on, retries=3, timeout=30), attempt 1 of 4: AdbCommandFailedError("(device: 1829d365) adb pull /sys/kernel/debug/tracing/tracing_on /tmp/tmpyO_hQZ/tmp_ReadFileWithPull: failed with exit status 1 and output:\n- adb: error: failed to copy '/sys/kernel/debug/tracing/tracing_on' to '/tmp/tmpyO_hQZ/tmp_ReadFileWithPull': remote Permission denied\n",)
CRITICAL:root:(TimeoutThread-2-for-Thread-1) Exception on ReadFile(1829d365, /sys/kernel/debug/tracing/tracing_on, retries=3, timeout=30), attempt 2 of 4: AdbCommandFailedError("(device: 1829d365) adb pull /sys/kernel/debug/tracing/tracing_on /tmp/tmpVakBVH/tmp_ReadFileWithPull: failed with exit status 1 and output:\n- adb: error: failed to copy '/sys/kernel/debug/tracing/tracing_on' to '/tmp/tmpVakBVH/tmp_ReadFileWithPull': remote Permission denied\n",)
CRITICAL:root:(TimeoutThread-3-for-Thread-1) Exception on ReadFile(1829d365, /sys/kernel/debug/tracing/tracing_on, retries=3, timeout=30), attempt 3 of 4: AdbCommandFailedError("(device: 1829d365) adb pull /sys/kernel/debug/tracing/tracing_on /tmp/tmp_IoryO/tmp_ReadFileWithPull: failed with exit status 1 and output:\n- adb: error: failed to copy '/sys/kernel/debug/tracing/tracing_on' to '/tmp/tmp_IoryO/tmp_ReadFileWithPull': remote Permission denied\n",)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 194, in _collect_and_preprocess
trace_data = self._collect_trace_data()
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 261, in _collect_trace_data
self._stop_trace()
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 244, in _stop_trace
if int(self._device_utils.ReadFile(is_trace_enabled_file)):
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 57, in timeout_retry_wrapper
retry_if_func=retry_if_func)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/timeout_retry.py", line 159, in Run
error_log_func=error_log_func)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/reraiser_thread.py", line 186, in JoinAll
self._JoinAll(watcher, timeout)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/reraiser_thread.py", line 158, in _JoinAll
thread.ReraiseIfException()
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/reraiser_thread.py", line 81, in run
self._ret = self._func(*self._args, **self._kwargs)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/timeout_retry.py", line 152, in <lambda>
child_thread = reraiser_thread.ReraiserThread(lambda: func(*args, **kwargs),
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 47, in impl
return f(*args, **kwargs)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 1658, in ReadFile
return self._ReadFileWithPull(device_path)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 1610, in _ReadFileWithPull
self.adb.Pull(device_path, host_temp_path)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/sdk/adb_wrapper.py", line 454, in Pull
self._RunDeviceAdbCmd(cmd, timeout, retries)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/sdk/adb_wrapper.py", line 282, in _RunDeviceAdbCmd
check_error=check_error)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 51, in timeout_retry_wrapper
return impl()
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 47, in impl
return f(*args, **kwargs)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/sdk/adb_wrapper.py", line 258, in _RunAdbCmd
args, output, status, device_serial)
AdbCommandFailedError: (device: 1829d365) adb pull /sys/kernel/debug/tracing/tracing_on /tmp/tmpw7qK2c/tmp_ReadFileWithPull: failed with exit status 1 and output:
- adb: error: failed to copy '/sys/kernel/debug/tracing/tracing_on' to '/tmp/tmpw7qK2c/tmp_ReadFileWithPull': remote Permission denied
Outputting Systrace results...
Tracing complete, writing results
Traceback (most recent call last):
File "systrace.py", line 49, in <module>
sys.exit(run_systrace.main())
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 194, in main
main_impl(sys.argv)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 191, in main_impl
controller.OutputSystraceResults(write_json=options.write_json)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/systrace_runner.py", line 67, in OutputSystraceResults
self._out_filename)
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 70, in GenerateHTMLOutput
html_file.write(_ConvertToHtmlString(result.raw_data))
File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 92, in _ConvertToHtmlString
raise ValueError('Invalid trace result format for HTML output')
ValueError: Invalid trace result format for HTML output
I can adb pull files off my sdcard though. I've tried running systrace from my android-sdk platform-tools, and I've tried running systrace cloned from the catapult git repo but I get the same error. Is it not possible to run systrace on production devices??
What's peculiar is that I can successfully run systrace using the Android Device Monitor, but I don't like how it forces me to put in a time unlike the command line tool. Also, no matter what time and buffer size I choose when running systrace through the Device Monitor it always records for 5 seconds only.
I'm trying to work out the instructions defined in http://www.webrtc.org/native-code/android. After the command "gclient sync" is executed and after hours of downloading, at the end the process failed:
fatal: early EOF
The remote end hung up unexpectedly
fatal: index-pack failed
error: RPC failed; result=56, HTTP code = 200
Traceback (most recent call last):
File "C:\depot_tools\depot_tools\gclient_scm.py", line 924, in _Clone
self._Run(clone_cmd, options, cwd=self._root_dir, retry=True)
File "C:\depot_tools\depot_tools\gclient_scm.py", line 1201, in _Run
gclient_utils.CheckCallAndFilterAndHeader(cmd, env=env, **kwargs)
File "C:\depot_tools\depot_tools\gclient_utils.py", line 293, in CheckCallAndF
ilterAndHeader
return CheckCallAndFilter(args, **kwargs)
File "C:\depot_tools\depot_tools\gclient_utils.py", line 538, in CheckCallAndF
ilter
rv, args, kwargs.get('cwd', None), None, None)
CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=512m clone --no-che
ckout --progress --verbose https://chromium.googlesource.com/chromium/src.git C:
\\webrtc_android\\src\\chromium\\_gclient_src_x3yrqm' returned non-zero exit sta
tus 128 in C:\webrtc_android\src\chromium
----------------------------------------
Traceback (most recent call last):
File "C:\depot_tools\depot_tools\gclient.py", line 2325, in <module>
sys.exit(main(sys.argv[1:]))
File "C:\depot_tools\depot_tools\gclient.py", line 2311, in main
return dispatcher.execute(OptionParser(), argv)
File "C:\depot_tools\depot_tools\subcommand.py", line 252, in execute
return command(parser, args[1:])
File "C:\depot_tools\depot_tools\gclient.py", line 2066, in CMDsync
ret = client.RunOnDeps('update', args)
File "C:\depot_tools\depot_tools\gclient.py", line 1523, in RunOnDeps
work_queue.flush(revision_overrides, command, args, options=self._options)
File "C:\depot_tools\depot_tools\gclient_utils.py", line 1024, in run
self.item.run(*self.args, **self.kwargs)
File "C:\depot_tools\depot_tools\gclient.py", line 834, in run
file_list)
File "C:\depot_tools\depot_tools\gclient_scm.py", line 166, in RunCommand
return getattr(self, command)(options, args, file_list)
File "C:\depot_tools\depot_tools\gclient_scm.py", line 418, in update
self._Clone(revision, url, options)
File "C:\depot_tools\depot_tools\gclient_scm.py", line 932, in _Clone
if os.listdir(tmp_dir):
WindowsError: [Error 3] The system cannot find the path specified: 'C:\\webrtc_a
ndroid\\src\\chromium\\_gclient_src_x3yrqm/*.*'
Error: Command 'C:\\depot_tools\\depot_tools\\python276_bin\\python.exe -u src/s
ync_chromium.py --target-revision 47ce5feb1d13ce889da15f76f063a7978a0b5c37' retu
rned non-zero exit status 1 in C:\webrtc_android
Hook ''C:\depot_tools\depot_tools\python276_bin\python.exe' -u src/sync_chromium
.py --target-revision 47ce5feb1d13ce889da15f76f063a7978a0b5c37' took 77717.11 se
cs
Does this has to do with the fact that I'am trying to execute it on Windows?
Independently of your error, you will not be able to fetch and compile code for android under windows. You need to be on the right linux distribution.
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
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"