changeset 999:451ddde9a16d

Measurement of mainMem_alloc at waiting time. not done.
author tkaito
date Fri, 22 Oct 2010 20:11:41 +0900
parents 1b018a00cd17
children 847650ebc244
files TaskManager/Cell/spe/CellDmaManager.cc TaskManager/Cell/spe/CellDmaManager.h TaskManager/Cell/spe/CellScheduler.cc
diffstat 3 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Cell/spe/CellDmaManager.cc	Mon Oct 11 19:42:28 2010 +0900
+++ b/TaskManager/Cell/spe/CellDmaManager.cc	Fri Oct 22 20:11:41 2010 +0900
@@ -141,6 +141,9 @@
     wait_time = spu_readch(SPU_RdDec); 
     global_busy_time += busy_time - wait_time;
     spu_writech(SPU_WrDec, 0xffffffff);
+
+    // Measurement of mainMem_alloc
+    mainMemalloc_time += (alloc_busy_time - wait_time)*alloc_flag;
 }
 
 
@@ -151,6 +154,8 @@
     *counter += 0xffffffff - wait_time;
     busy_time = wait_time;
 
+    // Measurement of mainMem_alloc
+    alloc_busy_time = wait_time;
 }
 
 void CellDmaManager::null_start_dmawait_profile() {}
@@ -177,15 +182,18 @@
   " mail_time = %lld(%.3g%%), " 
   " busy_ratio = %.3g%%"
   " array_load_time = %lld\n"
+  " mainMem_alloc_time = %lld\n"
     ,cpu, global_busy_time,
     global_wait_time, d, global_mail_time, m, r,
-    task_array_load_time);
+    task_array_load_time,
+    mainMemalloc_time);
 
     global_busy_time = 0;
     global_mail_time = 0;
     global_wait_time = 0;
     task_array_load_time = 0;
-
+    mainMemalloc_time = 0;
+    alloc_flag = 0;
 }
 
 
--- a/TaskManager/Cell/spe/CellDmaManager.h	Mon Oct 11 19:42:28 2010 +0900
+++ b/TaskManager/Cell/spe/CellDmaManager.h	Fri Oct 22 20:11:41 2010 +0900
@@ -24,9 +24,9 @@
     CellDmaManager() ;
 
     /* variables */
-    unsigned int wait_time, busy_time;
-    unsigned long long global_busy_time, global_wait_time, global_mail_time;
-    unsigned long long task_array_load_time;
+    unsigned int wait_time, busy_time, alloc_busy_time;
+    unsigned long long global_busy_time, global_wait_time, global_mail_time, mainMemalloc_time;
+    unsigned long long task_array_load_time, alloc_flag;
 
     /* functions */
     void dma_load(void *buf, memaddr addr, uint32 size, uint32 mask);
@@ -39,7 +39,7 @@
     void stop_profile();
 
 
-    void show_dma_wait(Scheduler *s, int cpu);
+    void show_wait(Scheduler *s, int cpu);
 
     void mail_write(memaddr data);
     memaddr mail_read();
--- a/TaskManager/Cell/spe/CellScheduler.cc	Mon Oct 11 19:42:28 2010 +0900
+++ b/TaskManager/Cell/spe/CellScheduler.cc	Fri Oct 22 20:11:41 2010 +0900
@@ -30,6 +30,9 @@
 CellScheduler::mainMem_alloc(int id, int size)
 {
     mainMemList[id] = (memaddr)NULL;
+    
+    // flag on. (unsigned long long)
+    alloc_flag = 1;
 
     mainMemNum++;
     mail_write((memaddr)MY_SPE_COMMAND_MALLOC);