浏览代码

Memory access stats are now enabled on COUNT_ACCESSES flag.

Ioannis Koutras 13 年之前
父节点
当前提交
e504bfc83a
共有 4 个文件被更改,包括 9 次插入0 次删除
  1. 1 0
      CMakeLists.txt
  2. 5 0
      DefineOptions.cmake
  3. 1 0
      dmm_config.h.in
  4. 2 0
      include/dmmlib/heap.h

+ 1 - 0
CMakeLists.txt

@@ -46,6 +46,7 @@ message(STATUS "Predefined lists of fixed-sized blocks: " ${WITH_FIXED_LISTS})
 message(STATUS "Heap Ownership per Block: " ${WITH_OWNERSHIP})
 message(STATUS "Have statistics: " ${WITH_STATS})
 if (WITH_STATS)
+  message(STATUS "Count memory accesses: " ${COUNT_ACCESSES})
   message(STATUS "Count hops per request: " ${COUNT_HOPS})
 endif (WITH_STATS)
 message(STATUS "Have knobs: " ${WITH_KNOBS})

+ 5 - 0
DefineOptions.cmake

@@ -4,6 +4,7 @@ option(WITH_EXAMPLES "Build with examples" OFF)
 option(WITH_MEMORY_SPACE_AWARENESS "Build with memory space awareness" OFF)
 option(WITH_FIXED_LISTS "Build with predefined lists of fixed-sized blocks" ON)
 option(WITH_STATS "Build with statistics" OFF)
+option(COUNT_ACCESSES "Count memory accesses" OFF)
 option(COUNT_HOPS "Count hops per request" OFF)
 option(WITH_KNOBS "Build with knobs support" OFF)
 option(WITH_ADAPTIVITY "Build with adaptivity" OFF)
@@ -138,6 +139,10 @@ elseif(WITH_SPLITTING STREQUAL "variable")
   set(SPLITTING_VARIABLE ON)
 endif(WITH_SPLITTING STREQUAL "fixed")
 
+if(COUNT_ACCESSES)
+ set(WITH_STATS ON)
+endif(COUNT_HOPS)
+
 if(COUNT_HOPS)
  set(WITH_STATS ON)
 endif(COUNT_HOPS)

+ 1 - 0
dmm_config.h.in

@@ -36,6 +36,7 @@
 #cmakedefine MIN_SPLITTING_SIZE @MIN_SPLITTING_SIZE@
 
 #cmakedefine WITH_STATS
+#cmakedefine COUNT_ACCESSES
 #cmakedefine COUNT_HOPS
 
 #cmakedefine WITH_KNOBS

+ 2 - 0
include/dmmlib/heap.h

@@ -72,8 +72,10 @@ typedef struct dmmstats_s {
 	size_t mem_allocated; /**< Total memory currently allocated. */
 	size_t mem_requested; /**< Total memory currently requested. */
 	uint32_t live_objects; /**< Number of the currently used blocks. */
+#ifdef COUNT_ACCESSES
 	uint32_t read_mem_accesses; /**< Number of read accesses. */
 	uint32_t write_mem_accesses; /**< Number of write accesses. */
+#endif /* COUNT_ACCESSES */
 	uint32_t num_malloc; /**< Number of malloc()'s served. */
 	uint32_t num_free; /**< Number of free()'s served. */
 #ifdef COUNT_HOPS