Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to increase Android FTrace precision to microseconds?
    text
    copied!<p>I'm trying to generate <strong>FTrace</strong> files inside an <strong>Android</strong> environment, using: </p> <pre><code>root@adroid:# echo 1 &gt; /sys/kernel/debug/tracing/events/sched/sched_switch/enable root@adroid:# echo 1 &gt; /sys/kernel/debug/tracing/tracing_on root@adroid:# cat /sys/kernel/debug/tracing/trace &gt; mytracefile.txt root@adroid:# echo 0 &gt; /sys/kernel/debug/tracing/tracing_on root@adroid:# echo 0 &gt; /sys/kernel/debug/tracing/events/sched/sched_switch/enable </code></pre> <p>The problem is that in <strong>mytracefile.txt</strong> the precision of time stamp is in <strong>milliseconds</strong>:</p> <pre><code> &lt;idle&gt;-0 [000] d.h7 14186.690000: sched_wakeup: comm=tfm_b6bcf800 pid=1714 prio=35 success=1 target_cpu=000 &lt;idle&gt;-0 [000] d..3 14186.690000: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==&gt; next_comm=tfm_b6bcf800 next_pid=1714 next_prio=35 tfm_b6bcf800-1714 [000] d..3 14186.690000: sched_switch: prev_comm=tfm_b6bcf800 prev_pid=1714 prev_prio=35 prev_state=D|W ==&gt; next_comm=swapper/0 next_pid=0 next_prio=120 &lt;idle&gt;-0 [001] d.h3 14186.690000: sched_wakeup: comm=Player Aud Mixe pid=146 prio=35 success=1 target_cpu=001 &lt;idle&gt;-0 [001] d..3 14186.690000: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==&gt; next_comm=Player Aud Mixe next_pid=146 next_prio=35 Player Aud Mixe-146 [001] d..3 14186.690000: sched_switch: prev_comm=Player Aud Mixe prev_pid=146 prev_prio=35 prev_state=D ==&gt; next_comm=swapper/1 next_pid=0 next_prio=120 &lt;idle&gt;-0 [001] d.h3 14186.690000: sched_wakeup: comm=Player Aud Mixe pid=146 prio=35 success=1 target_cpu=001 &lt;idle&gt;-0 [001] d..3 14186.690000: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==&gt; next_comm=Player Aud Mixe next_pid=146 next_prio=35 Player Aud Mixe-146 [001] d..3 14186.690000: sched_switch: prev_comm=Player Aud Mixe prev_pid=146 prev_prio=35 prev_state=S ==&gt; next_comm=swapper/1 next_pid=0 next_prio=120 &lt;idle&gt;-0 [001] d.h3 14186.700000: sched_wakeup: comm=Player Aud Mixe pid=146 prio=35 success=1 target_cpu=001 &lt;idle&gt;-0 [001] d..3 14186.700000: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==&gt; next_comm=Player Aud Mixe next_pid=146 next_prio=35 </code></pre> <p>Normally, it should be in the order of <strong>microseconds</strong>, like <strong>14186.691234</strong> instead of just <strong>14186.690000</strong>.</p> <p>I have already tested all the other <strong>trace_clock options</strong> that I have (<strong>local, global and counter</strong>) but the results are always the same. Changing that parameter doesn't change anything in the output file.</p> <p>I followed carefully <a href="http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/trace/ftrace.txt" rel="nofollow">FTrace documentation</a> but I don't know what else to change in configuration.</p> <p>Searching over the internet I had only been able to find this bug report but it was not solved: <a href="http://lists.linaro.org/pipermail/linaro-dev/2011-February/002720.html" rel="nofollow">http://lists.linaro.org/pipermail/linaro-dev/2011-February/002720.html</a></p> <p>Any advises? </p> <p>Are there additional modules in the kernel that I have to install ?</p> <p><strong>Update:</strong></p> <ul> <li>Android Version: 4.2.2</li> <li>Kernel Linux Version: 3.4.7</li> </ul> <p><strong>dmesg</strong> output is also showing milliseconds precision:</p> <pre><code>&lt;4&gt;[ 38.130000] oom_adj 0 =&gt; oom_score_adj 0 &lt;4&gt;[ 38.130000] oom_adj 1 =&gt; oom_score_adj 58 &lt;4&gt;[ 38.140000] oom_adj 2 =&gt; oom_score_adj 117 &lt;4&gt;[ 38.140000] oom_adj 4 =&gt; oom_score_adj 235 &lt;4&gt;[ 38.150000] oom_adj 9 =&gt; oom_score_adj 529 &lt;4&gt;[ 38.150000] oom_adj 15 =&gt; oom_score_adj 1000 </code></pre> <p>Thank you,</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload