我正在尝试在Android环境中生成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
问题是mytracefile.txt中时间戳的精度以毫秒为单位:
<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
通常,它应该以微秒为单位,例如14186.691234而不是14186.690000。
我已经测试了我拥有的所有其他trace_clock 选项(本地、全局和计数器),但结果始终相同。更改该参数不会更改输出文件中的任何内容。
我仔细阅读了 FTrace 文档,但我不知道还有哪些配置需要更改。
在互联网上搜索我只能找到这个错误报告,但没有解决: http: //lists.linaro.org/pipermail/linaro-dev/2011-February/002720.html
有什么建议吗?
我必须安装内核中的其他模块吗?
更新:
- 安卓版本:4.2.2
- 内核 Linux 版本:3.4.7
dmesg输出也显示毫秒精度:
<4>[ 38.130000] oom_adj 0 => oom_score_adj 0
<4>[ 38.130000] oom_adj 1 => oom_score_adj 58
<4>[ 38.140000] oom_adj 2 => oom_score_adj 117
<4>[ 38.140000] oom_adj 4 => oom_score_adj 235
<4>[ 38.150000] oom_adj 9 => oom_score_adj 529
<4>[ 38.150000] oom_adj 15 => oom_score_adj 1000
谢谢,