Android System Programming Tis and Tricks系统编程技巧(46P).ppt

Android System Programming Tis and Tricks系统编程技巧(46P).ppt

  1. 1、本文档共46页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Android System Programming Tis and Tricks系统编程技巧(46P)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 4/11/11 Kernel log Its there, use dmesg to access after boot Turn on PRINTK_TIMES for timestamps Increase buffer size: CONFIG_LOG_BUF_SHIFT Can emit messages into log by writing to /dev/kmsg Very handy to synchronize with kernel messages 4/11/11 Logcat Logging system in kernel Integrated throughout Android system (C++ and Java access) Increase logging levels Flags to control logging level in code (DEBUG emits more??) Different logs (main, event, etc.) Event is funky, is coded for size See jamboree presentation on log info /archives/2936958.html (Presentation by Tetsuyuki Kobayashi) 4/11/11 Logcat Use from host to redirect to a file To get main log info, use: e.g. adb logcat –v time –d *:V test.log To get info from events log, use -b: e.g. adb logcat –b events –v time –d | grep boot Filter using tag:loglevel Can use ANDROID_LOG_TAGS environment variable I wrote my own logdelta tool, to see time between events See /Improving_Android_Boot_Time#logdelta 4/11/11 Logging system overview diagram * Shameless ripoff of Tetsuyuki Kobayashi 4/11/11 Logcat results (events) I/boot_progress_start( 754): 12559 I/boot_progress_preload_start( 754): 17879 I/boot_progress_preload_end( 754): 28546 I/boot_progress_system_run( 768): 29230 I/boot_progress_pms_start( 768): 29697 I/boot_progress_pms_system_scan_start( 768): 30117 I/boot_progress_pms_data_scan_start( 768): 44171 I/boot_progress_pms_scan_end( 768): 50006 I/boot_progress_pms_ready( 768): 50505 I/boot_progress_ams_ready( 768): 53166 I/boot_progress_enable_screen( 768): 56793 4/11/11 Stdio redirection You can send stdout and stderr to the log: logwrapper myprogram Redirecting Dalvik output: Redirecting C/cpp output: Myprogram | xargs log Assumes you have busybox xargs installed # stop # setprop log.redirect-stdio true # start 4/11/11 Strace Shows system calls for a process (or set of processes) Is part of AOSP since Eclair Can add t

文档评论(0)

qiwqpu54 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档