使Systrace可以在Mac上使用4.1.2设备(Make Systrace work with 4.1.2 device on Mac)

编程入门 行业动态 更新时间:2024-10-21 13:42:01
使Systrace可以在Mac上使用4.1.2设备(Make Systrace work with 4.1.2 device on Mac)

我一直在挣扎很长时间才使用systrace。

我的设备运行4.1.2(LT28i),我在Mac上。 我反弹的问题与类似的问题都没有一个明确的答案。

我想让我们说跟踪views和graphics

方法1,eclipse:

错误:

方法2,终端:

$ python systrace.py --cpu-load --time=10 -o mytracefile.html error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_switch/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/power/cpu_frequency/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/power/cpu_idle/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/cpufreq_interactive/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/buffer_size_kb: No such file or directory (2) error opening /sys/kernel/debug/tracing/trace_clock: No such file or directory (2) error opening /sys/kernel/debug/tracing/tracing_on: No such file or directory (2) error: unable to start trace error opening /sys/kernel/debug/tracing/tracing_on: No such file or directory (2) error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_switch/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/power/cpu_frequency/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/trace_clock: No such file or directory (2) unable to start tracing error opening /sys/kernel/debug/tracing/buffer_size_kb: No such file or directory (2) An error occured while capturing the trace. Output file was not written. dionyses-lorentzoss-imac:systrace dionysis_lorentzos$ mount -o rw,remount -t debugfs none /sys/kernel/debug mount: realpath /sys: No such file or directory

我也尝试下面的命令,并得到一个错误,但根据谷歌文档根只需要在一些跟踪。

$ adb root adbd cannot run as root in production builds

如何为视图或图形生成简单的systrace?

在手机中调试是启用的,并且“启用跟踪”(通过命令行或通过手机本身)。

I have been struggling a long time to just use systrace.

My device runs 4.1.2 (LT28i) and I'm on a Mac. I am bouncing SO questions with similar issues none of whom have a clear answer.

I want let's say to trace views and graphics

Method 1, eclipse:

error:

method 2, terminal:

$ python systrace.py --cpu-load --time=10 -o mytracefile.html error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_switch/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/power/cpu_frequency/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/power/cpu_idle/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/cpufreq_interactive/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/buffer_size_kb: No such file or directory (2) error opening /sys/kernel/debug/tracing/trace_clock: No such file or directory (2) error opening /sys/kernel/debug/tracing/tracing_on: No such file or directory (2) error: unable to start trace error opening /sys/kernel/debug/tracing/tracing_on: No such file or directory (2) error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_switch/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/power/cpu_frequency/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/trace_clock: No such file or directory (2) unable to start tracing error opening /sys/kernel/debug/tracing/buffer_size_kb: No such file or directory (2) An error occured while capturing the trace. Output file was not written. dionyses-lorentzoss-imac:systrace dionysis_lorentzos$ mount -o rw,remount -t debugfs none /sys/kernel/debug mount: realpath /sys: No such file or directory

I also try the command below and get an error but according to the google docs root is needed only in some of the tracing.

$ adb root adbd cannot run as root in production builds

How can I generate a simple systrace for views or graphics?

Debugging in phone is ofc enabled and also the "enable tracing" is (either by command line or via the phone itself).

最满意答案

看起来您的手机正在运行不支持systrace的启动(内核)映像。

“错误打开/ sys /内核/调试/跟踪/选项/覆盖:没有这样的文件或目录(2)”

此错误消息意味着adb守护进程(在设备端运行的adb模块)无法在设备的文件系统上找到/ sys / kernel / debug / tracing / options /覆盖 。 systrace通过adb工作,并通过/ sys / kernel / debug / tracing下的sysfs节点与内核通信。 如果这些节点没有出于任何原因暴露在你的手机上,systrace就无法工作。

所以你应该首先使用以下命令在你的设备上获得一个shell

adb外壳

然后浏览以确认/ sys是否存在并且/ sys / kernel / debug / tracing是否存在。

如果他们在那里是极不可能的,你必须调试systrace.py来弄清楚systrace如何认为节点不在那里。 否则,您需要刷新支持systrace的不同引导映像,因为sysfs由内核(主要是编译时的配置)和init.rc控制,这两者都是引导映像的一部分。

刷新不同的引导映像可能涉及解锁设备。 您可能必须去粉丝网站,如xdadeveloper的信息和图像。 另一种选择是下载设备的内核源码,编译内核并自行创建启动映像。 Linux在GPL下,因此你的设备制造商有义务发布他们使用的专用内核的源代码。

It looks like your cellphone is running a boot(kernel) image that does not support systrace.

"error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2)"

This error message means adb daemon (the adb module running on device side) could not find /sys/kernel/debug/tracing/options/overwrite on your device's file system. systrace works over adb and communicates with kernel though sysfs nodes under /sys/kernel/debug/tracing. If these nodes are not exposed on you phone for whatever reason, systrace just will not work.

So you should first get a shell on your device using:

adb shell

Then browse to confirm if /sys exists at all and if /sys/kernel/debug/tracing exists.

If they are there which is extremely unlikely, you have to debug systrace.py to figure out how come systrace think the nodes were not there. Otherwise, you need to flash a different boot image which has systrace support, because sysfs is controlled by kernel(mostly by configurations at compile time) and init.rc , both of which are part of boot image.

Flashing a different boot image might involve unlocking/rooting the device. You probably have to go to fan sites like xdadeveloper for information and image. Another option is to download the source of kernel for your device, compile kernel and make the boot image yourself. Linux is under GPL thus manufacturer of your device is obligated to release the source code of the specialized kernel they use.

更多推荐

本文发布于:2023-08-01 19:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1363689.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:设备   Mac   Systrace   device   work

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!