changeset 1701:4a3b3ec582f2 draft

profile of each task
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Mon, 07 Oct 2013 23:02:10 +0900
parents 9009204d1e18
children eab9b8205b85
files TaskManager/kernel/ppe/TaskList.h TaskManager/kernel/schedule/SchedTask.cc
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/TaskList.h	Mon Oct 07 15:23:13 2013 +0900
+++ b/TaskManager/kernel/ppe/TaskList.h	Mon Oct 07 23:02:10 2013 +0900
@@ -20,7 +20,7 @@
     int dim;
     size_t x,y,z;
     Task tasks[TASK_MAX_SIZE]; // 32*TASK_MAX_SIZE
-    
+    unsigned long long start_time,stop_time;
 
     TaskPtr last() { return (TaskPtr)(((memaddr)tasks)+lastTask); }
     void set_last(Task *t) { lastTask = ((memaddr)t) - ((memaddr)tasks); }
--- a/TaskManager/kernel/schedule/SchedTask.cc	Mon Oct 07 15:23:13 2013 +0900
+++ b/TaskManager/kernel/schedule/SchedTask.cc	Mon Oct 07 23:02:10 2013 +0900
@@ -9,7 +9,7 @@
 #include "error.h"
 #include "TaskManager.h"
 #include <stdarg.h>
-
+#include "gettime.h"
 
 extern TaskObject task_list[MAX_TASK_OBJECT];
 
@@ -114,6 +114,7 @@
     connector->dma_wait((DMA_READ + this->tag));
     void *read = get_input(readbuf, 0); void *write =  get_output(writebuf, 0);
     // set param (if exist dim )
+    list->start_time = gettime();
     (*connector->start_dmawait_profile)();
     if (list->dim) {
         multi_dimension(list, read, write,run);
@@ -121,6 +122,8 @@
         run(this, read,write);
     }
     (*connector->end_dmawait_profile)(&connector->global_busy_time);
+    list->stop_time = gettime();
+    this->printf("%s\t%lld\n",(char *)(task_list[atask->command].name),list->stop_time-list->start_time);
     connector->free_(readbuf);
     // User 側で作る方法が必要...
     // 書き込む領域がなければ無視