zoukankan      html  css  js  c++  java
  • (OK) 编译 Android, 打印 内核信息


    修改内核源代码:

    -------------------------------
    add pr_*
    -------------------------------
    	pr_emerg("%s: unable to restart system
    ", __func__);
    	pr_alert("%s: SGE packet mismatch
    ", adapter->name);
    	pr_crit("%s: cannot initialize default policy table: %d
    ", __func__, err);
    	pr_err("%s: Couldn't initialize inode slabcache
    ", __func__);
    	pr_warn("Freeing alive inet6 address %p
    ", ifp);
    	pr_notice("delayed DAD work was pending while freeing ifa=%p
    ", ifp);
    	pr_info("%s: use_tempaddr is disabled
    ", __func__);
    	pr_debug("%s
    ", __func__);
    
    -------------------------------
    can use printk
    -------------------------------
    	printk(KERN_DEBUG "MPTCP - %s: %d: %s
    ", __FILE__, __LINE__, __func__ );
    	printk(KERN_INFO "MPTCP - %s: %d: %s
    ", __FILE__, __LINE__, __func__ );
    
    	// printk("%02x ", data[i]);
    	// printk("
    ");
    	sed -i "s/printk(KERN_DEBUG "MPTCP/printk(KERN_INFO "MPTCP/g" `grep "printk(KERN_DEBUG "MPTCP" -rl ./`
    -------------------------------
    #define KERN_EMERG "<0>" /* system is unusable*/
    #define KERN_ALERT "<1>" /* action must be taken immediately*/
    #define KERN_CRIT "<2>" /* critical conditions*/
    #define KERN_ERR "<3>" /* error conditions*/
    #define KERN_WARNING "<4>" /* warning conditions*/
    #define KERN_NOTICE "<5>" /* normal but significant condition*/
    #define KERN_INFO "<6>" /* informational*/
    #define KERN_DEBUG "<7>" /* debug-level messages*/
    -------------------------------
    
    

    启动 Android,执行下面命令:

    //// To determine your current console_loglevel you simply enter:
    
    # cat /proc/sys/kernel/printk
    	7       4       1       7
    	current	default	minimum	boot-time-default
    
    //// To change your current console_loglevel simply write to this file, 
    //// so in orderto get all messages printed to the console do a simple
    //// and every kernel message will appear on your console.
    # echo 7 > /proc/sys/kernel/printk
    or
    # dmesg -n 7
    


    cat /proc/kmsg


    adb -s 192.168.56.3 shell cat /proc/kmsg






  • 相关阅读:
    Shell之sed用法 转滴
    再议mysql 主从配置
    CentOS 如何将.deb 文件 转换.rpm
    scp命令[转]
    安装samba服务器
    xdebug影响php运行速度
    PHP中VC6、VC9、TS、NTS版本的区别与用法详解
    将Centos的yum源更换为国内的阿里云源
    centos网卡错误Device eth0 does not seem to be present
    虚拟机VirtualBox中centos6.5网络设置
  • 原文地址:https://www.cnblogs.com/ztguang/p/12645588.html
Copyright © 2011-2022 走看看