トレースを有効にできないのはなぜですか?

トレースを有効にできないのはなぜですか?

READMEの文書によると、これ/sys/kernel/debug/tracing/READMEecho 1 > tracing_onトレースを有効にする簡単な方法です。 (ルートとして)何度も実行しても、inの値はtracing_onまだ0のままです。なぜこれですか?どのようにさらにデバッグできますか?には出力がありません。dmesg

tracing mini-HOWTO:

# echo 0 > tracing_on : quick way to disable tracing
# echo 1 > tracing_on : quick way to re-enable tracing

 Important files:
  trace         - The static contents of the buffer
              To clear the buffer write into this file: echo > trace
  trace_pipe        - A consuming read to see the contents of the buffer
  current_tracer    - function and latency tracers

ベストアンサー1

これがうまくいくためには、まず私が追跡したいものが何であるかを言わなければなりませんでした!関数呼び出しを追跡するために、次のことを行いました。

sudo -s # need to be root to be able to look inside /sys/kernel/debug
cd /sys/kernel/debug/tracing
echo function > current_tracer   #  trace function calls
echo SyS_inotify_add_watch > set_ftrace_filter # limit what to trace

これにより、次のようにトレースフラグが暗黙的に設定されます。

cat tracing_on 
1

これで無効にすることもできます

echo 0 > tracing_on

おすすめ記事