Search code examples
cdebuggingloggingnetwork-programmingdpdk

How can I enable debug mode in a dpdk-based application?


I encounter some errors when running a dpdk-based application. I find the error occurs when invoking rte_eth_dev_configure() function provided by dpdk library. The error code is -22. However, I want the application to show more debug information so that I can quickly focus on the error part.

I did RTFM and modified $RTE_SDK/build/.config. I turned RTE_LIBRTE_ETHDEV_DEBUG to be y. But It didn't work. Where does rte_vlog() function put log messages?

Would you like to help me? Any suggestion is appreciated!


Solution

  • You should also change the default log level, otherwise all the debug messages will be compiled out during the compilation, i.e.:

    RTE_LOG_LEVEL=RTE_LOG_DEBUG
    RTE_LIBRTE_ETHDEV_DEBUG=y
    

    Please also have a look at EXTRA_CFLAGS. You might also want to add the debug symbols and disable optimizations, i.e.:

    make EXTRA_CFLAGS="-O0 -g" ...