aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_vtr.py
AgeCommit message (Expand)AuthorFilesLines
2023-11-03tests: refactor asf framework codeDave Wallace1-1/+2
2022-05-10tests: replace pycodestyle with blackKlement Sekera1-132/+154
2019-11-12interface: Allow VLAN tag-rewrite on non-sub-interfaces too.Jon Loeliger1-0/+50
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
2019-04-11Tests: Refactor tearDown show command logging, add lifecycle markers.Paul Vinciguerra1-4/+5
2019-04-10Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.Paul Vinciguerra1-0/+4
2019-03-29tests: test/vpp_l2.py fix missing name.Paul Vinciguerra1-2/+1
2019-03-11vpp_papi_provider: Remove more wrapper functions.Ole Troan1-5/+5
2017-06-21L2-VTR: add vtr testsEyal Bari1-0/+332
in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <stdint.h> #include "os_time.h" #include "mbuf.h" class CCpuUtlDp { public: CCpuUtlDp(){ m_total_cycles=0; m_data=0; } inline void start_work(){ m_data=os_get_hr_tick_64(); } inline void revert(){ } inline void commit(){ m_total_cycles+=(os_get_hr_tick_64()-m_data); } inline uint64_t get_total_cycles(void){ return ( os_get_hr_tick_64()); } inline uint64_t get_work_cycles(void){ return ( m_total_cycles ); } private: uint64_t m_total_cycles; uint64_t m_data; } __rte_cache_aligned; class CCpuUtlCp { public: void Create(CCpuUtlDp * cdp); void Delete(); /* should be called each 1 sec */ void Update(); /* return cpu % */ double GetVal(); private: CCpuUtlDp * m_dpcpu; double m_cpu_util; uint64_t m_last_total_cycles; uint64_t m_last_work_cycles; // add filter }; #endif