changeset 1364:f53e986715fa draft

add start_profile_init in constructer.
author Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
date Fri, 20 Jan 2012 07:34:02 +0900
parents 38ee695f772c
children a5797dff2262 186b0681bc87
files TaskManager/Fifo/FifoDmaManager.cc TaskManager/Fifo/FifoDmaManager.h
diffstat 2 files changed, 23 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoDmaManager.cc	Fri Jan 20 05:46:56 2012 +0900
+++ b/TaskManager/Fifo/FifoDmaManager.cc	Fri Jan 20 07:34:02 2012 +0900
@@ -11,15 +11,15 @@
 {
     if (size == 0) return buf;
 
-	//unsigned long long wait = 0;
-	//(this->*start_dmawait_profile)();
+	unsigned long long wait = 0;
+	(this->*start_dmawait_profile)();
 
     if (s) buf = s->manager->allocate(size);
     memcpy(buf, (void*)addr, size);
 
-	//(this->*end_dmawait_profile)(&wait);
-	//global_load_time += wait;
-	//dma_load_time += wait;
+	(this->*end_dmawait_profile)(&wait);
+	global_load_time += wait;
+	dma_load_time += wait;
 
     return buf;
 }
@@ -36,14 +36,14 @@
 {
     if (size == 0) return buf;
 
-	//unsigned long long wait = 0;
-	//(this->*start_dmawait_profile)();
+	unsigned long long wait = 0;
+	(this->*start_dmawait_profile)();
 
     memcpy((void*)addr, buf, size);
 
-	//(this->*end_dmawait_profile)(&wait);
-	//global_store_time += wait;
-	//dma_store_time += wait;
+	(this->*end_dmawait_profile)(&wait);
+	global_store_time += wait;
+	dma_store_time += wait;
 
     return buf;
 }
@@ -60,8 +60,8 @@
 void *
 FifoDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, void *buff, uint32 mask)
 {
-	//unsigned long long wait = 0;
-	//(this->*start_dmawait_profile)();
+	unsigned long long wait = 0;
+	(this->*start_dmawait_profile)();
 
     int list_size = list->length;
     long bound;
@@ -75,9 +75,9 @@
 	bound += elm->size;
     }
 
-	//(this->*end_dmawait_profile)(&wait);
-	//global_load_time += wait;
-	//dma_loadList_time += wait;
+	(this->*end_dmawait_profile)(&wait);
+	global_load_time += wait;
+	dma_loadList_time += wait;
 
     return buff;
 }
@@ -93,8 +93,8 @@
 void
 FifoDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask)
 {
-	//unsigned long long wait = 0;
-	//(this->*start_dmawait_profile)();
+	unsigned long long wait = 0;
+	(this->*start_dmawait_profile)();
 
     int list_size = list->length;
     memaddr bound;
@@ -107,9 +107,9 @@
 	bound += elm->size;
     }
 
-	//(this->*end_dmawait_profile)(&wait);
-	//global_store_time += wait;
-	//dma_storeList_time += wait;
+	(this->*end_dmawait_profile)(&wait);
+	global_store_time += wait;
+	dma_storeList_time += wait;
 }
 
 void
@@ -168,7 +168,7 @@
 
 	s->printf("cpu%d:\n busy_time = %.3g%%"
 			" load_time = %.3g%%, "
-			" store_time = %.3g%% "
+			" store_time = %.3g%% \n"
 			,cpu, busy, load, store);
 
 	global_busy_time = 0;
--- a/TaskManager/Fifo/FifoDmaManager.h	Fri Jan 20 05:46:56 2012 +0900
+++ b/TaskManager/Fifo/FifoDmaManager.h	Fri Jan 20 07:34:02 2012 +0900
@@ -28,6 +28,8 @@
     		mail_queue1 = new MailManager();
     		mail_queue2 = new MailManager();
 #endif
+			start_dmawait_profile = &FifoDmaManager::null_start_dmawait_profile;
+			end_dmawait_profile = &FifoDmaManager::null_end_dmawait_profile;
     }
 
     ~FifoDmaManager() {