From dbd2b47ce0683051288d3fa225285956fab5ab3f Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Mon, 21 Dec 2015 11:27:58 +0200 Subject: latency.cpp: update ports stats at CLatencyManager::update, instead of CCPortLatency::DumpShort Python API added: * is_idle(): determine if TRex is in idle state * sample_x_seconds(): sample TRex for given number of seconds, useful for changing device (router etc.) config afterwards. --- src/latency.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/latency.cpp b/src/latency.cpp index 02b54f75..3969c357 100644 --- a/src/latency.cpp +++ b/src/latency.cpp @@ -268,7 +268,7 @@ void CCPortLatency::dump_json(std::string & json ){ void CCPortLatency::DumpShort(FILE *fd){ - m_hist.update(); +// m_hist.update(); <- moved to CLatencyManager::update() fprintf(fd,"%8lu,%8lu,%10lu,%4lu,", m_tx_pkt_ok, m_pkt_ok, @@ -907,6 +907,10 @@ void CLatencyManager::rx_check_dump_json(std::string & json){ void CLatencyManager::update(){ m_cpu_cp_u.Update() ; + for (int i=0; im_port.m_hist.update(); + } } void CLatencyManager::DumpShort(FILE *fd){ -- cgit 1.2.3-korg From a667765535119953ca73ba5f75c815b36648588c Mon Sep 17 00:00:00 2001 From: imarom Date: Mon, 21 Dec 2015 17:32:05 +0200 Subject: CRASH: uninit var at stateless port object --- scripts/run-gtest-clean | 0 src/stateless/cp/trex_stateless_port.cpp | 2 ++ 2 files changed, 2 insertions(+) mode change 100644 => 100755 scripts/run-gtest-clean (limited to 'src') diff --git a/scripts/run-gtest-clean b/scripts/run-gtest-clean old mode 100644 new mode 100755 diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp index 3a64f8c5..aa34e87b 100644 --- a/src/stateless/cp/trex_stateless_port.cpp +++ b/src/stateless/cp/trex_stateless_port.cpp @@ -72,6 +72,8 @@ TrexStatelessPort::TrexStatelessPort(uint8_t port_id, const TrexPlatformApi *api /* init the events DP DB */ m_dp_events.create(this); + + m_graph_obj = NULL; } -- cgit 1.2.3-korg