⑴ vpp源码分析(2) - 入口函数
我们使用: cmake3 --build /mnt/vdb1/vpp/build-root/build-vpp_debug-native/vpp
编译了 vpp
在次之前执行了 make install-ext-deps ,DPDK各种库文件已经安装,模块已经安装到了内核,
现在我们要分析一下入口函数。
进入目录:/mnt/vdb1/vpp/build-root/build-vpp_debug-native/vpp
nm -al bin/vpp 生成符号表,带源文件地址。
objmp -j .text -Sl bin/vpp --prefix-addresses > debug.info 反汇编,汇编和C语言混合。
上面生成以备后用。
调试使用cgdb.
[root@devel-ng-exporter-225 vpp]# pwd
/mnt/vdb1/vpp/build-root/build-vpp_debug-native/vpp
[root@devel-ng-exporter-225 vpp]# cgdb bin/vpp
/usr/bin/vpp -c /etc/vpp/startup.conf
我们先看一下用户态程序的参数传递规则:
上面程序很精简,并不复杂得到下面的结果:
设置main程序亲和性,main_core默认为1,可在文件中配置。
关于/etc/vpp/startup.conf中参数和使用配置参考: https://fdio-vpp.readthedocs.io/en/latest/gettingstarted/users/configuring/startup.html
设置main程序的亲和性:
272│ /* Set up the plugin message ID allocator right now... */
273├> vl_msg_api_set_first_available_msg_id (VL_MSG_FIRST_AVAILABLE);
上面完成: