有的时候print_hex_dump_bytes循环打印很多信息的时候(大于1K)
用UART串口打印的信息总是会有丢失,估计是printk缓冲区的问题把,具体原因不是太清楚
于是自己写了个比较笨的dump函数,问题得到解决:

//每次打印128个字节(当然你也可以打印更多),只调用一次printk ,
// 而 print_hex_dump_bytes 则 最多32个字节 就调用一次printk

static void  dumpBuf(void * buf)
{
unsigned char * temp; temp=(char *)buf; int i=0;
printk(KERN_ERR "[%s] \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n \
%02x %02x %02x %02x %02x %02x %02x %02x \r\n",__func__, \
temp[i+0],temp[i+1],temp[i+2],temp[i+3],temp[i+4],temp[i+5],temp[i+6],temp[i+7], \
temp[i+8],temp[i+9],temp[i+10],temp[i+11],temp[i+12],temp[i+13],temp[i+14],temp[i+15],\
temp[i+16],temp[i+17],temp[i+18],temp[i+19],temp[i+20],temp[i+21],temp[i+22],temp[i+23],\
temp[i+24],temp[i+25],temp[i+26],temp[i+27],temp[i+28],temp[i+29],temp[i+30],temp[i+31],\
temp[i+32],temp[i+33],temp[i+34],temp[i+35],temp[i+36],temp[i+37],temp[i+38],temp[i+39],\
temp[i+40],temp[i+41],temp[i+42],temp[i+43],temp[i+44],temp[i+45],temp[i+46],temp[i+47],\
temp[i+48],temp[i+49],temp[i+50],temp[i+51],temp[i+52],temp[i+53],temp[i+54],temp[i+55],\
temp[i+56],temp[i+57],temp[i+58],temp[i+59],temp[i+60],temp[i+61],temp[i+62],temp[i+63],\
temp[i+64],temp[i+65],temp[i+66],temp[i+67],temp[i+68],temp[i+69],temp[i+70],temp[i+71],\
temp[i+72],temp[i+73],temp[i+74],temp[i+75],temp[i+76],temp[i+77],temp[i+78],temp[i+79],\
temp[i+80],temp[i+81],temp[i+82],temp[i+83],temp[i+84],temp[i+85],temp[i+86],temp[i+87],\
temp[i+88],temp[i+89],temp[i+90],temp[i+91],temp[i+92],temp[i+93],temp[i+94],temp[i+95],\
temp[i+96],temp[i+97],temp[i+98],temp[i+99],temp[i+100],temp[i+101],temp[i+102],temp[i+103],\
temp[i+104],temp[i+105],temp[i+106],temp[i+107],temp[i+108],temp[i+109],temp[i+110],temp[i+111],\
temp[i+112],temp[i+113],temp[i+114],temp[i+115],temp[i+116],temp[i+117],temp[i+118],temp[i+119],\
temp[i+120],temp[i+121],temp[i+122],temp[i+123],temp[i+124],temp[i+125],temp[i+126],temp[i+127]);
//}

kernel hexdump分析 (2.0)的更多相关文章

  1. kernel hexdump分析

    驱动调试中,很多时候是二进制的,这个时候hexdump就是个非常有用的工具了. 不要再自己去实现类似的功能,kernel代码里面就有: 参考: kernel/lib/hexdump.c // 0Xxx ...

  2. u-boot bootz 加载kernel 流程分析

    u-boot 加载 kernel 的流程分析. image重要结构体头文件 // include/image.h * * Legacy and FIT format headers used by d ...

  3. Minix2.0操作系统kernel文件分析

    详细分析  MINIX消息机制的核心: mpx386.s start.c proc.c 保护模式分析: src/kernel/exception.c src/kernel/protect.c src/ ...

  4. Linux kernel kfifo分析【转】

    转自:https://zohead.com/archives/linux-kernel-kfifo/ 本文同步自(如浏览不正常请点击跳转):https://zohead.com/archives/li ...

  5. 结合 category 工作原理分析 OC2.0 中的 runtime

    绝大多数 iOS 开发者在学习 runtime 时都阅读过 runtime.h 文件中的这段代码: struct objc_class { Class isa  OBJC_ISA_AVAILABILI ...

  6. 分析easyswoole3.0源码,协程连接池(五)

    连接池的含义,很多都知道,比如mysql的数据库连接是有限的,一开始连接mysql创建N个连接,放到一个容器里,每次有请求去容器中取出,取出用完再放回去. es3demo里,有mysql的连接池. E ...

  7. 分析easyswoole3.0源码,体验es3(三)

    demo在手,总得去试试看效果吧.我们先把默认的服务改成webserver,并且添加数据库的配置. 建立数据库,github里面有相关内容 CREATE TABLE `user_list` ( `us ...

  8. 分析easyswoole3.0源码,服务启动为例(二)

    以下内容需要结合es的源码,不然可能会觉得跳跃.先描述下es启动的大致流程.es启动的时候注册异常处理函数以及加载配置文件.根据位置文件的设置选择启动哪种swoole服务.然后用一个事件注册类,注册s ...

  9. 分析easyswoole3.0源码,服务启动为例(一)

    swoole已经升级到4了,主要的特性是更好的支持协程,easyswoole也为了更好支持协程推出了es3.我本地环境是php7.2.9 centos7 在github下载最新的3.0的demo.地址 ...

随机推荐

  1. Net FLow Template

    EK  Template : bool bfs(int src, int des){ memset(pre, -, sizeof(pre)); while(!que.empty()) que.pop( ...

  2. android 根据域名得到IP

    public static String GetInetAddress(String host) { String IPAddress = ""; InetAddress Retu ...

  3. Codeforces Round #198 (Div. 2) C. Tourist Problem

    C. Tourist Problem time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  4. oracle scn浅析

    1. 系统SCN号 查询系统SCN号的方法: select dbms_flashback.get_system_change_number from dual commit后系统SCN号会增长,但是即 ...

  5. Hiddenfield控件

    本文转自:http://www.cnblogs.com/weicleer/archive/2012/11/26/2788722.html ASP.NET2.0 HiddenField控件(1)2007 ...

  6. C语言宏定义技巧

    出处:http://blog.chinaunix.net/uid-14022540-id-2849095.html 1.宏中"#"和"##"的用法 一.一般用法 ...

  7. sourceinsight 相对路径设置

    1. mkdir sin(source insight prj dir) 2. creat sin prj 3. push OK directly without setting source fil ...

  8. ant_0105

    在projectA中执行projectB的构件文件.projectA的构件文件内容如下 <?xml version="1.0"?> <!-- 在projectA中 ...

  9. Mac删除废纸篓中的单一文件和文件夹

    http://www.macappbox.com/tips/159/ 通过Automator创建教程: 1.打开Automator并选择新建 2.选择服务类型 3.搜索Run Shell Script ...

  10. 阿里云ECS专有网络产品三个步骤配置教程

    阿里云ECS专有网络产品三个步骤配置教程 阿里云专有网络节点已开通地域:美国硅谷可用区1B,新加坡可用区A,北京可用区A,深圳可用区A,杭州可用区D,上海可用区B 举个栗子:购买 美国硅谷可用区1B  ...