{"id":1067,"date":"2020-01-11T18:03:31","date_gmt":"2020-01-11T10:03:31","guid":{"rendered":"http:\/\/www.max-shu.com\/blog\/?p=1067"},"modified":"2020-01-11T18:03:31","modified_gmt":"2020-01-11T10:03:31","slug":"android9%e6%ba%90%e7%a0%81%e8%be%93%e5%87%balinux%e5%86%85%e6%a0%b8pr_debug%e8%b0%83%e8%af%95%e4%bf%a1%e6%81%af","status":"publish","type":"post","link":"http:\/\/www.max-shu.com\/blog\/?p=1067","title":{"rendered":"Android9\u6e90\u7801\u8f93\u51falinux\u5185\u6838pr_debug\u8c03\u8bd5\u4fe1\u606f"},"content":{"rendered":"<p>\u9ed8\u8ba4\u7f16\u8bd1\u51fa\u6765\u7684linux\u5185\u6838\u8981info\u4ee5\u4e0a\u7684\u4fe1\u606f\u624d\u4f1a\u663e\u793a\uff0c\u8981\u4fee\u6539\u4e0b\u4ee3\u7801\u624d\u80fd\u8ba9pr_debug\u7684\u5185\u5bb9\u80fd\u8f93\u51fa\u5230dmesg\u3002<\/p>\n<p>\u4ee5\u4fee\u6539\u7f51\u7edc\u534f\u8bae\u6808\u4e2d\u7684pr_debug\u5185\u5bb9\u4e3a\u4f8b\uff1a<\/p>\n<div>$ cd AndroidP\/<\/div>\n<div><\/div>\n<div>\u5728Makefile\u4e2d\u589e\u52a0\u7f16\u8bd1\u9009\u9879DEBUG\uff08\u5f53\u7136\u76f4\u63a5\u5728.c\u6587\u4ef6\u7684\u5f00\u5934\u90e8\u5206\u5b9a\u4e49\u4e5f\u53ef\u4ee5#define DEBUG\uff0c\u5c31\u662f\u5f97\u6bcf\u4e2a\u6587\u4ef6\u53bb\u4fee\u6539\uff09\uff1a<\/div>\n<div>$ vi kernel-4.9\/net\/Makefile<\/div>\n<div>subdir-ccflags-y += -Werror <span style=\"color: #ff0000;\">-DDEBUG<\/span><\/div>\n<div>\u8fd9\u6837\u6574\u4e2anet\u76ee\u5f55\u4e0b\u7684.c\u6587\u4ef6\u4e2d\u7684pr_debug\u5185\u5bb9\u90fd\u53ef\u4ee5\u6253\u5370\u4e86\u3002<\/div>\n<div><\/div>\n<div>\u7136\u540e\u91cd\u65b0\u7f16\u8bd1kernel\uff1b<\/div>\n<div>\n<div>$ source build\/envsetup.sh<\/div>\n<div>$ lunch xxxx<\/div>\n<div>$ mmm\u00a0showcommands kernel-4.9\/:kernel<\/div>\n<div>$ make bootimage<\/div>\n<div>\u8f93\u51fa\u5728\uff1aout\/target\/product\/xxxx\/boot.img<\/div>\n<div><\/div>\n<\/div>\n<div>\u7136\u540e\u628aboot.img\u70e7\u5f55\u8fdb\u8bbe\u5907\uff0c\u91cd\u542f\u540e\u5373\u53ef\u901a\u8fc7dmesg\u67e5\u770b\uff1a<\/div>\n<div>dos&gt; adb root<\/div>\n<div>dos&gt; adb shell<\/div>\n<div># dmesg -w<\/div>\n<div>[11991.723617] (1)[15:ksoftirqd\/1]tuple ffffffeaa15ca658: 6 127.0.0.1:22342 -&gt; 127.0.0.1:38674<br \/>\n[11991.723631] (1)[15:ksoftirqd\/1]seq=686264045 ack=1519905798+(0) sack=1519905798+(0) win=512 end=686265245<br \/>\n[11991.723637] (1)[15:ksoftirqd\/1]tcp_in_window: sender end=686264045 maxend=686729453 maxwin=131072 scale=8 receiver end=1519905798 maxend=1520036870 maxwin=465408 scale=8<br \/>\n[11991.723640] (1)[15:ksoftirqd\/1]tcp_in_window:<br \/>\n[11991.723643] (1)[15:ksoftirqd\/1]tuple ffffffeaa15ca658: 6 127.0.0.1:22342 -&gt; 127.0.0.1:38674<br \/>\n[11991.723652] (1)[15:ksoftirqd\/1]seq=686264045 ack=1519905798+(0) sack=1519905798+(0) win=512 end=686265245<br \/>\n[11991.723657] (1)[15:ksoftirqd\/1]tcp_in_window: sender end=686264045 maxend=686729453 maxwin=131072 scale=8 receiver end=1519905798 maxend=1520036870 maxwin=465408 scale=8<br \/>\n[11991.723661] (1)[15:ksoftirqd\/1]tcp_in_window: I=1 II=1 III=1 IV=1<br \/>\n[11991.723667] (1)[15:ksoftirqd\/1]tcp_in_window: res=1 sender end=686265245 maxend=686729453 maxwin=131072 receiver end=1519905798 maxend=1520036870 maxwin=465408<br \/>\n[11991.723671] (1)[15:ksoftirqd\/1]tcp_conntracks:<br \/>\n[11991.723673] (1)[15:ksoftirqd\/1]tuple ffffffeaa15ca658: 6 127.0.0.1:22342 -&gt; 127.0.0.1:38674<br \/>\n[11991.723681] (1)[15:ksoftirqd\/1]syn=0 ack=1 fin=0 rst=0 old=3 new=3<\/div>\n<div><\/div>\n<div>\u53ef\u4ee5\u53d1\u73b0\u8f93\u51fa\u4f1a\u975e\u5e38\u591a\u3002<\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u9ed8\u8ba4\u7f16\u8bd1\u51fa\u6765\u7684linux\u5185\u6838\u8981info\u4ee5\u4e0a\u7684\u4fe1\u606f\u624d\u4f1a\u663e\u793a\uff0c\u8981\u4fee\u6539\u4e0b\u4ee3\u7801\u624d\u80fd\u8ba9pr_debug\u7684\u5185\u5bb9\u80fd\u8f93\u51fa\u5230dm &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[394,793,9,792,243,794],"class_list":["post-1067","post","type-post","status-publish","format-standard","hentry","category-linuxandroid","tag-android","tag-debug","tag-linux","tag-pr_debug","tag-243","tag-794"],"views":2835,"_links":{"self":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1067"}],"version-history":[{"count":1,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1067\/revisions"}],"predecessor-version":[{"id":1068,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1067\/revisions\/1068"}],"wp:attachment":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1067"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}