Răsfoiți Sursa

Add more LRU stats.

aignacio_sf 20 ani în urmă
părinte
comite
0e4acd7a33

+ 4 - 0
panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

@@ -842,8 +842,12 @@ end_frame() {
         dxgsg9_cat.debug() << "*  total_page_access " << _lru -> _m.total_page_access << " avg page access " << ((float) _lru -> _m.total_page_access / (float) frames) << "\n";
         dxgsg9_cat.debug() << "*  total_lru_pages_in_pool " << _lru -> _m.total_lru_pages_in_pool << "\n";
         dxgsg9_cat.debug() << "*  total_lru_pages_in_free_pool " << _lru -> _m.total_lru_pages_in_free_pool << "\n";
+        dxgsg9_cat.debug() << "*  avg unique page access size " << (_lru -> _m.total_page_access_size / (double) frames) << "\n";
+        dxgsg9_cat.debug() << "*  avg of all page access size " << ((_lru -> _m.total_page_access_size + _lru -> _m.total_page_all_access_size) / (double) frames) << "\n";
 
         _lru -> _m.total_page_access = 0;
+        _lru -> _m.total_page_access_size = 0;
+        _lru -> _m.total_page_all_access_size = 0;
 
         _lru -> count_priority_level_pages ( );
 

+ 3 - 0
panda/src/dxgsg9/lru.cxx

@@ -484,6 +484,7 @@ void Lru::access_page (LruPage *lru_page)
     if(lru_page->_m.current_frame_identifier
        == this->_m.current_frame_identifier) {
       lru_page->_m.current_frame_usage++;
+      this->_m.total_page_all_access_size += lru_page->_m.size;
     }
     else {
       // first update this frame
@@ -492,6 +493,8 @@ void Lru::access_page (LruPage *lru_page)
       lru_page->_m.last_frame_usage = lru_page->_m.current_frame_usage;
       lru_page->_m.current_frame_usage = 1;
       lru_page->_m.total_frame_page_faults = 0;
+
+      this->_m.total_page_access_size += lru_page->_m.size;
     }
 
     // check if the page is out

+ 2 - 0
panda/src/dxgsg9/lru.h

@@ -200,6 +200,8 @@ public:
     int total_page_outs;
 
     int total_page_access;
+    double total_page_access_size;
+    double total_page_all_access_size;
 
     int start_priority_index;
     LruPage *start_update_lru_page;