summaryrefslogtreecommitdiffstats
path: root/src/utl_cpuu.h
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-05-10 21:00:45 +0300
committerHanoh Haim <hhaim@cisco.com>2016-05-10 21:00:45 +0300
commit3a0c1c8333382ff8402b05ce47d17f100187df6f (patch)
tree1662f9a268241d1dd6faf3c7b3a8a008455e96b2 /src/utl_cpuu.h
parent2d37b9f98020a4458aaad1f3fd05ca5e408213e0 (diff)
cpu% without tsc
Diffstat (limited to 'src/utl_cpuu.h')
-rwxr-xr-xsrc/utl_cpuu.h26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/utl_cpuu.h b/src/utl_cpuu.h
index bb3fe67c..e5305783 100755
--- a/src/utl_cpuu.h
+++ b/src/utl_cpuu.h
@@ -29,7 +29,6 @@ class CCpuUtlDp {
public:
CCpuUtlDp(){
- m_total_cycles=0;
m_data=0;
}
inline void start_work1(){
@@ -40,26 +39,13 @@ public:
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 uint8_t sample_data(){
+ return (m_data);
}
- inline uint64_t get_work_cycles(void){
- return ( m_total_cycles );
- }
private:
- uint64_t m_total_cycles;
uint8_t m_data;
-
} __rte_cache_aligned;
class CCpuUtlCp {
@@ -73,12 +59,10 @@ public:
private:
CCpuUtlDp * m_dpcpu;
- double m_cpu_util;
- uint64_t m_last_total_cycles;
- uint64_t m_last_work_cycles;
+ uint16_t m_ticks;
+ uint16_t m_work;
-
- // add filter
+ double m_cpu_util;
};
#endif