MAKO (Nexus 4) で ftrace を使用しようとしています。
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
ただし、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
0xC010_0000以上は書き込めないと思うので、カーネルサイズの問題ですが、バニラコードでトレース設定を追加したところですが、どうすれば直せますか?
いくつかのログを追加し、ftrace_bug 関数をブロックしました。それは ftrace_kill を呼び出し、ftrace を無効にします。代わりに、どの関数にエラーが発生したかをログに記録しました
<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
一部の特定の関数が書き込みをブロックされているようです;;