summaryrefslogtreecommitdiffstats
path: root/src/main_dpdk.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-06-23 11:27:05 +0300
committerimarom <imarom@cisco.com>2016-06-23 11:27:36 +0300
commit5f84648529772a4b0b52eedfbf3669c6e45d653f (patch)
tree191d61b3a332e7a007c63a716c561824b4f29538 /src/main_dpdk.cpp
parentf672c6c1ac980fa248298b679603da3645735787 (diff)
allow coredump for TRex with --alow-coredump
by default, huge pages will not be mapped to the core
Diffstat (limited to 'src/main_dpdk.cpp')
-rw-r--r--src/main_dpdk.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index dcef2f38..4f8d8937 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -50,6 +50,7 @@
#include <rte_mbuf.h>
#include <rte_random.h>
#include <rte_version.h>
+
#include "bp_sim.h"
#include "os_time.h"
#include "common/arg/SimpleGlob.h"
@@ -553,7 +554,9 @@ enum { OPT_HELP,
OPT_PREFIX,
OPT_MAC_SPLIT,
OPT_SEND_DEBUG_PKT,
- OPT_NO_WATCHDOG
+ OPT_NO_WATCHDOG,
+ OPT_ALLOW_COREDUMP
+
};
@@ -615,7 +618,8 @@ static CSimpleOpt::SOption parser_options[] =
{ OPT_MAC_SPLIT, "--mac-spread", SO_REQ_SEP },
{ OPT_SEND_DEBUG_PKT, "--send-debug-pkt", SO_REQ_SEP },
{ OPT_MBUF_FACTOR , "--mbuf-factor", SO_REQ_SEP },
- { OPT_NO_WATCHDOG , "--no-watchdog", SO_NONE },
+ { OPT_NO_WATCHDOG , "--no-watchdog", SO_NONE },
+ { OPT_ALLOW_COREDUMP , "--allow-coredump", SO_NONE },
SO_END_OF_OPTIONS
@@ -718,6 +722,8 @@ static int usage(){
printf(" \n");
printf(" --no-watchdog : disable watchdog \n");
printf(" \n");
+ printf(" --allow-coredump : allow a creation of core dump \n");
+ printf(" \n");
printf(" --vm-sim : simulate vm with driver of one input queue and one output queue \n");
printf(" \n");
printf(" Examples: ");
@@ -935,6 +941,10 @@ static int parse_options(int argc, char *argv[], CParserOption* po, bool first_t
po->preview.setWDDisable(true);
break;
+ case OPT_ALLOW_COREDUMP :
+ po->preview.setCoreDumpEnable(true);
+ break;
+
case OPT_LATENCY_PREVIEW :
sscanf(args.OptionArg(),"%d", &po->m_latency_prev);
break;
@@ -4703,6 +4713,15 @@ int main_test(int argc , char * argv[]){
exit(-1);
}
+ /* enable core dump if requested */
+ if (CGlobalInfo::m_options.preview.getCoreDumpEnable()) {
+ utl_set_coredump_size(-1);
+ }
+ else {
+ utl_set_coredump_size(0);
+ }
+
+
update_global_info_from_platform_file();
/* It is not a mistake. Give the user higher priorty over the configuration file */
@@ -5779,3 +5798,4 @@ int TrexDpdkPlatformApi::get_active_pgids(flow_stat_active_t &result) const {
CFlowStatParser *TrexDpdkPlatformApi::get_flow_stat_parser() const {
return CTRexExtendedDriverDb::Ins()->get_drv()->get_flow_stat_parser();
}
+