추적을 활성화할 수 없는 이유는 무엇입니까?

추적을 활성화할 수 없는 이유는 무엇입니까?

README의 문서 에 따르면 /sys/kernel/debug/tracing/README이렇게 하면 echo 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

관련 정보