vpp原始碼之Makefile分析(編譯除錯)

2021-10-01 17:10:43 字數 4615 閱讀 2391

下面是vpp的命令:

[root@localhost vpp-18.07]# make

make targets:

install-dep - install software dependencies

wipe - wipe all products of debug build

wipe-release - wipe all products of release build

build - build debug binaries

build-release - build release binaries

build-coverity - build coverity artifacts

rebuild - wipe and build debug binares

rebuild-release - wipe and build release binares

run - run debug binary

run-release - run release binary

debug - run debug binary with debugger

debug-release - run release binary with debugger

test - build and run (basic) functional tests

test-debug - build and run (basic) functional tests (debug build)

test-all - build and run (all) functional tests

test-all-debug - build and run (all) functional tests (debug build)

test-shell - enter shell with test environment

test-shell-debug - enter shell with test environment (debug build)

test-wipe - wipe files generated by unit tests

retest - run functional tests

retest-debug - run functional tests (debug build)

test-help - show help on test framework

run-vat - run vpp-api-test tool

pkg-deb - build deb packages

pkg-rpm - build rpm packages

dpdk-install-dev - install dpdk development packages

ctags - (re)generate ctags database

gtags - (re)generate gtags database

cscope - (re)generate cscope database

checkstyle - check coding style

fixstyle - fix coding style

doxygen - (re)generate documentation

bootstrap-doxygen - setup doxygen dependencies

wipe-doxygen - wipe all generated documentation

test-doc - generate documentation for test framework

test-wipe-doc - wipe documentation for test framework

test-cov - generate code coverage report for test framework

test-wipe-cov - wipe code coverage report for test framework

test-checkstyle - check pep8 compliance for test framework

make arguments:

v=[0|1] - set build verbosity level

startup_conf=- startup configuration file

(e.g. /etc/vpp/startup.conf)

startup_dir=- startup drectory (e.g. /etc/vpp)

it also sets startup_conf if

startup.conf file is present

gdb=- gdb binary to use for debugging

platform=- target platform. default is vpp

dpdk_config=- add specified dpdk config commands to

autogenerated startup.conf

(e.g. "no-pci" )

sample_plugin=yes - in addition build/run/debug sample plugin

disabled_plugins=- comma separated list of plugins which

should not be loaded

current argument values:

v =

startup_conf =

startup_dir = /root/***/vpp-18.07

gdb = gdb

platform = vpp

dpdk_version =

dpdk_config =

sample_plugin = no

disabled_plugins =

[root@localhost vpp-18.07]#

對編譯、執行簡單研究下1) make build

翻譯出來就是

make -c /root/***/vpp-18.07/build-root platform=vpp tag=vpp_debug vpp-install

make run

翻譯後和上面類似

-c dir表示,到該目錄下讀取makefile

綜上所述:

直接進入到 vpp-18.07/build-root 目錄下

make platform=vpp tag=vpp_debug vpp-clean

make platform=vpp tag=vpp_debug vpp-wipe

make platform=vpp tag=vpp_debug vpp-build

make platform=vpp tag=vpp_debug vpp-install

vpp-install --> vpp-build —> vpp-configure --> vpp-find-source

道友可以使用makefile的除錯慢慢對這些目標操作操作,看看具體都幹了些什麼。

make platform=vpp tag=vpp_debug vpp-build -n --debug -p --warn-undefined-variables

三個最適合用來除錯的命令列選項:

–just-print(-n)

–print-database(-p)

–warn-undefined-variables

#舉個例子:

cd vpp-18.07/build-root

make platform=vpp tag=vpp_debug vpp-build -n

# -n 只列印過程,不實際執行。列印資訊比較多這裡就不貼上了,

大家道友可以自行執行一下,可以看到具體build過程都做了些什麼。

VPP的原始碼編譯安裝

最近在虛擬機器上搞vpp的編譯安裝,遇到很多問題,先記錄下來。vpp編譯一定要聯網,切記!不聯網的話乙個個的依賴包會讓你懷疑人生的。1.原始碼獲取 git clone 獲取當前最新 2.安裝各種軟體依賴包 原始碼獲取後,假設放在 home目錄下 cd home vpp 3.清除之前編譯殘留 如果是第...

思科VPP原始碼分析(dpo機制原始碼分析)

vpp的dpo機制跟路由緊密結合在一起。路由表查詢 ip4 lookup 的最後結果是乙個load balance t結構。該結構可以看做是乙個hash表,裡面包含了很多dpo,指向為下一步處理動作。每個dpo都是新增路由時的乙個path的結果。dpo標準型別有 dpo drop,dpo ip nu...

4 VPP原始碼分析(graph node 2

每個process結點是由jump機制構成的乙個協程,協程主要用於等待 處理事件。使用longjmp setjmp的輕量級多工協程,由應用程序自行進行排程,不受作業系統排程機制的影響,上下文切換只損耗呼叫longjmp setjmp的時間。協程中執行的函式類似於執行緒函式,區別在於協程函式can b...