- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
Android systrace工具,通过ADB调用atrace工具。但是,我不太了解跟踪文件的格式。显然它与 linux ftrace 工具非常相似,但有一些不同。主要区别在于它不使用 System.Map 文件,而是将所有信息包含到跟踪文件中。此外,还有特定于 android 的新 B|E 条目。
Android 源代码中有关于此格式的一些信息:http://androidxref.com/4.1.1/xref/external/chromium-trace/src/tracing/linux_perf_importer.js
但是,在该文档中我们可以读到该格式属于 Linux Perf 工具。我不这么认为,linux perf 作为输出提供了一种非常不同的格式...(除非某些特殊配置处于 Activity 状态...)
我的问题是:有人知道我在哪里可以找到关于使用来自 adb 的 atrace 工具生成的 android 跟踪文件的官方文档吗?
你熟悉这种格式吗?
# tracer: nop
#
# entries-in-buffer/entries-written: 66427/66427 #P:2
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
atrace-1724 [000] d..3 14186.680000: sched_switch: prev_comm=atrace prev_pid=1724 prev_prio=120 prev_state=S ==> next_comm=swapper/0 next_pid=0 next_prio=120
<idle>-0 [000] d.h7 14186.690000: sched_wakeup: comm=tfm_b6bcf800 pid=1714 prio=35 success=1 target_cpu=000
<idle>-0 [000] d..3 14186.690000: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=tfm_b6bcf800 next_pid=1714 next_prio=35
tfm_b6bcf800-1714 [000] d..3 14186.690000: sched_switch: prev_comm=tfm_b6bcf800 prev_pid=1714 prev_prio=35 prev_state=D|W ==> next_comm=swapper/0 next_pid=0 next_prio=120
<idle>-0 [001] d.h3 14186.690000: sched_wakeup: comm=Player Aud Mixe pid=146 prio=35 success=1 target_cpu=001
<idle>-0 [001] d..3 14186.690000: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=Player Aud Mixe next_pid=146 next_prio=35
Player Aud Mixe-146 [001] d..3 14186.690000: sched_switch: prev_comm=Player Aud Mixe prev_pid=146 prev_prio=35 prev_state=D ==> next_comm=swapper/1 next_pid=0 next_prio=120
<idle>-0 [001] d.h3 14186.690000: sched_wakeup: comm=Player Aud Mixe pid=146 prio=35 success=1 target_cpu=001
<idle>-0 [001] d..3 14186.690000: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=Player Aud Mixe next_pid=146 next_prio=35
Player Aud Mixe-146 [001] d..3 14186.690000: sched_switch: prev_comm=Player Aud Mixe prev_pid=146 prev_prio=35 prev_state=S ==> next_comm=swapper/1 next_pid=0 next_prio=120
<idle>-0 [001] d.h3 14186.700000: sched_wakeup: comm=Player Aud Mixe pid=146 prio=35 success=1 target_cpu=001
<idle>-0 [001] d..3 14186.700000: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=Player Aud Mixe next_pid=146 next_prio=35
EventThread-110 [001] d..5 14190.100000: sched_wakeup: comm=SurfaceFlinger pid=103 prio=112 success=1 target_cpu=001
EventThread-110 [001] d..3 14190.100000: sched_switch: prev_comm=EventThread prev_pid=110 prev_prio=111 prev_state=S ==> next_comm=SurfaceFlinger next_pid=103 next_prio=112
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: B|96|onMessageReceived
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: B|96|handleTransaction
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: B|96|doTransaction
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: E
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: E
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: B|96|handleMessageInvalidate
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: E
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: E
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: B|96|onMessageReceived
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: B|96|handleMessageRefresh
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: B|96|rebuildLayerStacks
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: B|96|computeVisibleRegions
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: E
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: E
SurfaceFlinger-103 [001] ...1 14190.100000: tracing_mark_write: B|96|doComposition
SurfaceFlinger-103 [001] d.h4 14190.100000: sched_wakeup: comm=surfaceflinger pid=96 prio=120 success=1 target_cpu=001
SurfaceFlinger-103 [001] d..3 14190.100000: sched_switch: prev_comm=SurfaceFlinger prev_pid=103 prev_prio=112 prev_state=R ==> next_comm=surfaceflinger next_pid=96 next_prio=120
提前致谢!
最佳答案
好吧,现在可以肯定了:格式属于ftrace工具。 Android atrace 是 ftrace 构建的扩展,以方便配置。
ftrace 的官方文档表明,这种输出格式可以通过以下方式直接生成:
root@adroid:# echo 1 > /sys/kernel/debug/tracing/events/sched/sched_switch/enable
root@adroid:# echo 1 > /sys/kernel/debug/tracing/tracing_on
root@adroid:# cat /sys/kernel/debug/tracing/trace > mytracefile.txt
root@adroid:# echo 0 > /sys/kernel/debug/tracing/tracing_on
root@adroid:# echo 0 > /sys/kernel/debug/tracing/events/sched/sched_switch/enable
官方文档位于: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/trace/ftrace.txt
# cat trace
# tracer: nop
#
# entries-in-buffer/entries-written: 77/77 #P:8
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
<idle>-0 [007] d... 2440.707395: sched_switch: prev_comm=swapper/7 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=snapshot-test-2 next_pid=2243 next_prio=120
snapshot-test-2-2229 [002] d... 2440.707438: sched_switch: prev_comm=snapshot-test-2 prev_pid=2229 prev_prio=120 prev_state=S ==> next_comm=swapper/2 next_pid=0 next_prio=120
[...]
问候,
关于Android Systrace 跟踪文件格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15684715/
我正在尝试使用 systrace。为此,我正在阅读official site . 但在终端上运行此命令后: D:\Software\Android\android-sdk\platform-tools
我正在尝试在 android 4.2 (avd 17) 模拟器上使用 systrace 我在跟踪选项中启用了 usb debuggimg 并激活了 webview,并在此处遵循本指南 http://w
这是错误信息 D:\Programming\Tools\ADT_bundle\sdk\platform-tools\systrace>python systrace.py Traceback (mos
我在我的 android studio 项目上运行 systrace 以发现一些性能错误,但在跟踪过程结束后,我收到以下错误,如果我在 chrome 中打开 trace.html 输出文件,跟踪 Vi
Android systrace工具,通过ADB调用atrace工具。但是,我不太了解跟踪文件的格式。显然它与 linux ftrace 工具非常相似,但有一些不同。主要区别在于它不使用 System
我正在尝试运行 Android SDK 提供的新 systrace 工具。正如在 Google I/O 2012 ( Demo starts at 31:04 in the video ) ( Ter
当我运行时python systrace.py --time=10 -o mynewtrace.html gfx 出现以下错误 Starting tracing (10 seconds) Tracin
Systrace Android 工具在内部调用一个名为 atrace 的工具,它是 ftrace 或 strace 的扩展(Linux工具)。 如果我们通过模拟器控制台(ADB shell)连接到
我正在尝试在 Ubuntu 12.04 32 位版本上编译 Systrace-1.6f。我发现以下错误。 root@sharma-VM:/home/sharma/Desktop/systrace-1.
我可以运行 systrace,但看不到 SurfaceFlinger 的踪迹。 GPU、bufferQueues 等 我给出了以下命令:systrace.py --time=10 -o mynewtr
android中的文档说 you can use the methods of the Trace class to add instrumentation to your application c
我遵循了 Jelly Bean 上的 systrace 教程 Android developer systrace 过程似乎是正确的,并为我创建了一个 html 文件,但它在浏览器中什么也没有显示,只
我正在学习使用这些工具进行性能分析。我已经阅读了关于 traceview 和 systrace 的 Android 文档,但我没有看到任何主要区别。它们都具有非常相同的 GUI:时间轴和左侧的所有组件
最新的 Android Systrace 页面 - http://developer.android.com/tools/debugging/systrace.html#options-4.3 - 显
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 8 年前。
我正在查看我的应用程序生成的 systrace,我发现一个框架花费的时间太长。这是由 RecyclerView 的 onCreateViewHolder 在展开我的项目 View 时引起的。使用 Co
我目前正在处理我的应用程序中的一些丢帧问题。我转向 systrace 寻求帮助,但不幸的是,我对它的输出并不聪明。 Here is my traceview.. 我的问题基本上是在我的适配器中我正在创
我按照此处的说明为我的应用程序使用 systrace,但每当我尝试为 systrace 设置标签时,我总是收到以下错误: systrace.py: error: no such option: --s
我在 Linux 中运行 Systrace 并生成了 HTML。 HTML 文件生成的内容很好。我的问题来了:当我在页面末尾的 HTML 中选择了一部分内容时,应该有一个需要显示的 Analysis
我正在尝试在非 root 设备上运行 systrace。如果选择了任何跟踪事件,它总是会出现以下错误: 无法找到跟踪开始标记“TRACE:”:打开/sys/kernel/debug/tracing/e
我是一名优秀的程序员,十分优秀!