changeset 1369:186b0681bc87 draft

modified result of the measure
author Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
date Fri, 20 Jan 2012 17:23:10 +0900
parents f53e986715fa
children 6af1f474db3e
files TaskManager/Fifo/FifoDmaManager.cc TaskManager/Fifo/PreRefDmaManager.cc TaskManager/Fifo/ReferencedDmaManager.cc
diffstat 3 files changed, 31 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoDmaManager.cc	Fri Jan 20 07:34:02 2012 +0900
+++ b/TaskManager/Fifo/FifoDmaManager.cc	Fri Jan 20 17:23:10 2012 +0900
@@ -133,7 +133,7 @@
 FifoDmaManager::stop_profile()
 {
 	start_time = rdtsc();
-	global_busy_time = stop_time - start_time;
+	global_busy_time = start_time - stop_time;
 
 	start_dmawait_profile = &FifoDmaManager::null_start_dmawait_profile;
 	end_dmawait_profile = &FifoDmaManager::null_end_dmawait_profile;
@@ -143,7 +143,7 @@
 FifoDmaManager::do_start_dmawait_profile()
 {
 	start_time = rdtsc();
-	global_busy_time += stop_time - start_time;
+	global_busy_time += start_time - stop_time;
 }
 
 void
@@ -166,10 +166,12 @@
 	double store = ((double)global_store_time)/((double)all_time)*100.0;
 
 
-	s->printf("cpu%d:\n busy_time = %.3g%%"
-			" load_time = %.3g%%, "
-			" store_time = %.3g%% \n"
-			,cpu, busy, load, store);
+	s->printf("cpu%d:\n busy_time = %lld(%.3g%%), "
+			" load_time = %lld(%.3g%%), "
+			" store_time = %lld(%.3g%%) \n"
+			,cpu, global_busy_time, busy, 
+			global_load_time, load,
+			global_store_time, store);
 
 	global_busy_time = 0;
 	global_load_time = 0;
--- a/TaskManager/Fifo/PreRefDmaManager.cc	Fri Jan 20 07:34:02 2012 +0900
+++ b/TaskManager/Fifo/PreRefDmaManager.cc	Fri Jan 20 17:23:10 2012 +0900
@@ -5,9 +5,17 @@
 void *
 PreRefDmaManager::dma_load(Scheduler *s, void *buf, memaddr addr, uint32 size, uint32 mask)
 {
+	unsigned long long wait = 0;
+	(this->*start_dmawait_profile)();
+
 #ifdef __CERIUM_FIFO__
 	asm("prefetcht0 %0"::"m"(addr):"memory");
 #endif // __CERIUM_FIFO__
+
+	(this->*end_dmawait_profile)(&wait);
+	global_load_time += wait;
+	dma_load_time += wait;
+
 	return (void*)addr;
 }
 
--- a/TaskManager/Fifo/ReferencedDmaManager.cc	Fri Jan 20 07:34:02 2012 +0900
+++ b/TaskManager/Fifo/ReferencedDmaManager.cc	Fri Jan 20 17:23:10 2012 +0900
@@ -5,12 +5,27 @@
 void *
 ReferencedDmaManager::dma_load(Scheduler *s, void *buf, memaddr addr, uint32 size, uint32 mask)
 {
+	unsigned long long wait = 0;
+	(this->*start_dmawait_profile)();
+
+	(this->*end_dmawait_profile)(&wait);
+	global_load_time += wait;
+	dma_load_time += wait;
+
 	return (void*)addr;
 }
 
 void *
 ReferencedDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, void *buff, uint32 mask)
 {
+	unsigned long long wait = 0;
+	(this->*start_dmawait_profile)();
+
 	ListElementPtr elm = &list->element[0];
+
+	(this->*end_dmawait_profile)(&wait);
+	global_load_time += wait;
+	dma_loadList_time += wait;
+
     return (void*)elm->addr; 
 }