Android/Linux dmesg参数说明

驱动开发的同学经常会使用dmesg,里面有一些非常有用的参数记得要使用

# dmesg --help
Toybox 0.8.6-android multicall binary (see toybox --help)

usage: dmesg [-Cc] [-r|-t|-T] [-n LEVEL] [-s SIZE] [-w]

Print or control the kernel ring buffer.

-C      Clear ring buffer without printing
-c      Clear ring buffer after printing
-n      Set kernel logging LEVEL (1-9)
-r      Raw output (with <level markers>)
-S      Use syslog(2) rather than /dev/kmsg
-s      Show the last SIZE many bytes
-T      Human readable timestamps
-t      Don't print timestamps
-w      Keep waiting for more output (aka --follow)

-w会非常有用,实时监控内核日志输出;系统生成新日志时会立即显示

dmesg -w |grep -iE deepinout