简体   繁体   English

无法在MAKO中初始化ftrace

[英]Fail to initialize ftrace in MAKO

I am trying to use ftrace in MAKO (Nexus 4) 我正在尝试在MAKO(Nexus 4)中使用ftrace

With android-msm-mako-3.4-lollipop-release branch from msm.git, I just added below configuration in mako_defconfig 使用msm.git的android-msm-mako-3.4-lollipop-release分支,我在mako_defconfig中添加了以下配置

CONFIG_TRACING=y
CONFIG_FUNCTION_TRACER=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_STACK_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y

However, ftrace_init is failed in booting time There are some failed logs in kmsg 但是,ftrace_init在启动时失败。kmsg中有一些失败的日志

<6>[    0.002197] ftrace: allocating 32821 entries in 97 pages
<4>[    0.033053] ------------[ cut here ]------------
<4>[    0.033084] WARNING: at kernel/trace/ftrace.c:1590 ftrace_bug+0xec/0x174()
<4>[    0.033114] [<c0015230>] (unwind_backtrace+0x0/0xec) from [<c08a7dc4>] (dump_stack+0x20/0x24)
<4>[    0.033145] [<c08a7dc4>] (dump_stack+0x20/0x24) from [<c0075c98>] (warn_slowpath_common+0x58/0x70)
<4>[    0.033175] [<c0075c98>] (warn_slowpath_common+0x58/0x70) from [<c0075da8>] (warn_slowpath_null+0x2c/0x34)
<4>[    0.033206] [<c0075da8>] (warn_slowpath_null+0x2c/0x34) from [<c00e0558>] (ftrace_bug+0xec/0x174)
<4>[    0.033236] [<c00e0558>] (ftrace_bug+0xec/0x174) from [<c0d14a50>] (ftrace_init+0x408/0x4bc)
<4>[    0.033267] [<c0d14a50>] (ftrace_init+0x408/0x4bc) from [<c0d0095c>] (start_kernel+0x420/0x48c)
<4>[    0.033297] [<c0d0095c>] (start_kernel+0x420/0x48c) from [<8020803c>] (0x8020803c)
<4>[    0.033358] ---[ end trace d633338057b77c0d ]---
<6>[    0.033358] ftrace faulted on writing [<c010203c>] perf_output_put_handle+0x10/0xec

I think it can not write over 0xC010_0000, so it is a matter of kernel size But, I just added those trace configuration with vanila code, How can I fix this? 我认为它不能覆盖0xC010_0000,所以这是内核大小的问题,但是,我只添加了带有vanila代码的跟踪配置,如何解决此问题?

add some logs, I blocked ftrace_bug function, it calls ftrace_kill, it disable ftrace. 添加一些日志,我阻止了ftrace_bug函数,它调用ftrace_kill,它禁用了ftrace。 Instead, I logged which function got a fault 相反,我记录了哪个函数出错

<6>[    0.002350] ftrace: allocating 32821 entries in 97 pages
<4>[    0.032778] ftrace failed 2[<c010206c>] perf_output_put_handle+0x10/0xec
<4>[    0.032809] ftrace failed 2[<c057fd00>] iw_get_linkspeed+0x14/0x13c
<4>[    0.032839] ftrace failed 2[<c0886308>] wireless_spy_update+0x10/0xec

It looks like some specific functions are blocked to write;; 似乎某些特定功能无法编写;

I found myself. 我寻找到了自我。

The reason was the write protection for kernel code area. 原因是对内核代码区域的写保护。

If you want to use ftrace in Nexus, you have to disable CONFIG_STRICT_MEMORY_RWX configuration in defconfig file. 如果要在Nexus中使用ftrace,则必须在defconfig文件中禁用CONFIG_STRICT_MEMORY_RWX配置。

I wish this can help you. 希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM