From 0e4acd7a338cce6223d0ad67b7c4e02f5fd1a1ce Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Thu, 29 Dec 2005 21:27:27 +0000 Subject: [PATCH] Add more LRU stats. --- panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 4 ++++ panda/src/dxgsg9/lru.cxx | 3 +++ panda/src/dxgsg9/lru.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 6c22a0df10..4c4ba9f536 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/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 ( ); diff --git a/panda/src/dxgsg9/lru.cxx b/panda/src/dxgsg9/lru.cxx index 2716871e3a..b0ef72ef8b 100644 --- a/panda/src/dxgsg9/lru.cxx +++ b/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 diff --git a/panda/src/dxgsg9/lru.h b/panda/src/dxgsg9/lru.h index 07fd2ced56..7e1db8b142 100644 --- a/panda/src/dxgsg9/lru.h +++ b/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;