Created
August 21, 2019 07:10
-
-
Save peat-psuwit/b987df72a01ef58cfbb7d3e3cf307e64 to your computer and use it in GitHub Desktop.
How to run a daemon and collect ftrace from it. (The example is mm-qcamera-daemon)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/bin/sh | |
echo 'function_graph' >/sys/kernel/debug/tracing/current_tracer | |
echo 96000 > /d/tracing/buffer_size_kb | |
echo $$ > /sys/kernel/debug/tracing/set_ftrace_pid | |
echo 1 > /sys/kernel/debug/tracing/tracing_on | |
( | |
sleep 10 # stop tracing after this second. | |
echo 0 > /sys/kernel/debug/tracing/tracing_on | |
cat /sys/kernel/debug/tracing/trace >/data/local/tmp/strace/qcamerasvr.ftrace | |
echo 'nop' >/sys/kernel/debug/tracing/current_tracer | |
) & | |
exec /system/bin/mm-qcamera-daemon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment