app/testpmd: initialize pdump
[dpdk.git] / app / test-pmd / testpmd.c
index 8060c99..06885ce 100644 (file)
@@ -76,6 +76,9 @@
 #ifdef RTE_LIBRTE_PMD_XENVIRT
 #include <rte_eth_xenvirt.h>
 #endif
+#ifdef RTE_LIBRTE_PDUMP
+#include <rte_pdump.h>
+#endif
 
 #include "testpmd.h"
 
@@ -2033,6 +2036,10 @@ signal_handler(int signum)
        if (signum == SIGINT || signum == SIGTERM) {
                printf("\nSignal %d received, preparing to exit...\n",
                                signum);
+#ifdef RTE_LIBRTE_PDUMP
+               /* uninitialize packet capture framework */
+               rte_pdump_uninit();
+#endif
                force_quit();
                /* exit with the expected status */
                signal(signum, SIG_DFL);
@@ -2053,6 +2060,11 @@ main(int argc, char** argv)
        if (diag < 0)
                rte_panic("Cannot init EAL\n");
 
+#ifdef RTE_LIBRTE_PDUMP
+       /* initialize packet capture framework */
+       rte_pdump_init(NULL);
+#endif
+
        nb_ports = (portid_t) rte_eth_dev_count();
        if (nb_ports == 0)
                RTE_LOG(WARNING, EAL, "No probed ethernet devices\n");