trace: add trace directory configuration parameter
[dpdk.git] / lib / librte_eal / common / eal_common_options.c
index bb6c131..f242d56 100644 (file)
@@ -69,6 +69,7 @@ eal_long_options[] = {
        {OPT_LCORES,            1, NULL, OPT_LCORES_NUM           },
        {OPT_LOG_LEVEL,         1, NULL, OPT_LOG_LEVEL_NUM        },
        {OPT_TRACE,             1, NULL, OPT_TRACE_NUM            },
+       {OPT_TRACE_DIR,         1, NULL, OPT_TRACE_DIR_NUM        },
        {OPT_MASTER_LCORE,      1, NULL, OPT_MASTER_LCORE_NUM     },
        {OPT_MBUF_POOL_OPS_NAME, 1, NULL, OPT_MBUF_POOL_OPS_NAME_NUM},
        {OPT_NO_HPET,           0, NULL, OPT_NO_HPET_NUM          },
@@ -1430,6 +1431,15 @@ eal_parse_common_option(int opt, const char *optarg,
                break;
        }
 
+       case OPT_TRACE_DIR_NUM: {
+               if (eal_trace_dir_args_save(optarg) < 0) {
+                       RTE_LOG(ERR, EAL, "invalid parameters for --"
+                               OPT_TRACE_DIR "\n");
+                       return -1;
+               }
+               break;
+       }
+
        case OPT_LCORES_NUM:
                if (eal_parse_lcores(optarg) < 0) {
                        RTE_LOG(ERR, EAL, "invalid parameter for --"
@@ -1709,6 +1719,11 @@ eal_common_usage(void)
               "                      Enable trace based on regular expression trace name.\n"
               "                      By default, the trace is disabled.\n"
               "                      User must specify this option to enable trace.\n"
+              "  --"OPT_TRACE_DIR"=<directory path>\n"
+              "                      Specify trace directory for trace output.\n"
+              "                      By default, trace output will created at\n"
+              "                      $HOME directory and parameter must be\n"
+              "                      specified once only.\n"
               "  -v                  Display version information on startup\n"
               "  -h, --help          This help\n"
               "  --"OPT_IN_MEMORY"   Operate entirely in memory. This will\n"