运行packetdrill在本地机器上出现的问题

515 阅读1分钟
  1. 脚本设置的运行时间与实际运行时间不同

error handling packet: timing error: expec│~ ted outbound packet at 1.400890 sec but happened at 1.440778 sec; to│~ lerance 0.004000 sec

解决方法: --tolerance=800000重新设置可以容忍的时间,可以在运行脚本时指定时间

  1. runtime error in code: can't find getsockopt to get sk_meminfo错误

进入code.c文件中,这个文件所在路径为packetdrill/gtests/net/packetdrill/code.c

  • 找到报错语句在code.c中的位置,将报错语句注释掉
  • 找到跟code.c同一文件夹下的platforms.h文件,修改其中的宏定义为1,比如说HAVE_TCP_CC_INFO 修改为1,只有platforms.h中对应的宏设置为1,code.c中被#if #endif所包括的代码才会被运行
  • 运行脚本,接下来还会报错,报如下错误 assertion len >= sizeof(struct _tcp_info) failed at code.c line 144
  • 接下来直接进入code.c中,将144这一行代码注释掉即可
  • 这样就成功解决了这个运行时的错误,运行代码能够显示出对应的结果