gpt4 book ai didi

android - systrace:无法创建/sys/kernel/debug/tracing/trace_marker:没有这样的文件或目录

转载 作者:行者123 更新时间:2023-12-02 11:19:34 25 4
gpt4 key购买 nike

我尝试对在 Android 上运行的 React Native 应用程序进行系统跟踪:

/home/a/Android/Sdk/platform-tools/systrace/systrace.py --time=5 -o trace.html sched gfx view -a com.mypackage

这是我得到的错误,但trace_markers似乎有缺陷:

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

我该如何解决这个问题?

  • react :16.0.0-alpha.12
  • React Native:0.48.2
  • Android:7.1.2(LineageOS 14.1-20170607)

最佳答案

问题是:

IOError: Unable to get atrace data. Did you forget adb root?

试试这个命令:

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

关于android - systrace:无法创建/sys/kernel/debug/tracing/trace_marker:没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46449567/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com