android Ftrace冻结时打开功能跟踪,有人帮助我:( [英] Ftrace on android freeze when turn on function trace, somebody help me :(

查看:132
本文介绍了android Ftrace冻结时打开功能跟踪,有人帮助我:(的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Android AVD上安装了Ftrace,并尝试使用Ftrace的功能,但是它不起作用.

I have installed Ftrace on android AVD and try to use Ftrace's functionality, but it does not work.

以下是我的工作清单:

  1. 安装ubuntu 10.04 LTS
  2. 安装基本工具,例如android sdk,工具链,库等
  3. 下载金鱼内核 refer- http://blog.markloiseau.com/2012/07/how-to-compile-the-android-goldfish-emulator-kernel/
  4. 修改内核配置文件(打开跟踪器选项")
  5. 使用自定义内核启动金鱼,该自定义内核已使用跟踪器选项进行编译
  6. 试图使用Ftrace功能
  7. 内核冻结
  1. Install ubuntu 10.04 LTS
  2. Install essential tools such as android sdk, toolchain, libs, etc
  3. Download goldfish kernel refer - http://blog.markloiseau.com/2012/07/how-to-compile-the-android-goldfish-emulator-kernel/
  4. Modify kernel config file (turned on Tracer Options)
  5. Boot up goldfish with custom kernel which has compiled with tracer options
  6. Tried to use Ftrace functionality
  7. The kernel freezes

这是日志:

\# mount -t debugfs nodev /sys/kernel/debug
\# ls /sys/kernel/debug
sched_features
mmc0
tracing
bdi

\# cd /sys/kernel/debug/tracing
\# ls
events
set_event
available_events
printk_formats
per_cpu
options
saved_cmdlines
trace_marker
buffer_size_kb
trace_pipe
README
tracing_thresh
tracing_max_latency
current_tracer
available_tracers
trace
tracing_cpumask
trace_options
tracing_enabled
tracing_on
set_ftrace_pid

\# cat available_tracers
function_graph function sched_switch nop

\# cat current_tracer 
nop

\# echo sched_switch > current_tracer 
\# cat current_tracer 
sched_switch

\# cat trace | /data/busybox head -10
\# tracer: sched_switch
\#
\#           TASK-PID    CPU#    TIMESTAMP  FUNCTION
\#              | |       |          |         |
        bash-258   [000]   490.261240:    258:120:R   + [000]     4:115:S events/0
        bash-258   [000]   490.262087:    258:120:S ==> [000]    45:120:R adbd
        adbd-45    [000]   490.262318:     45:120:S ==> [000]     4:115:R events/0
    events/0-4     [000]   490.262457:      4:115:R   + [000]    43:120:S qemud
    events/0-4     [000]   490.262492:      4:115:S ==> [000]    43:120:R qemud
       qemud-43    [000]   490.262643:     43:120:R   + [000]   109:112:S er$SensorThread

\# echo function > current_tracer  *<--- this command occur freeze*

如上所示,某些功能运行良好.但是,当我打开跟踪功能(一项关键功能)时,系统已关闭.

As shown above, some of the features work well. But at the time I turn on the tracking function, a key feature, the system is down.

我该怎么办?

推荐答案

函数跟踪器可能会冻结的原因有很多.这是一个非常具有侵入性的跟踪器(跟踪内核的几乎所有功能).一个问题是它是否跟踪内部功能(如禁用中断).这将导致它陷入无限循环.现在,如果您正在运行Android,我假设您有一个ARM设备.根据配置的不同,可能需要将ARM的某些低级功能标记为notrace,以防止对其进行跟踪.如果您启用了动态跟踪,请尝试仅跟踪一个函数,如果该函数起作用,则您知道问题出在被跟踪的问题上,而不应该这样.要跟踪单个功能,只需:

There's several reasons that the function tracer may freeze. It's a very invasive tracer (traces almost all functions of the kernel). One issue is if it traces an internal function like disabling interrupts. This would cause it to go into an infinite loop. Now I assume you have an ARM device if you are running Android. Depending on the configuration some of the low level functions for ARM may need to be marked notrace to prevent them to be traced. If you have dynamic tracing enabled, try just tracing a single function and if that works you know the issue is with something that's being traced that shouldn't be. To trace a single function, just:

回声时间表> set_ftrace_filter; 回声函数> current_tracer

echo schedule > set_ftrace_filter; echo function > current_tracer

祝你好运.

这篇关于android Ftrace冻结时打开功能跟踪,有人帮助我:(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆