如何输出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>
<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>
相关文章推荐
- 如何输出dev_dbg log
- 如何输出dev_dbg log
- 如何将php的错误输出到nginx的error_log中去
- android应用如何在发布市场时关掉所有的Log日志输出
- Android中Log.d和Log.v如何实现在release版本不输出
- 如何在Tomcat中指定log文件的位置(使用log4j输出log信息)
- fpga的驱动调试dev_dbg 无输出
- tomcat日志配置,log信息如何输出到同一个文件
- DbgPrintEx KdPrintEx 如何输出信息
- 如何关闭 xcode 8 疯狂的日志log输出
- 如何过滤adb logcat输出
- 如何在JS中捕获console.log()的输出
- [shell]给你一段log,如何输出指定时间后的所有log? .
- Ubuntu下如何用ABD logcat 重定向Log输出
- adb如何打印kernel输出log
- Android C 层如何输出log
- android应用如何在发布市场时关掉所有的Log日志输出
- 如何关闭 xcode 8 疯狂的日志log输出
- 如何利用Log4j将不同级别,不同package中Log输出到不同的文件中
- Android单元测试时如何使用log查看输出结果