您的位置:首页 > 其它

如何输出dev_dbg log

2017-04-11 09:29 375 查看
<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.csdn.net/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.csdn.net/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>csdn.net/pil<wbr>larbuaa/arti<wbr>cle/details/<wbr>7634546</a><br
style="font-family:'lucida Grande',Verdana; font-size:14px; line-height:23px">

   

</div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: