<div id="article_content" class="article_content">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> kernel里面默认都配置了CONFIG_DYNAMIC_DEBUG=y;</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> 假如我们要打印acpuclock-krait.c中的</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> dev_dbg(drv.dev, "ACPU%d speed change complete\n", cpu);</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> 在adb shell中输入:</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> mount –t debugfs none /sys/kernel/debug </span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> cd /sys/kernel/debug </span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> echo -n 'file acpuclock-krait.c +p' > dynamic_debug/control</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<p><span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> 上面是大家熟悉的debugfs;下面是打印出的log:</span></p>
<p><span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"><img src="https://img-blog.youkuaiyun.com/20130525222623659" alt=""><br>
</span></p>
<br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> 个人觉得懂得这个方法输出log很重要,linux里面许许多多的地方使用了dev_dbg,总不能每次想输出log改成dev_err,再build fastboot,</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">为什么这样就可以输出Log了?请参考网上文章:</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<a href="http://blog.youkuaiyun.com/pillarbuaa/article/details/7634546" target="_blank" style="outline:none; color:rgb(61,94,134); font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">http://blog.<wbr>youkuaiyun.com/pil<wbr>larbuaa/arti<wbr>cle/details/<wbr>7634546</a><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
</div>
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> kernel里面默认都配置了CONFIG_DYNAMIC_DEBUG=y;</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> 假如我们要打印acpuclock-krait.c中的</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> dev_dbg(drv.dev, "ACPU%d speed change complete\n", cpu);</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> 在adb shell中输入:</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> mount –t debugfs none /sys/kernel/debug </span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> cd /sys/kernel/debug </span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> echo -n 'file acpuclock-krait.c +p' > dynamic_debug/control</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<p><span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> 上面是大家熟悉的debugfs;下面是打印出的log:</span></p>
<p><span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"><img src="https://img-blog.youkuaiyun.com/20130525222623659" alt=""><br>
</span></p>
<br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px"> 个人觉得懂得这个方法输出log很重要,linux里面许许多多的地方使用了dev_dbg,总不能每次想输出log改成dev_err,再build fastboot,</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<span style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">为什么这样就可以输出Log了?请参考网上文章:</span><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
<a href="http://blog.youkuaiyun.com/pillarbuaa/article/details/7634546" target="_blank" style="outline:none; color:rgb(61,94,134); font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">http://blog.<wbr>youkuaiyun.com/pil<wbr>larbuaa/arti<wbr>cle/details/<wbr>7634546</a><br style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">
</div>